directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1789429 [1/5] - in /directory/shared/branches/shared-value: integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ ldap/model/src/main/java/org/apache/direc...
Date Thu, 30 Mar 2017 03:29:52 GMT
Author: elecharny
Date: Thu Mar 30 03:29:51 2017
New Revision: 1789429

URL: http://svn.apache.org/viewvc?rev=1789429&view=rev
Log:
Made the SyntaxCheckers immutable

Modified:
    directory/shared/branches/shared-value/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
    directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/SyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/LdapSyntaxHelper.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AudioSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BitStringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateListSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificatePairSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ComparatorSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CountrySyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSidSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DataQualitySyntaxSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DeliveryMethodSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DerefAliasSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DirectoryStringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DitContentRuleDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DitStructureRuleDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DlSubmitPermissionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DsaQualitySyntaxSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DseTypeSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/EnhancedGuideSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/FaxSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GuideSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/Ia5StringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/IntegerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaByteSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaIntegerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaLongSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaShortSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/LdapSyntaxDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MasterAndShadowAccessPointSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MatchingRuleDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MatchingRuleUseDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MhsOrAddressSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NameFormDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NormalizerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumberSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumericOidSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumericStringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectClassDescriptionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectClassTypeSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectNameSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OctetStringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OidLenSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OidSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PostalAddressSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PresentationAddressSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PrintableStringSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ProtocolInformationSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/RegexSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SearchScopeSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubstringAssertionSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierAndConsumerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierInformationSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierOrConsumerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupportedAlgorithmSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SyntaxCheckerSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelexNumberSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UuidSyntaxChecker.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/FacsimileTelephoneNumberSyntaxCheckerTest.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
    directory/shared/branches/shared-value/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java
    directory/shared/branches/shared-value/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java
    directory/shared/branches/shared-value/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java

Modified: directory/shared/branches/shared-value/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java (original)
+++ directory/shared/branches/shared-value/integ/src/test/java/org/apache/directory/api/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java Thu Mar 30 03:29:51 2017
@@ -54,7 +54,7 @@ public class ACIItemSyntaxCheckerTest
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
         schemaManager.loadAllEnabled();
-        checker = new org.apache.directory.api.ldap.aci.ACIItemSyntaxChecker();
+        checker = ACIItemSyntaxChecker.builder().setSchemaManager( schemaManager ).build();
         checker.setSchemaManager( schemaManager );
     }
 

Modified: directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -22,12 +22,11 @@ package org.apache.directory.api.ldap.ac
 
 import java.text.ParseException;
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -37,21 +36,72 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class ACIItemSyntaxChecker extends SyntaxChecker
+public final class ACIItemSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( ACIItemSyntaxChecker.class );
-
     /** An instance of ACI Item Checker */
     private transient ACIItemChecker aciItemChecker;
+    
+    /**
+     * A static instance of ACIItemSyntaxChecker
+     */
+    public static final ACIItemSyntaxChecker INSTANCE = 
+        new ACIItemSyntaxChecker( SchemaConstants.ACI_ITEM_SYNTAX, null );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<ACIItemSyntaxChecker>
+    {
+        /** The schemaManager to use */
+        private SchemaManager schemaManager;
+        
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.ACI_ITEM_SYNTAX );
+        }
+        
+        
+        public Builder setSchemaManager( SchemaManager schemaManager )
+        {
+            this.schemaManager = schemaManager;
+            
+            return this;
+        }
+        
+        /**
+         * Create a new instance of ACIItemSyntaxChecker
+         * @return A new instance of ACIItemSyntaxChecker
+         */
+        @Override
+        public ACIItemSyntaxChecker build()
+        {
+            return new ACIItemSyntaxChecker( oid, schemaManager );
+        }
+    }
 
 
     /**
      * Creates a new instance of ACIItemSyntaxChecker
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     * @param schemaManager The SchemaManager instance
+     */
+    private ACIItemSyntaxChecker( String oid, SchemaManager schemaManager )
+    {
+        super( oid );
+        aciItemChecker = new ACIItemChecker( schemaManager );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public ACIItemSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.ACI_ITEM_SYNTAX );
+        return new Builder();
     }
 
 
@@ -65,7 +115,11 @@ public class ACIItemSyntaxChecker extend
 
         if ( value == null )
         {
-            LOG.debug( "Syntax invalid for 'null'" );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -84,7 +138,11 @@ public class ACIItemSyntaxChecker extend
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( INVALID_SYNTAX_FOR, value );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -95,12 +153,20 @@ public class ACIItemSyntaxChecker extend
                 aciItemChecker.parse( strValue );
             }
 
-            LOG.debug( "Syntax valid for '{}'", value );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
+            
             return true;
         }
         catch ( ParseException pe )
         {
-            LOG.debug( INVALID_SYNTAX_FOR, value );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
     }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/SyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/SyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/SyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.api.ldap.model.schema;
 
+import org.apache.directory.api.i18n.I18n;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Used to validate values of a particular syntax. This interface does not
@@ -31,12 +34,46 @@ public abstract class SyntaxChecker exte
 {
     /** The mandatory serialVersionUID */
     public static final long serialVersionUID = 1L;
+    
+    /** A logger for this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( SyntaxChecker.class );
 
-    /** A constant used for the loggers */
-    public static final String INVALID_SYNTAX_FOR = "Syntax invalid for '{}'";
+    /**
+     * A static Builder for this class
+     */
+    public abstract static class SCBuilder<SC>
+    {
+        /** The SyntaxChecker OID */
+        protected String oid;
+        
+        /**
+         * The Builder constructor
+         */
+        protected SCBuilder( String oid )
+        {
+            this.oid = oid;
+        }
+        
+        
+        /**
+         * Set the SyntaxChecker's OID
+         * 
+         * @param oid The OID
+         * @return The Builder's Instance
+         */
+        public SCBuilder<SC> setOid( String oid )
+        {
+            this.oid = oid;
+            
+            return this;
+        }
+        
+        public abstract SC build();
+    }
 
     /**
      * The SyntaxChecker base constructor
+     * 
      * @param oid The associated OID
      */
     protected SyntaxChecker( String oid )
@@ -61,7 +98,15 @@ public abstract class SyntaxChecker exte
      * @param value the value of some attribute with the syntax
      * @return true if the value is in the valid syntax, false otherwise
      */
-    public abstract boolean isValidSyntax( Object value );
+    public boolean isValidSyntax( Object value )
+    {
+        if ( LOG.isDebugEnabled() )
+        {
+            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+        }
+        
+        return true;
+    }
 
 
     /**

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/LdapSyntaxHelper.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/LdapSyntaxHelper.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/LdapSyntaxHelper.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/helper/LdapSyntaxHelper.java Thu Mar 30 03:29:51 2017
@@ -70,7 +70,7 @@ public final class LdapSyntaxHelper
                 catch ( LdapException ne )
                 {
                     // No SyntaxChecker ? Associate the Syntax to a catch all SyntaxChecker
-                    syntaxChecker = new OctetStringSyntaxChecker( ldapSyntax.getOid() );
+                    syntaxChecker = OctetStringSyntaxChecker.builder().setOid( ldapSyntax.getOid() ).build();
                 }
 
                 // Add the references for S :

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -22,8 +22,6 @@ package org.apache.directory.api.ldap.mo
 
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -32,33 +30,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class AccessPointSyntaxChecker extends SyntaxChecker
+public final class AccessPointSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( AccessPointSyntaxChecker.class );
-    
     /**
      * A static instance of AccessPointSyntaxChecker
      */
-    public static final AccessPointSyntaxChecker INSTANCE = new AccessPointSyntaxChecker();
-    
+    public static final AccessPointSyntaxChecker INSTANCE = 
+        new AccessPointSyntaxChecker( SchemaConstants.ACCESS_POINT_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<AccessPointSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.ACCESS_POINT_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of AccessPointSyntaxChecker
+         * @return A new instance of AccessPointSyntaxChecker
+         */
+        @Override
+        public AccessPointSyntaxChecker build()
+        {
+            return new AccessPointSyntaxChecker( oid );
+        }
+    }
+
 
     /**
      * The AccessPoint SyntaxChecker constructor
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public AccessPointSyntaxChecker()
+    private AccessPointSyntaxChecker( String oid )
     {
-        super( SchemaConstants.ACCESS_POINT_SYNTAX );
+        super( oid );
     }
 
 
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( "Syntax valid for '{}'", value );
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -27,8 +27,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.ldap.model.schema.parsers.AttributeTypeDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -71,28 +69,61 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class AttributeTypeDescriptionSyntaxChecker extends SyntaxChecker
+public final class AttributeTypeDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( AttributeTypeDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the AttributeTypeDescription Syntax */
     private transient AttributeTypeDescriptionSchemaParser schemaParser = new AttributeTypeDescriptionSchemaParser();
     
     /**
      * A static instance of AttributeTypeDescriptionSyntaxChecker
      */
-    public static final AttributeTypeDescriptionSyntaxChecker INSTANCE = new AttributeTypeDescriptionSyntaxChecker();
+    public static final AttributeTypeDescriptionSyntaxChecker INSTANCE = new AttributeTypeDescriptionSyntaxChecker( 
+        SchemaConstants.ATTRIBUTE_TYPE_DESCRIPTION_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<AttributeTypeDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.ATTRIBUTE_TYPE_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of AttributeTypeDescriptionSyntaxChecker
+         * @return A new instance of AttributeTypeDescriptionSyntaxChecker
+         */
+        @Override
+        public AttributeTypeDescriptionSyntaxChecker build()
+        {
+            return new AttributeTypeDescriptionSyntaxChecker( oid );
+        }
+    }
 
 
     /**
-     * 
      * Creates a new instance of AttributeTypeDescriptionSchemaParser.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      *
      */
-    public AttributeTypeDescriptionSyntaxChecker()
+    private AttributeTypeDescriptionSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
     {
-        super( SchemaConstants.ATTRIBUTE_TYPE_DESCRIPTION_SYNTAX );
+        return new Builder();
     }
 
 
@@ -106,7 +137,11 @@ public class AttributeTypeDescriptionSyn
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -126,12 +161,21 @@ public class AttributeTypeDescriptionSyn
         try
         {
             schemaParser.parseAttributeTypeDescription( strValue );
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
+            
             return true;
         }
         catch ( ParseException pe )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
     }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -24,8 +24,6 @@ import org.apache.directory.api.i18n.I18
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -42,25 +40,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class AttributeTypeUsageSyntaxChecker extends SyntaxChecker
+public final class AttributeTypeUsageSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( AttributeTypeUsageSyntaxChecker.class );
-    
     /**
      * A static instance of AttributeTypeUsageSyntaxChecker
      */
-    public static final AttributeTypeUsageSyntaxChecker INSTANCE = new AttributeTypeUsageSyntaxChecker();
+    public static final AttributeTypeUsageSyntaxChecker INSTANCE = 
+        new AttributeTypeUsageSyntaxChecker( SchemaConstants.ATTRIBUTE_TYPE_USAGE_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<AttributeTypeUsageSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.ATTRIBUTE_TYPE_USAGE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of AttributeTypeUsageSyntaxChecker
+         * @return A new instance of AttributeTypeUsageSyntaxChecker
+         */
+        @Override
+        public AttributeTypeUsageSyntaxChecker build()
+        {
+            return new AttributeTypeUsageSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of AttributeTypeUsageSyntaxChecker.
-     *
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private AttributeTypeUsageSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * @return An instance of the Builder for this class
      */
-    public AttributeTypeUsageSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.ATTRIBUTE_TYPE_USAGE_SYNTAX );
+        return new Builder();
     }
 
 
@@ -74,7 +104,11 @@ public class AttributeTypeUsageSyntaxChe
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -97,12 +131,18 @@ public class AttributeTypeUsageSyntaxChe
             case "directoryOperation" :
             case "distributedOperation" :
             case "userApplications" :
-                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+                }
                 
                 return true;
 
             default :
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
                 
                 return false;
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AudioSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AudioSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AudioSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AudioSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,10 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 
 
 /**
@@ -40,34 +38,55 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class AudioSyntaxChecker extends BinarySyntaxChecker
+public final class AudioSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( AudioSyntaxChecker.class );
-    
     /**
      * A static instance of AudioSyntaxChecker
      */
-    public static final AudioSyntaxChecker INSTANCE = new AudioSyntaxChecker();
+    public static final AudioSyntaxChecker INSTANCE = new AudioSyntaxChecker( SchemaConstants.AUDIO_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<AudioSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.AUDIO_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of AudioSyntaxChecker
+         * @return A new instance of AudioSyntaxChecker
+         */
+        @Override
+        public AudioSyntaxChecker build()
+        {
+            return new AudioSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of AudioSyntaxChecker
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public AudioSyntaxChecker()
+    private AudioSyntaxChecker( String oid )
     {
-        super( SchemaConstants.AUDIO_SYNTAX );
+        super( oid );
     }
 
 
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,11 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -33,43 +30,54 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class BinarySyntaxChecker extends SyntaxChecker
+public final class BinarySyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( BinarySyntaxChecker.class );
-    
     /**
      * A static instance of BinarySyntaxChecker
      */
-    public static final BinarySyntaxChecker INSTANCE = new BinarySyntaxChecker();
+    public static final BinarySyntaxChecker INSTANCE = new BinarySyntaxChecker( SchemaConstants.BINARY_SYNTAX );
 
-    
     /**
-     * Creates a new instance of BinarySyntaxChecker
+     * A static Builder for this class
      */
-    public BinarySyntaxChecker()
+    public static final class Builder extends SCBuilder<BinarySyntaxChecker>
     {
-        super( SchemaConstants.BINARY_SYNTAX );
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.ACCESS_POINT_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of BinarySyntaxChecker
+         * @return A new instance of BinarySyntaxChecker
+         */
+        @Override
+        public BinarySyntaxChecker build()
+        {
+            return new BinarySyntaxChecker( oid );
+        }
     }
-    
+
     
     /**
      * Creates a new instance of the child class
      * @param oid The child's OID
      */
-    protected BinarySyntaxChecker( String oid )
+    private BinarySyntaxChecker( String oid )
     {
         super( oid );
     }
 
 
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BitStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BitStringSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BitStringSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BitStringSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -25,8 +25,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Chars;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -42,25 +40,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class BitStringSyntaxChecker extends SyntaxChecker
+public final class BitStringSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( BitStringSyntaxChecker.class );
-    
     /**
      * A static instance of BitStringSyntaxChecker
      */
-    public static final BitStringSyntaxChecker INSTANCE = new BitStringSyntaxChecker();
+    public static final BitStringSyntaxChecker INSTANCE = new BitStringSyntaxChecker( SchemaConstants.BIT_STRING_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<BitStringSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.BIT_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of BitStringSyntaxChecker
+         * @return A new instance of BitStringSyntaxChecker
+         */
+        @Override
+        public BitStringSyntaxChecker build()
+        {
+            return new BitStringSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of BitStringSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public BitStringSyntaxChecker()
+    private BitStringSyntaxChecker( String oid )
     {
-        super( SchemaConstants.BIT_STRING_SYNTAX );
+        super( oid );
+    }
+
+
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -77,7 +106,11 @@ public class BitStringSyntaxChecker exte
     {
         if ( strValue.length() == 0 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
@@ -86,14 +119,22 @@ public class BitStringSyntaxChecker exte
         // Check that the String respect the syntax : ' ([01]+) ' B
         if ( !Strings.isCharASCII( strValue, pos++, '\'' ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
         // We must have at least one bit
         if ( !Chars.isBit( strValue, pos++ ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
@@ -106,18 +147,30 @@ public class BitStringSyntaxChecker exte
         // Now, we must have a simple quote 
         if ( !Strings.isCharASCII( strValue, pos++, '\'' ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
         // followed by a 'B'
         if ( !Strings.isCharASCII( strValue, pos, 'B' ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, strValue ) );
+        if ( LOG.isDebugEnabled() )
+        {
+            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, strValue ) );
+        }
+        
         return true;
     }
 
@@ -132,7 +185,11 @@ public class BitStringSyntaxChecker exte
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -24,8 +24,6 @@ import org.apache.directory.api.i18n.I18
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -40,23 +38,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class BooleanSyntaxChecker extends SyntaxChecker
+public final class BooleanSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( BooleanSyntaxChecker.class );
-    
     /**
      * A static instance of BooleanSyntaxChecker
      */
-    public static final BooleanSyntaxChecker INSTANCE = new BooleanSyntaxChecker();
+    public static final BooleanSyntaxChecker INSTANCE = new BooleanSyntaxChecker( SchemaConstants.BOOLEAN_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<BooleanSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.BOOLEAN_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of BooleanSyntaxChecker
+         * @return A new instance of BooleanSyntaxChecker
+         */
+        @Override
+        public BooleanSyntaxChecker build()
+        {
+            return new BooleanSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of BooleanSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public BooleanSyntaxChecker()
+    private BooleanSyntaxChecker( String oid )
     {
-        super( SchemaConstants.BOOLEAN_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -70,7 +101,11 @@ public class BooleanSyntaxChecker extend
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -89,19 +124,26 @@ public class BooleanSyntaxChecker extend
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
+            
             return false;
         }
 
         boolean valid = "TRUE".equalsIgnoreCase( strValue ) || "FALSE".equalsIgnoreCase( strValue );
 
-        if ( valid )
-        {
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, strValue ) );
-        }
-        else
+        if ( LOG.isDebugEnabled() )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            if ( valid )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, strValue ) );
+            }
+            else
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, strValue ) );
+            }
         }
 
         return valid;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateListSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateListSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateListSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateListSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,10 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 
 
 /**
@@ -42,33 +40,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CertificateListSyntaxChecker extends BinarySyntaxChecker
+public final class CertificateListSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CertificateListSyntaxChecker.class );
-    
     /**
      * A static instance of CertificateListSyntaxChecker
      */
-    public static final CertificateListSyntaxChecker INSTANCE = new CertificateListSyntaxChecker();
+    public static final CertificateListSyntaxChecker INSTANCE = new CertificateListSyntaxChecker(
+        SchemaConstants.CERTIFICATE_LIST_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CertificateListSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.BOOLEAN_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CertificateListSyntaxChecker
+         * @return A new instance of CertificateListSyntaxChecker
+         */
+        @Override
+        public CertificateListSyntaxChecker build()
+        {
+            return new CertificateListSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of CertificateListSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public CertificateListSyntaxChecker()
+    private CertificateListSyntaxChecker( String oid )
     {
-        super( SchemaConstants.CERTIFICATE_LIST_SYNTAX );
+        super( oid );
     }
 
-
+    
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificatePairSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificatePairSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificatePairSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificatePairSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,10 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 
 
 /**
@@ -42,33 +40,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CertificatePairSyntaxChecker extends BinarySyntaxChecker
+public final class CertificatePairSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CertificatePairSyntaxChecker.class );
-    
     /**
      * A static instance of CertificatePairSyntaxChecker
      */
-    public static final CertificatePairSyntaxChecker INSTANCE = new CertificatePairSyntaxChecker();
+    public static final CertificatePairSyntaxChecker INSTANCE = new CertificatePairSyntaxChecker(
+        SchemaConstants.CERTIFICATE_PAIR_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CertificatePairSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.CERTIFICATE_PAIR_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CertificatePairSyntaxChecker
+         * @return A new instance of CertificatePairSyntaxChecker
+         */
+        @Override
+        public CertificatePairSyntaxChecker build()
+        {
+            return new CertificatePairSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of CertificatePairSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public CertificatePairSyntaxChecker()
+    private CertificatePairSyntaxChecker( String oid )
     {
-        super( SchemaConstants.CERTIFICATE_PAIR_SYNTAX );
+        super( oid );
     }
 
-
+    
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CertificateSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,10 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 
 
 /**
@@ -42,34 +40,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CertificateSyntaxChecker extends BinarySyntaxChecker
+public final class CertificateSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CertificateSyntaxChecker.class );
-    
     /**
      * A static instance of CertificateSyntaxChecker
      */
-    public static final CertificateSyntaxChecker INSTANCE = new CertificateSyntaxChecker();
+    public static final CertificateSyntaxChecker INSTANCE = new CertificateSyntaxChecker(
+        SchemaConstants.CERTIFICATE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CertificateSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.CERTIFICATE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CertificateSyntaxChecker
+         * @return A new instance of CertificateSyntaxChecker
+         */
+        @Override
+        public CertificateSyntaxChecker build()
+        {
+            return new CertificateSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of CertificateSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public CertificateSyntaxChecker()
+    private CertificateSyntaxChecker( String oid )
     {
-        super( SchemaConstants.CERTIFICATE_SYNTAX );
+        super( oid );
     }
 
-
+    
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ComparatorSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ComparatorSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ComparatorSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ComparatorSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,7 +20,10 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
+import org.apache.directory.api.util.Strings;
 
 
 /**
@@ -29,21 +32,104 @@ import org.apache.directory.api.ldap.mod
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class ComparatorSyntaxChecker extends Ia5StringSyntaxChecker
+public final class ComparatorSyntaxChecker extends SyntaxChecker
 {
     /**
      * A static instance of ComparatorSyntaxChecker
      */
-    public static final ComparatorSyntaxChecker INSTANCE = new ComparatorSyntaxChecker();
+    public static final ComparatorSyntaxChecker INSTANCE = new ComparatorSyntaxChecker( SchemaConstants.COMPARATOR_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<ComparatorSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.COMPARATOR_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of ComparatorSyntaxChecker
+         * @return A new instance of ComparatorSyntaxChecker
+         */
+        @Override
+        public ComparatorSyntaxChecker build()
+        {
+            return new ComparatorSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of ComparatorSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private ComparatorSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public ComparatorSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.COMPARATOR_SYNTAX );
+        return new Builder();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isValidSyntax( Object value )
+    {
+        String strValue;
+
+        if ( value == null )
+        {
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
+            return true;
+        }
+
+        if ( value instanceof String )
+        {
+            strValue = ( String ) value;
+        }
+        else if ( value instanceof byte[] )
+        {
+            strValue = Strings.utf8ToString( ( byte[] ) value );
+        }
+        else
+        {
+            strValue = value.toString();
+        }
+
+        boolean result = Strings.isIA5String( strValue );
+
+        if ( LOG.isDebugEnabled() )
+        {
+            if ( result )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
+            else
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+        }
+
+        return result;
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CountrySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CountrySyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CountrySyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CountrySyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -27,8 +27,6 @@ import org.apache.directory.api.i18n.I18
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -44,11 +42,8 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CountrySyntaxChecker extends SyntaxChecker
+public final class CountrySyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CountrySyntaxChecker.class );
-
     /** The ISO 3166 list of countries, as of 2006 */
     private static final String[] COUNTRY_ISO_3166 =
         {
@@ -313,17 +308,51 @@ public class CountrySyntaxChecker extend
     /**
      * A static instance of CountrySyntaxChecker
      */
-    public static final CountrySyntaxChecker INSTANCE = new CountrySyntaxChecker();
+    public static final CountrySyntaxChecker INSTANCE = new CountrySyntaxChecker( SchemaConstants.COUNTRY_STRING_SYNTAX );
+
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CountrySyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.COUNTRY_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CountrySyntaxChecker
+         * @return A new instance of CountrySyntaxChecker
+         */
+        @Override
+        public CountrySyntaxChecker build()
+        {
+            return new CountrySyntaxChecker( oid );
+        }
+    }
+
 
-    
     /**
-     * 
      * Creates a new instance of CountrySyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private CountrySyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public CountrySyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.COUNTRY_STRING_SYNTAX );
+        return new Builder();
     }
 
 
@@ -337,7 +366,11 @@ public class CountrySyntaxChecker extend
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -356,19 +389,26 @@ public class CountrySyntaxChecker extend
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
         boolean result = COUNTRIES.contains( Strings.toUpperCaseAscii( strValue ) );
 
-        if ( result )
-        {
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        }
-        else
+        if ( LOG.isDebugEnabled() )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( result )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
+            else
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
         }
 
         return result;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSidSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSidSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSidSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -23,8 +23,6 @@ package org.apache.directory.api.ldap.mo
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -33,23 +31,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CsnSidSyntaxChecker extends SyntaxChecker
+public final class CsnSidSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CsnSidSyntaxChecker.class );
-    
     /**
      * A static instance of CsnSidSyntaxChecker
      */
-    public static final CsnSidSyntaxChecker INSTANCE = new CsnSidSyntaxChecker();
+    public static final CsnSidSyntaxChecker INSTANCE = new CsnSidSyntaxChecker( SchemaConstants.CSN_SID_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CsnSidSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.CSN_SID_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CsnSidSyntaxChecker
+         * @return A new instance of CsnSidSyntaxChecker
+         */
+        @Override
+        public CsnSidSyntaxChecker build()
+        {
+            return new CsnSidSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of CsnSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private CsnSidSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public CsnSidSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.CSN_SID_SYNTAX );
+        return new Builder();
     }
 
 
@@ -61,13 +92,21 @@ public class CsnSidSyntaxChecker extends
     {
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
         if ( !( value instanceof String ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -75,7 +114,11 @@ public class CsnSidSyntaxChecker extends
 
         if ( sidStr.length() > 3 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -87,17 +130,29 @@ public class CsnSidSyntaxChecker extends
 
             if ( ( sid < 0 ) || ( sid > 0x0fff ) )
             {
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
+
                 return false;
             }
         }
         catch ( NumberFormatException nfe )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+        if ( LOG.isDebugEnabled() )
+        {
+            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+        }
+        
         return true;
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/CsnSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -25,8 +25,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.csn.Csn;
 import org.apache.directory.api.ldap.model.csn.InvalidCSNException;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -35,23 +33,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class CsnSyntaxChecker extends SyntaxChecker
+public final class CsnSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( CsnSyntaxChecker.class );
-    
     /**
      * A static instance of CsnSyntaxChecker
      */
-    public static final CsnSyntaxChecker INSTANCE = new CsnSyntaxChecker();
+    public static final CsnSyntaxChecker INSTANCE = new CsnSyntaxChecker( SchemaConstants.CSN_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<CsnSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.CSN_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of CsnSyntaxChecker
+         * @return A new instance of CsnSyntaxChecker
+         */
+        @Override
+        public CsnSyntaxChecker build()
+        {
+            return new CsnSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of CsnSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public CsnSyntaxChecker()
+    private CsnSyntaxChecker( String oid )
     {
-        super( SchemaConstants.CSN_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -63,13 +94,21 @@ public class CsnSyntaxChecker extends Sy
     {
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
         if ( !( value instanceof String ) )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -80,20 +119,27 @@ public class CsnSyntaxChecker extends Sy
         {
             boolean result = Csn.isValid( csnStr );
 
-            if ( result )
+            if ( LOG.isDebugEnabled() )
             {
-                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-            }
-            else
-            {
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                if ( result )
+                {
+                    LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+                }
+                else
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
             }
 
             return result;
         }
         catch ( InvalidCSNException icsne )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
     }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DataQualitySyntaxSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DataQualitySyntaxSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DataQualitySyntaxSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DataQualitySyntaxSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,11 +20,8 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -33,32 +30,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DataQualitySyntaxSyntaxChecker extends SyntaxChecker
+public final class DataQualitySyntaxSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DataQualitySyntaxSyntaxChecker.class );
-    
     /**
      * A static instance of DataQualitySyntaxSyntaxChecker
      */
-    public static final DataQualitySyntaxSyntaxChecker INSTANCE = new DataQualitySyntaxSyntaxChecker();
+    public static final DataQualitySyntaxSyntaxChecker INSTANCE = 
+        new DataQualitySyntaxSyntaxChecker( SchemaConstants.DATA_QUALITY_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DataQualitySyntaxSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DATA_QUALITY_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DataQualitySyntaxSyntaxChecker
+         * @return A new instance of DataQualitySyntaxSyntaxChecker
+         */
+        @Override
+        public DataQualitySyntaxSyntaxChecker build()
+        {
+            return new DataQualitySyntaxSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DataQualitySyntaxSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DataQualitySyntaxSyntaxChecker()
+    private DataQualitySyntaxSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DATA_QUALITY_SYNTAX );
+        super( oid );
     }
 
+    
     /**
-     * {@inheritDoc}
+     * @return An instance of the Builder for this class
      */
-    @Override
-    public boolean isValidSyntax( Object value )
+    public static Builder builder()
     {
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-        return true;
+        return new Builder();
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DeliveryMethodSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DeliveryMethodSyntaxChecker.java?rev=1789429&r1=1789428&r2=1789429&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DeliveryMethodSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DeliveryMethodSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -28,8 +28,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Chars;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -51,11 +49,8 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DeliveryMethodSyntaxChecker extends SyntaxChecker
+public final class DeliveryMethodSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DeliveryMethodSyntaxChecker.class );
-
     private static final String[] PDMS =
         {
             "any", "mhs", "physical", "telex", "teletex",
@@ -77,17 +72,52 @@ public class DeliveryMethodSyntaxChecker
     /**
      * A static instance of DeliveryMethodSyntaxChecker
      */
-    public static final DeliveryMethodSyntaxChecker INSTANCE = new DeliveryMethodSyntaxChecker();
+    public static final DeliveryMethodSyntaxChecker INSTANCE = 
+        new DeliveryMethodSyntaxChecker( SchemaConstants.DELIVERY_METHOD_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DeliveryMethodSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DELIVERY_METHOD_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DeliveryMethodSyntaxChecker
+         * @return A new instance of DeliveryMethodSyntaxChecker
+         */
+        @Override
+        public DeliveryMethodSyntaxChecker build()
+        {
+            return new DeliveryMethodSyntaxChecker( oid );
+        }
+    }
 
 
     /**
-     * 
      * Creates a new instance of DeliveryMethodSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DeliveryMethodSyntaxChecker()
+    private DeliveryMethodSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DELIVERY_METHOD_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -150,7 +180,11 @@ public class DeliveryMethodSyntaxChecker
 
         if ( value == null )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, "null" ) );
+            }
+            
             return false;
         }
 
@@ -169,7 +203,11 @@ public class DeliveryMethodSyntaxChecker
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -182,7 +220,11 @@ public class DeliveryMethodSyntaxChecker
         
         if ( pos == -1 )
         {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            if ( LOG.isDebugEnabled() )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            
             return false;
         }
 
@@ -200,7 +242,11 @@ public class DeliveryMethodSyntaxChecker
             if ( !Strings.isCharASCII( strValue, pos, '$' ) )
             {
                 // A '$' was expected
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
+                
                 return false;
             }
             else
@@ -218,12 +264,20 @@ public class DeliveryMethodSyntaxChecker
             
             if ( pos == -1 )
             {
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
+                
                 return false;
             }
         }
 
-        LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+        if ( LOG.isDebugEnabled() )
+        {
+            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+        }
+        
         return true;
     }
 }



Mime
View raw message