directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1024064 - /directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
Date Mon, 18 Oct 2010 23:47:40 GMT
Author: elecharny
Date: Mon Oct 18 23:47:39 2010
New Revision: 1024064

URL: http://svn.apache.org/viewvc?rev=1024064&view=rev
Log:
Changes the storage of Extensions, as we may have more than one extension per schema element

Modified:
    directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java?rev=1024064&r1=1024063&r2=1024064&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
Mon Oct 18 23:47:39 2010
@@ -21,7 +21,9 @@ package org.apache.directory.shared.conv
 
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
@@ -54,7 +56,7 @@ public abstract class SchemaElementImpl 
     protected boolean obsolete = false;
 
     /** The optional list of extensions */
-    protected List<String> extensions = new ArrayList<String>();
+    protected Map<String, List<String>> extensions = new HashMap<String, List<String>>();
 
 
     /**
@@ -123,7 +125,16 @@ public abstract class SchemaElementImpl 
     /**
      * {@inheritDoc}
      */
-    public List<String> getExtensions()
+    public List<String> getExtension( String key)
+    {
+        return extensions.get( key );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, List<String>> getExtensions()
     {
         return extensions;
     }
@@ -132,7 +143,7 @@ public abstract class SchemaElementImpl 
     /**
      * {@inheritDoc}
      */
-    public void setExtensions( List<String> extensions )
+    public void setExtensions( Map<String, List<String>> extensions )
     {
         this.extensions = extensions;
     }
@@ -221,7 +232,7 @@ public abstract class SchemaElementImpl 
         Entry entry = new DefaultEntry();
         EntryAttribute attribute = new DefaultEntryAttribute( id );
 
-        for ( String extension : extensions )
+        for ( String extension : extensions.keySet() )
         {
             attribute.add( extension );
         }



Mime
View raw message