You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/02/19 12:23:45 UTC

svn commit: r911788 - /incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java

Author: fguillaume
Date: Fri Feb 19 11:23:45 2010
New Revision: 911788

URL: http://svn.apache.org/viewvc?rev=911788&view=rev
Log:
Keep a map of all standard system properties, for convenience. Keep prop def order for stability.

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java?rev=911788&r1=911787&r2=911788&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java Fri Feb 19 11:23:45 2010
@@ -22,6 +22,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -250,7 +251,19 @@
             PROP_TARGET_ID);
 
     public static final List<PropertyDefinition> PROPS_POLICY_BASE = commonPlus( //
-            PROP_POLICY_TEXT);
+    PROP_POLICY_TEXT);
+
+    public static final Map<String, PropertyDefinition> PROPS_MAP;
+    static {
+        Map<String, PropertyDefinition> map = new HashMap<String, PropertyDefinition>();
+        for (List<PropertyDefinition> lpd : Arrays.asList(PROPS_DOCUMENT_BASE,
+                PROPS_FOLDER_BASE, PROPS_RELATIONSHIP_BASE, PROPS_POLICY_BASE)) {
+            for (PropertyDefinition pd : lpd) {
+                map.put(pd.getId(), pd);
+            }
+        }
+        PROPS_MAP = Collections.unmodifiableMap(map);
+    }
 
     protected final String id;
 
@@ -337,7 +350,7 @@
         this.contentStreamAllowed = contentStreamAllowed;
         this.allowedSourceTypes = allowedSourceTypes;
         this.allowedTargetTypes = allowedTargetTypes;
-        propertyDefinitions = new HashMap<String, PropertyDefinition>();
+        propertyDefinitions = new LinkedHashMap<String, PropertyDefinition>();
     }
 
     protected void addPropertyDefinitions(Collection<PropertyDefinition> defs) {