directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1243872 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java
Date Tue, 14 Feb 2012 11:02:13 GMT
Author: pamarcelot
Date: Tue Feb 14 11:02:13 2012
New Revision: 1243872

URL: http://svn.apache.org/viewvc?rev=1243872&view=rev
Log:
Adding the syntax attribute in the entry of a converted AttributeType only if there is one.
Applied code formatter.

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java?rev=1243872&r1=1243871&r2=1243872&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributesFactory.java
Tue Feb 14 11:02:13 2012
@@ -59,35 +59,35 @@ public class AttributesFactory
     {
         if ( obj instanceof LdapSyntax )
         {
-            return convert( (LdapSyntax)obj, schema, schemaManager );
+            return convert( ( LdapSyntax ) obj, schema, schemaManager );
         }
         else if ( obj instanceof MatchingRule )
         {
-            return convert( (MatchingRule)obj, schema, schemaManager );
+            return convert( ( MatchingRule ) obj, schema, schemaManager );
         }
         else if ( obj instanceof AttributeType )
         {
-            return convert( (AttributeType)obj, schema, schemaManager );
+            return convert( ( AttributeType ) obj, schema, schemaManager );
         }
         else if ( obj instanceof ObjectClass )
         {
-            return convert( (ObjectClass)obj, schema, schemaManager );
+            return convert( ( ObjectClass ) obj, schema, schemaManager );
         }
         else if ( obj instanceof MatchingRuleUse )
         {
-            return convert( (MatchingRuleUse)obj, schema, schemaManager );
+            return convert( ( MatchingRuleUse ) obj, schema, schemaManager );
         }
         else if ( obj instanceof DITStructureRule )
         {
-            return convert( (DITStructureRule)obj, schema, schemaManager );
+            return convert( ( DITStructureRule ) obj, schema, schemaManager );
         }
         else if ( obj instanceof DITContentRule )
         {
-            return convert( (DITContentRule)obj, schema, schemaManager );
+            return convert( ( DITContentRule ) obj, schema, schemaManager );
         }
         else if ( obj instanceof NameForm )
         {
-            return convert( (NameForm)obj, schema, schemaManager );
+            return convert( ( NameForm ) obj, schema, schemaManager );
         }
 
         throw new IllegalArgumentException( "nknown SchemaObject type: " + obj.getClass()
);
@@ -277,7 +277,6 @@ public class AttributesFactory
         Entry entry = new DefaultEntry( schemaManager );
 
         entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC
);
-        entry.put( MetaSchemaConstants.M_SYNTAX_AT, attributeType.getSyntaxOid() );
         entry.put( MetaSchemaConstants.M_COLLECTIVE_AT, getBoolean( attributeType.isCollective()
) );
         entry.put( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT, getBoolean( !attributeType.isUserModifiable()
) );
         entry.put( MetaSchemaConstants.M_SINGLE_VALUE_AT, getBoolean( attributeType.isSingleValued()
) );
@@ -309,6 +308,11 @@ public class AttributesFactory
             entry.put( MetaSchemaConstants.M_ORDERING_AT, attributeType.getOrderingOid()
);
         }
 
+        if ( attributeType.getSyntaxOid() != null )
+        {
+            entry.put( MetaSchemaConstants.M_SYNTAX_AT, attributeType.getSyntaxOid() );
+        }
+
         return entry;
     }
 
@@ -344,7 +348,7 @@ public class AttributesFactory
 
         injectCommon( objectClass, entry, schemaManager );
         Attribute attr = null;
-        
+
         // handle the superior objectClasses
         if ( objectClass.getSuperiorOids() != null && objectClass.getSuperiorOids().size()
!= 0 )
         {
@@ -421,16 +425,16 @@ public class AttributesFactory
         {
             entry.put( MetaSchemaConstants.M_DESCRIPTION_AT, object.getDescription() );
         }
-        
+
         // The extensions
         Map<String, List<String>> extensions = object.getExtensions();
-        
+
         if ( extensions != null )
         {
             for ( String key : extensions.keySet() )
             {
                 List<String> values = extensions.get( key );
-                
+
                 for ( String value : values )
                 {
                     entry.add( key, value );
@@ -448,7 +452,7 @@ public class AttributesFactory
         }
 
         Attribute attr = null;
-        
+
         if ( schemaManager != null )
         {
             attr = new DefaultAttribute( schemaManager.getAttributeType( MetaSchemaConstants.M_NAME_AT
) );



Mime
View raw message