directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r474736 - in /directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema: SchemaFromFileConverter.java bootstrap/BootstrapSchemaLoader.java
Date Tue, 14 Nov 2006 11:22:22 GMT
Author: elecharny
Date: Tue Nov 14 03:22:22 2006
New Revision: 474736

URL: http://svn.apache.org/viewvc?view=rev&rev=474736
Log:
End the switch to Enums.

Modified:
    directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaFromFileConverter.java
    directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoader.java

Modified: directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaFromFileConverter.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaFromFileConverter.java?view=diff&rev=474736&r1=474735&r2=474736
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaFromFileConverter.java
(original)
+++ directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaFromFileConverter.java
Tue Nov 14 03:22:22 2006
@@ -257,90 +257,90 @@
     {
         switch ( type )
         {
-            case ( ProducerTypeEnum.NORMALIZER_PRODUCER_VAL    ):
+            case NORMALIZER_PRODUCER :
                 Normalizer normalizer = ( Normalizer ) schemaObject;
                 NormalizerRegistry normalizerRegistry;
                 normalizerRegistry = registries.getNormalizerRegistry();
                 normalizerRegistry.register( schemaName, id, normalizer );
                 break;
                 
-            case ( ProducerTypeEnum.COMPARATOR_PRODUCER_VAL    ):
+            case COMPARATOR_PRODUCER :
                 Comparator comparator = ( Comparator ) schemaObject;
                 ComparatorRegistry comparatorRegistry;
                 comparatorRegistry = registries.getComparatorRegistry();
                 comparatorRegistry.register( schemaName, id, comparator );
                 break;
                 
-            case ( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER_VAL    ):
+            case SYNTAX_CHECKER_PRODUCER :
                 SyntaxChecker syntaxChecker = ( SyntaxChecker ) schemaObject;
                 SyntaxCheckerRegistry syntaxCheckerRegistry;
                 syntaxCheckerRegistry = registries.getSyntaxCheckerRegistry();
                 syntaxCheckerRegistry.register( schemaName, id, syntaxChecker );
                 break;
                 
-            case ( ProducerTypeEnum.SYNTAX_PRODUCER_VAL    ):
+            case SYNTAX_PRODUCER :
                 Syntax syntax = ( Syntax ) schemaObject;
                 SyntaxRegistry syntaxRegistry = registries.getSyntaxRegistry();
                 syntaxRegistry.register( schemaName, syntax );
                 break;
                 
-            case ( ProducerTypeEnum.MATCHING_RULE_PRODUCER_VAL    ):
+            case MATCHING_RULE_PRODUCER :
                 MatchingRule matchingRule = ( MatchingRule ) schemaObject;
                 MatchingRuleRegistry matchingRuleRegistry;
                 matchingRuleRegistry = registries.getMatchingRuleRegistry();
                 matchingRuleRegistry.register( schemaName, matchingRule );
                 break;
                 
-            case ( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER_VAL    ):
+            case ATTRIBUTE_TYPE_PRODUCER :
                 AttributeType attributeType = ( AttributeType ) schemaObject;
                 AttributeTypeRegistry attributeTypeRegistry;
                 attributeTypeRegistry = registries.getAttributeTypeRegistry();
                 attributeTypeRegistry.register( schemaName, attributeType );
                 break;
                 
-            case ( ProducerTypeEnum.OBJECT_CLASS_PRODUCER_VAL    ):
+            case OBJECT_CLASS_PRODUCER :
                 ObjectClass objectClass = ( ObjectClass ) schemaObject;
                 ObjectClassRegistry objectClassRegistry;
                 objectClassRegistry = registries.getObjectClassRegistry();
                 objectClassRegistry.register( schemaName, objectClass );
                 break;
                 
-            case ( ProducerTypeEnum.MATCHING_RULE_USE_PRODUCER_VAL    ):
+            case MATCHING_RULE_USE_PRODUCER :
                 MatchingRuleUse matchingRuleUse = ( MatchingRuleUse ) schemaObject;
                 MatchingRuleUseRegistry matchingRuleUseRegistry;
                 matchingRuleUseRegistry = registries.getMatchingRuleUseRegistry();
                 matchingRuleUseRegistry.register( schemaName, matchingRuleUse );
                 break;
                 
-            case ( ProducerTypeEnum.DIT_CONTENT_RULE_PRODUCER_VAL    ):
+            case DIT_CONTENT_RULE_PRODUCER :
                 DITContentRule ditContentRule = ( DITContentRule ) schemaObject;
                 DITContentRuleRegistry ditContentRuleRegistry;
                 ditContentRuleRegistry = registries.getDitContentRuleRegistry();
                 ditContentRuleRegistry.register( schemaName, ditContentRule );
                 break;
                 
-            case ( ProducerTypeEnum.NAME_FORM_PRODUCER_VAL    ):
+            case NAME_FORM_PRODUCER :
                 NameForm nameForm = ( NameForm ) schemaObject;
                 NameFormRegistry nameFormRegistry;
                 nameFormRegistry = registries.getNameFormRegistry();
                 nameFormRegistry.register( schemaName, nameForm );
                 break;
                 
-            case ( ProducerTypeEnum.DIT_STRUCTURE_RULE_PRODUCER_VAL    ):
+            case DIT_STRUCTURE_RULE_PRODUCER :
                 DITStructureRule ditStructureRule = ( DITStructureRule ) schemaObject;
                 DITStructureRuleRegistry ditStructureRuleRegistry;
                 ditStructureRuleRegistry = registries.getDitStructureRuleRegistry();
                 ditStructureRuleRegistry.register( schemaName, ditStructureRule );
                 break;
                 
-            case ( ProducerTypeEnum.STATE_FACTORY_PRODUCER_VAL    ):
+            case STATE_FACTORY_PRODUCER :
                 ServerDirStateFactory stateFactory = ( ServerDirStateFactory ) schemaObject;
                 StateFactoryRegistry stateFactoryRegistry;
                 stateFactoryRegistry = registries.getStateFactoryRegistry();
                 stateFactoryRegistry.register( stateFactory );
                 break;
                 
-            case ( ProducerTypeEnum.OBJECT_FACTORY_PRODUCER_VAL    ):
+            case OBJECT_FACTORY_PRODUCER :
                 ServerDirObjectFactory objectFactory = ( ServerDirObjectFactory ) schemaObject;
                 ObjectFactoryRegistry objectFactoryRegistry;
                 objectFactoryRegistry = registries.getObjectFactoryRegistry();

Modified: directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoader.java?view=diff&rev=474736&r1=474735&r2=474736
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoader.java
(original)
+++ directory/branches/apacheds-schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoader.java
Tue Nov 14 03:22:22 2006
@@ -205,11 +205,11 @@
         this.registries.set( registries );
         this.schemas.set( schema );
 
-        List producers = ProducerTypeEnum.list();
-        for ( int ii = 0; ii < producers.size(); ii++ )
+        List<ProducerTypeEnum> producers = ProducerTypeEnum.getList();
+        
+        for (ProducerTypeEnum producerType:producers )
         {
-            ProducerTypeEnum producerType = ( ProducerTypeEnum ) producers.get( ii );
-            BootstrapProducer producer = getProducer( schema, producerType );
+            BootstrapProducer producer = getProducer( schema, producerType.toString() );
             producer.produce( registries, cb );
         }
     }
@@ -235,78 +235,90 @@
 
         switch ( type )
         {
-            case ( ProducerTypeEnum.NORMALIZER_PRODUCER_VAL  ):
+            case NORMALIZER_PRODUCER :
                 Normalizer normalizer = ( Normalizer ) schemaObject;
                 NormalizerRegistry normalizerRegistry;
                 normalizerRegistry = registries.getNormalizerRegistry();
                 normalizerRegistry.register( schema.getSchemaName(), id, normalizer );
                 break;
-            case ( ProducerTypeEnum.COMPARATOR_PRODUCER_VAL  ):
+                
+            case COMPARATOR_PRODUCER :
                 Comparator comparator = ( Comparator ) schemaObject;
                 ComparatorRegistry comparatorRegistry;
                 comparatorRegistry = registries.getComparatorRegistry();
                 comparatorRegistry.register( schema.getSchemaName(), id, comparator );
                 break;
-            case ( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER_VAL  ):
+                
+            case SYNTAX_CHECKER_PRODUCER :
                 SyntaxChecker syntaxChecker = ( SyntaxChecker ) schemaObject;
                 SyntaxCheckerRegistry syntaxCheckerRegistry;
                 syntaxCheckerRegistry = registries.getSyntaxCheckerRegistry();
                 syntaxCheckerRegistry.register( schema.getSchemaName(), id, syntaxChecker
);
                 break;
-            case ( ProducerTypeEnum.SYNTAX_PRODUCER_VAL  ):
+                
+            case SYNTAX_PRODUCER :
                 Syntax syntax = ( Syntax ) schemaObject;
                 SyntaxRegistry syntaxRegistry = registries.getSyntaxRegistry();
                 syntaxRegistry.register( schema.getSchemaName(), syntax );
                 break;
-            case ( ProducerTypeEnum.MATCHING_RULE_PRODUCER_VAL  ):
+                
+            case MATCHING_RULE_PRODUCER :
                 MatchingRule matchingRule = ( MatchingRule ) schemaObject;
                 MatchingRuleRegistry matchingRuleRegistry;
                 matchingRuleRegistry = registries.getMatchingRuleRegistry();
                 matchingRuleRegistry.register( schema.getSchemaName(), matchingRule );
                 break;
-            case ( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER_VAL  ):
+                
+            case ATTRIBUTE_TYPE_PRODUCER :
                 AttributeType attributeType = ( AttributeType ) schemaObject;
                 AttributeTypeRegistry attributeTypeRegistry;
                 attributeTypeRegistry = registries.getAttributeTypeRegistry();
                 attributeTypeRegistry.register( schema.getSchemaName(), attributeType );
                 break;
-            case ( ProducerTypeEnum.OBJECT_CLASS_PRODUCER_VAL  ):
+                
+            case OBJECT_CLASS_PRODUCER :
                 ObjectClass objectClass = ( ObjectClass ) schemaObject;
                 ObjectClassRegistry objectClassRegistry;
                 objectClassRegistry = registries.getObjectClassRegistry();
                 objectClassRegistry.register( schema.getSchemaName(), objectClass );
                 break;
-            case ( ProducerTypeEnum.MATCHING_RULE_USE_PRODUCER_VAL  ):
+                
+            case MATCHING_RULE_USE_PRODUCER :
                 MatchingRuleUse matchingRuleUse = ( MatchingRuleUse ) schemaObject;
                 MatchingRuleUseRegistry matchingRuleUseRegistry;
                 matchingRuleUseRegistry = registries.getMatchingRuleUseRegistry();
                 matchingRuleUseRegistry.register( schema.getSchemaName(), matchingRuleUse
);
                 break;
-            case ( ProducerTypeEnum.DIT_CONTENT_RULE_PRODUCER_VAL  ):
+                
+            case DIT_CONTENT_RULE_PRODUCER :
                 DITContentRule ditContentRule = ( DITContentRule ) schemaObject;
                 DITContentRuleRegistry ditContentRuleRegistry;
                 ditContentRuleRegistry = registries.getDitContentRuleRegistry();
                 ditContentRuleRegistry.register( schema.getSchemaName(), ditContentRule );
                 break;
-            case ( ProducerTypeEnum.NAME_FORM_PRODUCER_VAL  ):
+                
+            case NAME_FORM_PRODUCER :
                 NameForm nameForm = ( NameForm ) schemaObject;
                 NameFormRegistry nameFormRegistry;
                 nameFormRegistry = registries.getNameFormRegistry();
                 nameFormRegistry.register( schema.getSchemaName(), nameForm );
                 break;
-            case ( ProducerTypeEnum.DIT_STRUCTURE_RULE_PRODUCER_VAL  ):
+                
+            case DIT_STRUCTURE_RULE_PRODUCER :
                 DITStructureRule ditStructureRule = ( DITStructureRule ) schemaObject;
                 DITStructureRuleRegistry ditStructureRuleRegistry;
                 ditStructureRuleRegistry = registries.getDitStructureRuleRegistry();
                 ditStructureRuleRegistry.register( schema.getSchemaName(), ditStructureRule
);
                 break;
-            case ( ProducerTypeEnum.STATE_FACTORY_PRODUCER_VAL  ):
+                
+            case STATE_FACTORY_PRODUCER :
                 ServerDirStateFactory stateFactory = ( ServerDirStateFactory ) schemaObject;
                 StateFactoryRegistry stateFactoryRegistry;
                 stateFactoryRegistry = registries.getStateFactoryRegistry();
                 stateFactoryRegistry.register( stateFactory );
                 break;
-            case ( ProducerTypeEnum.OBJECT_FACTORY_PRODUCER_VAL  ):
+                
+            case OBJECT_FACTORY_PRODUCER :
                 ServerDirObjectFactory objectFactory = ( ServerDirObjectFactory ) schemaObject;
                 ObjectFactoryRegistry objectFactoryRegistry;
                 objectFactoryRegistry = registries.getObjectFactoryRegistry();



Mime
View raw message