directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1789429 [2/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
Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DerefAliasSyntaxChecker.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/DerefAliasSyntaxChecker.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/DerefAliasSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DerefAliasSyntaxChecker.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,22 +40,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DerefAliasSyntaxChecker extends SyntaxChecker
+public final class DerefAliasSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DerefAliasSyntaxChecker.class );
-    
     /**
      * A static instance of DerefAliasSyntaxChecker
      */
-    public static final DerefAliasSyntaxChecker INSTANCE = new DerefAliasSyntaxChecker();
+    public static final DerefAliasSyntaxChecker INSTANCE = 
+        new DerefAliasSyntaxChecker( SchemaConstants.DEREF_ALIAS_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DerefAliasSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DEREF_ALIAS_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DerefAliasSyntaxChecker
+         * @return A new instance of DerefAliasSyntaxChecker
+         */
+        @Override
+        public DerefAliasSyntaxChecker build()
+        {
+            return new DerefAliasSyntaxChecker( oid );
+        }
+    }
 
     /**
      * Creates a new instance of DerefAliasSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private DerefAliasSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public DerefAliasSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.DEREF_ALIAS_SYNTAX );
+        return new Builder();
     }
 
 
@@ -71,7 +103,11 @@ public class DerefAliasSyntaxChecker ext
 
         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/DirectoryStringSyntaxChecker.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/DirectoryStringSyntaxChecker.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/DirectoryStringSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DirectoryStringSyntaxChecker.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,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DirectoryStringSyntaxChecker extends SyntaxChecker
+public final class DirectoryStringSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DirectoryStringSyntaxChecker.class );
-    
     /**
      * A static instance of DirectoryStringSyntaxChecker
      */
-    public static final DirectoryStringSyntaxChecker INSTANCE = new DirectoryStringSyntaxChecker();
+    public static final DirectoryStringSyntaxChecker INSTANCE = 
+        new DirectoryStringSyntaxChecker( SchemaConstants.DIRECTORY_STRING_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DirectoryStringSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DIRECTORY_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DirectoryStringSyntaxChecker
+         * @return A new instance of DirectoryStringSyntaxChecker
+         */
+        @Override
+        public DirectoryStringSyntaxChecker build()
+        {
+            return new DirectoryStringSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DirectoryStringSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private DirectoryStringSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public DirectoryStringSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.DIRECTORY_STRING_SYNTAX );
+        return new Builder();
     }
 
 
@@ -70,7 +102,11 @@ public class DirectoryStringSyntaxChecke
 
         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;
         }
 
@@ -92,7 +128,11 @@ public class DirectoryStringSyntaxChecke
         // return an empty string
         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;
         }
 
@@ -102,12 +142,20 @@ public class DirectoryStringSyntaxChecke
         {
             if ( c == 0xFFFD )
             {
-                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/DitContentRuleDescriptionSyntaxChecker.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/DitContentRuleDescriptionSyntaxChecker.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/DitContentRuleDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DitContentRuleDescriptionSyntaxChecker.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.DitContentRuleDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -51,26 +49,59 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DitContentRuleDescriptionSyntaxChecker extends SyntaxChecker
+public final class DitContentRuleDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DitContentRuleDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private transient DitContentRuleDescriptionSchemaParser schemaParser = new DitContentRuleDescriptionSchemaParser();
     
     /**
      * A static instance of DitContentRuleDescriptionSyntaxChecker
      */
-    public static final DitContentRuleDescriptionSyntaxChecker INSTANCE = new DitContentRuleDescriptionSyntaxChecker();
+    public static final DitContentRuleDescriptionSyntaxChecker INSTANCE = 
+        new DitContentRuleDescriptionSyntaxChecker( SchemaConstants.DIT_CONTENT_RULE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DitContentRuleDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DIT_CONTENT_RULE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DitContentRuleDescriptionSyntaxChecker
+         * @return A new instance of DitContentRuleDescriptionSyntaxChecker
+         */
+        @Override
+        public DitContentRuleDescriptionSyntaxChecker build()
+        {
+            return new DitContentRuleDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DITContentRuleDescriptionSyntaxChecker.
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DitContentRuleDescriptionSyntaxChecker()
+    private DitContentRuleDescriptionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DIT_CONTENT_RULE_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -84,7 +115,11 @@ public class DitContentRuleDescriptionSy
 
         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;
         }
 
@@ -104,12 +139,21 @@ public class DitContentRuleDescriptionSy
         try
         {
             schemaParser.parseDITContentRuleDescription( 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/DitStructureRuleDescriptionSyntaxChecker.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/DitStructureRuleDescriptionSyntaxChecker.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/DitStructureRuleDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DitStructureRuleDescriptionSyntaxChecker.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.DitStructureRuleDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -53,26 +51,60 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DitStructureRuleDescriptionSyntaxChecker extends SyntaxChecker
+public final class DitStructureRuleDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DitStructureRuleDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private transient DitStructureRuleDescriptionSchemaParser schemaParser = new DitStructureRuleDescriptionSchemaParser();
     
     /**
      * A static instance of DitStructureRuleDescriptionSyntaxChecker
      */
-    public static final DitStructureRuleDescriptionSyntaxChecker INSTANCE = new DitStructureRuleDescriptionSyntaxChecker();
+    public static final DitStructureRuleDescriptionSyntaxChecker INSTANCE = 
+        new DitStructureRuleDescriptionSyntaxChecker( SchemaConstants.DIT_STRUCTURE_RULE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DitStructureRuleDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DIT_STRUCTURE_RULE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DitStructureRuleDescriptionSyntaxChecker
+         * @return A new instance of DitStructureRuleDescriptionSyntaxChecker
+         */
+        @Override
+        public DitStructureRuleDescriptionSyntaxChecker build()
+        {
+            return new DitStructureRuleDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DITContentRuleDescriptionSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DitStructureRuleDescriptionSyntaxChecker()
+    private DitStructureRuleDescriptionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DIT_STRUCTURE_RULE_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -80,13 +112,17 @@ public class DitStructureRuleDescription
      * {@inheritDoc}
      */
     @Override
-public boolean isValidSyntax( Object value )
+    public boolean isValidSyntax( Object value )
     {
         String strValue;
 
         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;
         }
 
@@ -106,12 +142,21 @@ public boolean isValidSyntax( Object val
         try
         {
             schemaParser.parseDITStructureRuleDescription( 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/DlSubmitPermissionSyntaxChecker.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/DlSubmitPermissionSyntaxChecker.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/DlSubmitPermissionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DlSubmitPermissionSyntaxChecker.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,33 +30,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DlSubmitPermissionSyntaxChecker extends SyntaxChecker
+public final class DlSubmitPermissionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DlSubmitPermissionSyntaxChecker.class );
-    
     /**
      * A static instance of DlSubmitPermissionSyntaxChecker
      */
-    public static final DlSubmitPermissionSyntaxChecker INSTANCE = new DlSubmitPermissionSyntaxChecker();
+    public static final DlSubmitPermissionSyntaxChecker INSTANCE = 
+        new DlSubmitPermissionSyntaxChecker( SchemaConstants.DL_SUBMIT_PERMISSION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DlSubmitPermissionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DL_SUBMIT_PERMISSION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DlSubmitPermissionSyntaxChecker
+         * @return A new instance of DlSubmitPermissionSyntaxChecker
+         */
+        @Override
+        public DlSubmitPermissionSyntaxChecker build()
+        {
+            return new DlSubmitPermissionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DLSubmitPermissionSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DlSubmitPermissionSyntaxChecker()
+    private DlSubmitPermissionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DL_SUBMIT_PERMISSION_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/DnSyntaxChecker.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/DnSyntaxChecker.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/DnSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.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.name.Dn;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,23 +34,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DnSyntaxChecker extends SyntaxChecker
+public final class DnSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DnSyntaxChecker.class );
-    
     /**
      * A static instance of DnSyntaxChecker
      */
-    public static final DnSyntaxChecker INSTANCE = new DnSyntaxChecker();
+    public static final DnSyntaxChecker INSTANCE = new DnSyntaxChecker( SchemaConstants.DN_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DnSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DN_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DnSyntaxChecker
+         * @return A new instance of DnSyntaxChecker
+         */
+        @Override
+        public DnSyntaxChecker build()
+        {
+            return new DnSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DNSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DnSyntaxChecker()
+    private DnSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DN_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -66,7 +97,11 @@ public class DnSyntaxChecker extends Syn
 
         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;
         }
 
@@ -88,20 +123,27 @@ public class DnSyntaxChecker extends Syn
             // TODO: this should be a false, but for 
             // some reason, the principal is empty in 
             // some cases.
-            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;
         }
 
         // Check that the value is a valid Dn
         boolean result = Dn.isValid( 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/DsaQualitySyntaxSyntaxChecker.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/DsaQualitySyntaxSyntaxChecker.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/DsaQualitySyntaxSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DsaQualitySyntaxSyntaxChecker.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;
 
 
 /**
@@ -43,23 +41,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DsaQualitySyntaxSyntaxChecker extends SyntaxChecker
+public final class DsaQualitySyntaxSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DsaQualitySyntaxSyntaxChecker.class );
-    
     /**
      * A static instance of DsaQualitySyntaxSyntaxChecker
      */
-    public static final DsaQualitySyntaxSyntaxChecker INSTANCE = new DsaQualitySyntaxSyntaxChecker();
+    public static final DsaQualitySyntaxSyntaxChecker INSTANCE = 
+        new DsaQualitySyntaxSyntaxChecker( SchemaConstants.DSA_QUALITY_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DsaQualitySyntaxSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DSA_QUALITY_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DsaQualitySyntaxSyntaxChecker
+         * @return A new instance of DsaQualitySyntaxSyntaxChecker
+         */
+        @Override
+        public DsaQualitySyntaxSyntaxChecker build()
+        {
+            return new DsaQualitySyntaxSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of DSAQualitySyntaxSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public DsaQualitySyntaxSyntaxChecker()
+    private DsaQualitySyntaxSyntaxChecker( String oid )
     {
-        super( SchemaConstants.DSA_QUALITY_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -73,7 +105,11 @@ public class DsaQualitySyntaxSyntaxCheck
 
         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;
         }
 
@@ -92,7 +128,11 @@ public class DsaQualitySyntaxSyntaxCheck
 
         if ( strValue.length() < 7 )
         {
-            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;
         }
 
@@ -103,7 +143,11 @@ public class DsaQualitySyntaxSyntaxCheck
             case 'B':
                 if ( !strValue.startsWith( "BEST-EFFORT" ) )
                 {
-                    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;
                 }
 
@@ -113,7 +157,11 @@ public class DsaQualitySyntaxSyntaxCheck
             case 'D':
                 if ( !strValue.startsWith( "DEFUNCT" ) )
                 {
-                    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;
                 }
 
@@ -123,7 +171,11 @@ public class DsaQualitySyntaxSyntaxCheck
             case 'E':
                 if ( !strValue.startsWith( "EXPERIMENTAL" ) )
                 {
-                    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;
                 }
 
@@ -133,7 +185,11 @@ public class DsaQualitySyntaxSyntaxCheck
             case 'F':
                 if ( !strValue.startsWith( "FULL-SERVICE" ) )
                 {
-                    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;
                 }
 
@@ -143,7 +199,11 @@ public class DsaQualitySyntaxSyntaxCheck
             case 'P':
                 if ( !strValue.startsWith( "PILOT-SERVICE" ) )
                 {
-                    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;
                 }
 
@@ -151,7 +211,11 @@ public class DsaQualitySyntaxSyntaxCheck
                 break;
 
             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;
         }
 
@@ -159,27 +223,38 @@ public class DsaQualitySyntaxSyntaxCheck
         // but this is optional
         if ( remaining.length() == 0 )
         {
-            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;
         }
 
         if ( remaining.charAt( 0 ) != '#' )
         {
             // We were expecting a '#'
-            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;
         }
 
         // Check that the description is a PrintableString
         boolean result = Strings.isPrintableString( remaining.substring( 1 ) );
 
-        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;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DseTypeSyntaxChecker.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/DseTypeSyntaxChecker.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/DseTypeSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DseTypeSyntaxChecker.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;
 
 
 /**
@@ -46,11 +44,8 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class DseTypeSyntaxChecker extends SyntaxChecker
+public final class DseTypeSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( DseTypeSyntaxChecker.class );
-
     /** The DSE BITS keywords */
     private static final String[] DSE_BITS_STRINGS =
         {
@@ -62,11 +57,45 @@ public class DseTypeSyntaxChecker extend
     /** The Set which contains the DESBits */
     private static final Set<String> DSE_BITS = new HashSet<>();
     
+    /** Initialization of the country set */
+    static
+    {
+        for ( String country : DSE_BITS_STRINGS )
+        {
+            DSE_BITS.add( country );
+        }
+    }
+
     /**
      * A static instance of DseTypeSyntaxChecker
      */
-    public static final DseTypeSyntaxChecker INSTANCE = new DseTypeSyntaxChecker();
+    public static final DseTypeSyntaxChecker INSTANCE = new DseTypeSyntaxChecker( SchemaConstants.DSE_TYPE_SYNTAX );
     
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<DseTypeSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DSE_TYPE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of DseTypeSyntaxChecker
+         * @return A new instance of DseTypeSyntaxChecker
+         */
+        @Override
+        public DseTypeSyntaxChecker build()
+        {
+            return new DseTypeSyntaxChecker( oid );
+        }
+    }
+
     
     /** Initialization of the country set */
     static
@@ -79,13 +108,22 @@ public class DseTypeSyntaxChecker extend
 
 
     /**
-     * 
      * Creates a new instance of DSETypeSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private DseTypeSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public DseTypeSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.DSE_TYPE_SYNTAX );
+        return new Builder();
     }
 
 
@@ -99,7 +137,11 @@ public class DseTypeSyntaxChecker 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;
         }
 
@@ -119,7 +161,11 @@ public class DseTypeSyntaxChecker extend
         // We must have at least '(cp)', '(xr)' or '(ca)'
         if ( strValue.length() < 4 )
         {
-            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;
         }
 
@@ -127,7 +173,11 @@ public class DseTypeSyntaxChecker extend
         if ( ( strValue.charAt( 0 ) != '(' )
             || ( strValue.charAt( strValue.length() - 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;
         }
 
@@ -155,7 +205,11 @@ public class DseTypeSyntaxChecker extend
             if ( pos == i )
             {
                 // No keyword : error
-                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;
             }
 
@@ -165,14 +219,22 @@ public class DseTypeSyntaxChecker extend
             if ( !DSE_BITS.contains( keyword ) )
             {
                 // Unknown keyword
-                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;
             }
 
             // Check that the keyword has not been met
             if ( keywords.contains( keyword ) )
             {
-                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;
             }
 
@@ -196,13 +258,16 @@ public class DseTypeSyntaxChecker extend
         }
 
         // We are done
-        if ( needKeyword )
-        {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
-        }
-        else
+        if ( LOG.isDebugEnabled() )
         {
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            if ( needKeyword )
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+            }
+            else
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
         }
 
         return !needKeyword;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/EnhancedGuideSyntaxChecker.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/EnhancedGuideSyntaxChecker.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/EnhancedGuideSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/EnhancedGuideSyntaxChecker.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;
 
 
 /**
@@ -35,33 +33,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class EnhancedGuideSyntaxChecker extends BinarySyntaxChecker
+public final class EnhancedGuideSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( EnhancedGuideSyntaxChecker.class );
-    
     /**
      * A static instance of EnhancedGuideSyntaxChecker
      */
-    public static final EnhancedGuideSyntaxChecker INSTANCE = new EnhancedGuideSyntaxChecker();
+    public static final EnhancedGuideSyntaxChecker INSTANCE = 
+        new EnhancedGuideSyntaxChecker( SchemaConstants.ENHANCED_GUIDE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<EnhancedGuideSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.DIRECTORY_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of EnhancedGuideSyntaxChecker
+         * @return A new instance of EnhancedGuideSyntaxChecker
+         */
+        @Override
+        public EnhancedGuideSyntaxChecker build()
+        {
+            return new EnhancedGuideSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of EnhancedGuideSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public EnhancedGuideSyntaxChecker()
+    private EnhancedGuideSyntaxChecker( String oid )
     {
-        super( SchemaConstants.ENHANCED_GUIDE_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/FacsimileTelephoneNumberSyntaxChecker.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/FacsimileTelephoneNumberSyntaxChecker.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/FacsimileTelephoneNumberSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -22,12 +22,13 @@ package org.apache.directory.api.ldap.mo
 
 import java.util.HashSet;
 import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 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;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -53,10 +54,16 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class FacsimileTelephoneNumberSyntaxChecker extends TelephoneNumberSyntaxChecker
+public final class FacsimileTelephoneNumberSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( FacsimileTelephoneNumberSyntaxChecker.class );
+    /** The default pattern used to check a TelephoneNumber */
+    private static final String DEFAULT_REGEXP = "^ *[+]? *((\\([0-9- ,;/#*]+\\))|[0-9- ,;/#*]+)+$";
+    
+    /** The compiled default pattern */
+    private String defaultRegexp;
+
+    /** The compiled default pattern */
+    private Pattern defaultPattern = Pattern.compile( DEFAULT_REGEXP );
 
     /** Fax parameters possible values */
     private static final String TWO_DIMENSIONAL = "twoDimensional";
@@ -67,7 +74,7 @@ public class FacsimileTelephoneNumberSyn
     private static final String B4_WIDTH = "b4Width";
     private static final String UNCOMPRESSED = "uncompressed";
 
-    /** A set which contaons all the possible fax parameters values */
+    /** A set which contains all the possible fax parameters values */
     private static Set<String> faxParameters = new HashSet<>();
 
     /** Initialization of the fax parameters set of values */
@@ -85,15 +92,109 @@ public class FacsimileTelephoneNumberSyn
     /**
      * A static instance of FacsimileTelephoneNumberSyntaxChecker
      */
-    public static final FacsimileTelephoneNumberSyntaxChecker INSTANCE = new FacsimileTelephoneNumberSyntaxChecker();
+    public static final FacsimileTelephoneNumberSyntaxChecker INSTANCE = 
+        new FacsimileTelephoneNumberSyntaxChecker( SchemaConstants.FACSIMILE_TELEPHONE_NUMBER_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<FacsimileTelephoneNumberSyntaxChecker>
+    {
+        /** The compiled default pattern */
+        private String defaultRegexp;
+
+        /** The compiled default pattern */
+        private Pattern defaultPattern;
+
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.FACSIMILE_TELEPHONE_NUMBER_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of FacsimileTelephoneNumberSyntaxChecker
+         * @return A new instance of FacsimileTelephoneNumberSyntaxChecker
+         */
+        @Override
+        public FacsimileTelephoneNumberSyntaxChecker build()
+        {
+            return new FacsimileTelephoneNumberSyntaxChecker( oid, defaultRegexp, defaultPattern );
+        }
+
+
+        /**
+         * Set the default regular expression for the Telephone number
+         * 
+         * @param regexp the default regular expression.
+         */
+        public Builder setDefaultRegexp( String regexp )
+        {
+            defaultRegexp = regexp;
+            
+            try
+            {
+                defaultPattern = Pattern.compile( regexp );
+            }
+            catch ( PatternSyntaxException pse )
+            {
+                // Roll back to the default pattern
+                defaultPattern = Pattern.compile( DEFAULT_REGEXP );
+            }
+
+            return this;
+        }
+    }
+
+    
+    /**
+     * Creates a new instance of TelephoneNumberSyntaxChecker.
+     */
+    private FacsimileTelephoneNumberSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
 
     
     /**
      * Creates a new instance of TelephoneNumberSyntaxChecker.
      */
-    public FacsimileTelephoneNumberSyntaxChecker()
+    private FacsimileTelephoneNumberSyntaxChecker( String oid, String defaultRegexp, Pattern defaultPattern )
+    {
+        super( oid );
+        
+        this.defaultPattern = defaultPattern;
+        this.defaultRegexp = defaultRegexp;
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
+    }
+
+
+    /**
+     * Get the default regexp (either the original one, or the one that has been set)
+     * 
+     * @return The default regexp
+     */
+    public String getRegexp()
     {
-        super( SchemaConstants.FACSIMILE_TELEPHONE_NUMBER_SYNTAX );
+        if ( defaultRegexp == null )
+        {
+            return DEFAULT_REGEXP;
+        }
+        else
+        {
+            return defaultRegexp;
+        }
     }
 
 
@@ -107,7 +208,11 @@ public class FacsimileTelephoneNumberSyn
 
         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,7 +231,11 @@ public class FacsimileTelephoneNumberSyn
 
         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;
         }
 
@@ -137,15 +246,18 @@ public class FacsimileTelephoneNumberSyn
         if ( dollarPos == -1 )
         {
             // We have no fax-parameter : check the Telephone number
-            boolean result = super.isValidSyntax( strValue );
+            boolean result = defaultPattern.matcher( strValue ).matches();
 
-            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;
@@ -154,10 +266,20 @@ public class FacsimileTelephoneNumberSyn
         // First check the telephone number if the '$' is not at the first position
         if ( dollarPos > 0 )
         {
-            if ( !super.isValidSyntax( strValue.substring( 0, dollarPos - 1 ) ) )
+            boolean result = defaultPattern.matcher( strValue.substring( 0, dollarPos - 1 ) ).matches();
+
+            if ( LOG.isDebugEnabled() )
             {
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
-                return false;
+                if ( result )
+                {
+                    LOG.debug( I18n.err( I18n.MSG_04490_SYNTAX_VALID, value ) );
+                }
+                else
+                { 
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                    
+                    return false;
+                }
             }
 
             // Now, try to validate the fax-parameters : we may
@@ -182,7 +304,11 @@ public class FacsimileTelephoneNumberSyn
                 if ( faxParam.length() == 0 )
                 {
                     // Not allowed
-                    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;
                 }
 
@@ -192,7 +318,11 @@ public class FacsimileTelephoneNumberSyn
                 if ( !faxParameters.contains( faxParam ) || paramsSeen.contains( faxParam ) )
                 {
                     // This parameter is not in the possible set
-                    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
@@ -205,12 +335,20 @@ public class FacsimileTelephoneNumberSyn
                 dollarPos = newDollar;
             }
 
-            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;
         }
 
         // We must have a valid telephone number !
-        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/FaxSyntaxChecker.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/FaxSyntaxChecker.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/FaxSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/FaxSyntaxChecker.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;
 
 
 /**
@@ -35,33 +33,55 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class FaxSyntaxChecker extends BinarySyntaxChecker
+public final class FaxSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( FaxSyntaxChecker.class );
-    
     /**
      * A static instance of FaxSyntaxChecker
      */
-    public static final FaxSyntaxChecker INSTANCE = new FaxSyntaxChecker();
+    public static final FaxSyntaxChecker INSTANCE = new FaxSyntaxChecker( SchemaConstants.FAX_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<FaxSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.FAX_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of FaxSyntaxChecker
+         * @return A new instance of FaxSyntaxChecker
+         */
+        @Override
+        public FaxSyntaxChecker build()
+        {
+            return new FaxSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Private default constructor to prevent unnecessary instantiation.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public FaxSyntaxChecker()
+    private FaxSyntaxChecker( String oid )
     {
-        super( SchemaConstants.FAX_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/GeneralizedTimeSyntaxChecker.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/GeneralizedTimeSyntaxChecker.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/GeneralizedTimeSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -26,8 +26,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;
 
 
 /**
@@ -70,11 +68,8 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class GeneralizedTimeSyntaxChecker extends SyntaxChecker
+public final class GeneralizedTimeSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( GeneralizedTimeSyntaxChecker.class );
-
     /** The GeneralizedDate pattern matching */
     private static final String GENERALIZED_TIME_PATTERN =
         // century + year : 0000 to 9999
@@ -102,15 +97,52 @@ public class GeneralizedTimeSyntaxChecke
     /**
      * A static instance of GeneralizedTimeSyntaxChecker
      */
-    public static final GeneralizedTimeSyntaxChecker INSTANCE = new GeneralizedTimeSyntaxChecker();
+    public static final GeneralizedTimeSyntaxChecker INSTANCE = 
+        new GeneralizedTimeSyntaxChecker( SchemaConstants.GENERALIZED_TIME_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<GeneralizedTimeSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.GENERALIZED_TIME_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of GeneralizedTimeSyntaxChecker
+         * @return A new instance of GeneralizedTimeSyntaxChecker
+         */
+        @Override
+        public GeneralizedTimeSyntaxChecker build()
+        {
+            return new GeneralizedTimeSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of GeneralizedTimeSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public GeneralizedTimeSyntaxChecker()
+    private GeneralizedTimeSyntaxChecker( String oid )
     {
-        super( SchemaConstants.GENERALIZED_TIME_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -124,7 +156,11 @@ public class GeneralizedTimeSyntaxChecke
 
         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;
         }
 
@@ -144,20 +180,27 @@ public class GeneralizedTimeSyntaxChecke
         // A generalized time must have a minimal length of 11 
         if ( strValue.length() < 11 )
         {
-            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;
         }
 
         // Start the date parsing
         boolean result = DATE_PATTERN.matcher( strValue ).find();
 
-        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/GuideSyntaxChecker.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/GuideSyntaxChecker.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/GuideSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GuideSyntaxChecker.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;
 
 
 /**
@@ -34,33 +32,55 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class GuideSyntaxChecker extends BinarySyntaxChecker
+public final class GuideSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( GuideSyntaxChecker.class );
-    
     /**
      * A static instance of GuideSyntaxChecker
      */
-    public static final GuideSyntaxChecker INSTANCE = new GuideSyntaxChecker();
+    public static final GuideSyntaxChecker INSTANCE = new GuideSyntaxChecker( SchemaConstants.GUIDE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final  class Builder extends SCBuilder<GuideSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.GUIDE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of GuideSyntaxChecker
+         * @return A new instance of GuideSyntaxChecker
+         */
+        @Override
+        public GuideSyntaxChecker build()
+        {
+            return new GuideSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of GuideSyntaxChecker
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public GuideSyntaxChecker()
+    private GuideSyntaxChecker( String oid )
     {
-        super( SchemaConstants.GUIDE_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/Ia5StringSyntaxChecker.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/Ia5StringSyntaxChecker.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/Ia5StringSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/Ia5StringSyntaxChecker.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;
 
 
 /**
@@ -38,37 +36,59 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class Ia5StringSyntaxChecker extends SyntaxChecker
+public final class Ia5StringSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( Ia5StringSyntaxChecker.class );
-    
     /**
      * A static instance of Ia5StringSyntaxChecker
      */
-    public static final Ia5StringSyntaxChecker INSTANCE = new Ia5StringSyntaxChecker();
-
+    public static final Ia5StringSyntaxChecker INSTANCE = new Ia5StringSyntaxChecker( SchemaConstants.IA5_STRING_SYNTAX );
+    
     /**
-     * Creates a new instance of Ia5StringSyntaxChecker.
+     * A static Builder for this class
      */
-    public Ia5StringSyntaxChecker()
+    public static final class Builder extends SCBuilder<Ia5StringSyntaxChecker>
     {
-        super( SchemaConstants.IA5_STRING_SYNTAX );
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.IA5_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of Ia5StringSyntaxChecker
+         * @return A new instance of Ia5StringSyntaxChecker
+         */
+        @Override
+        public Ia5StringSyntaxChecker build()
+        {
+            return new Ia5StringSyntaxChecker( oid );
+        }
     }
 
-
     /**
      * Creates a new instance of a child with a given OID.
      * 
-     * @param oid the child's oid
+     * @param oid The OID to use for this SyntaxChecker
      */
-    protected Ia5StringSyntaxChecker( String oid )
+    private Ia5StringSyntaxChecker( String oid )
     {
         super( oid );
     }
 
     
     /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
+    }
+
+    
+    /**
      * {@inheritDoc}
      */
     @Override
@@ -78,7 +98,11 @@ public class Ia5StringSyntaxChecker 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 true;
         }
 
@@ -99,11 +123,17 @@ public class Ia5StringSyntaxChecker exte
 
         if ( result )
         {
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            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 ( LOG.isDebugEnabled() )
+            {
+                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/IntegerSyntaxChecker.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/IntegerSyntaxChecker.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/IntegerSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/IntegerSyntaxChecker.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;
 
 
 /**
@@ -47,23 +45,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class IntegerSyntaxChecker extends SyntaxChecker
+public final class IntegerSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( IntegerSyntaxChecker.class );
-    
     /**
      * A static instance of IntegerSyntaxChecker
      */
-    public static final IntegerSyntaxChecker INSTANCE = new IntegerSyntaxChecker();
+    public static final IntegerSyntaxChecker INSTANCE = new IntegerSyntaxChecker( SchemaConstants.INTEGER_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<IntegerSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.INTEGER_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of IntegerSyntaxChecker
+         * @return A new instance of IntegerSyntaxChecker
+         */
+        @Override
+        public IntegerSyntaxChecker build()
+        {
+            return new IntegerSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of IntegerSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private IntegerSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public IntegerSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.INTEGER_SYNTAX );
+        return new Builder();
     }
 
 
@@ -77,7 +108,11 @@ public class IntegerSyntaxChecker 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;
         }
 
@@ -96,7 +131,11 @@ public class IntegerSyntaxChecker 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;
         }
 
@@ -111,32 +150,43 @@ public class IntegerSyntaxChecker extend
         }
         else if ( !Chars.isDigit( c ) )
         {
-            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 if ( c == '0' )
         {
             if ( strValue.length() > 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;
             }
             else
             {
-                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;
             }
         }
 
         // We must have at least a digit which is not '0'
-        if ( !Chars.isDigit( strValue, pos ) )
-        {
-            LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
-            return false;
-        }
-        else if ( Strings.isCharASCII( strValue, pos, '0' ) )
+        if ( !Chars.isDigit( strValue, pos ) || Strings.isCharASCII( strValue, pos, '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;
         }
         else
@@ -151,13 +201,16 @@ public class IntegerSyntaxChecker extend
 
         boolean result = pos == strValue.length();
 
-        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;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaByteSyntaxChecker.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/JavaByteSyntaxChecker.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/JavaByteSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaByteSyntaxChecker.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;
 
 
 /**
@@ -49,23 +47,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class JavaByteSyntaxChecker extends SyntaxChecker
+public final class JavaByteSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( JavaByteSyntaxChecker.class );
-    
     /**
      * A static instance of JavaByteSyntaxChecker
      */
-    public static final JavaByteSyntaxChecker INSTANCE = new JavaByteSyntaxChecker();
+    public static final JavaByteSyntaxChecker INSTANCE = new JavaByteSyntaxChecker( SchemaConstants.JAVA_BYTE_SYNTAX );
     
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<JavaByteSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.JAVA_BYTE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of JavaByteSyntaxChecker
+         * @return A new instance of JavaByteSyntaxChecker
+         */
+        @Override
+        public JavaByteSyntaxChecker build()
+        {
+            return new JavaByteSyntaxChecker( oid );
+        }
+    }
+
 
     /**
      * Creates a new instance of JavaByteSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private JavaByteSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public JavaByteSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.JAVA_BYTE_SYNTAX );
+        return new Builder();
     }
 
 
@@ -79,7 +110,11 @@ public class JavaByteSyntaxChecker exten
 
         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;
         }
 
@@ -98,7 +133,11 @@ public class JavaByteSyntaxChecker exten
 
         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;
         }
 
@@ -113,27 +152,40 @@ public class JavaByteSyntaxChecker exten
         }
         else if ( !Chars.isDigit( c ) )
         {
-            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 if ( c == '0' )
         {
-            if ( strValue.length() > 1 )
-            {
-                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
-                return false;
-            }
-            else
+            boolean result = strValue.length() <= 1;
+            
+            if ( LOG.isDebugEnabled() )
             {
-                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
-                return true;
+                if ( result )
+                {
+                    LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, value ) );
+                }
+                else
+                {
+                    LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+                }
             }
+            
+            return result;
         }
 
         // We must have at least a digit which is not '0'
         if ( !Chars.isDigit( strValue, pos ) || Strings.isCharASCII( strValue, pos, '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;
         }
         else
@@ -148,7 +200,11 @@ public class JavaByteSyntaxChecker exten
 
         if ( pos != strValue.length() )
         {
-            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;
         }
 
@@ -156,12 +212,21 @@ public class JavaByteSyntaxChecker exten
         try
         {
             Byte.valueOf( 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 ( NumberFormatException e )
         {
-            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/JavaIntegerSyntaxChecker.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/JavaIntegerSyntaxChecker.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/JavaIntegerSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaIntegerSyntaxChecker.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;
 
 
 /**
@@ -48,23 +46,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class JavaIntegerSyntaxChecker extends SyntaxChecker
+public final class JavaIntegerSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( JavaIntegerSyntaxChecker.class );
-    
     /**
      * A static instance of JavaIntegerSyntaxChecker
      */
-    public static final JavaIntegerSyntaxChecker INSTANCE = new JavaIntegerSyntaxChecker();
+    public static final JavaIntegerSyntaxChecker INSTANCE = 
+        new JavaIntegerSyntaxChecker( SchemaConstants.JAVA_INT_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<JavaIntegerSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.JAVA_INT_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of JavaIntegerSyntaxChecker
+         * @return A new instance of JavaIntegerSyntaxChecker
+         */
+        @Override
+        public JavaIntegerSyntaxChecker build()
+        {
+            return new JavaIntegerSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of JavaIntegerSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private JavaIntegerSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public JavaIntegerSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.JAVA_INT_SYNTAX );
+        return new Builder();
     }
 
 
@@ -78,7 +110,11 @@ public class JavaIntegerSyntaxChecker ex
 
         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,7 +133,11 @@ public class JavaIntegerSyntaxChecker ex
 
         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;
         }
 
@@ -112,20 +152,27 @@ public class JavaIntegerSyntaxChecker ex
         }
         else if ( !Chars.isDigit( c ) )
         {
-            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 if ( c == '0' )
         {
             boolean result = strValue.length() <= 1;
 
-            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;
@@ -134,7 +181,11 @@ public class JavaIntegerSyntaxChecker ex
         // We must have at least a digit which is not '0'
         if ( !Chars.isDigit( strValue, pos ) || Strings.isCharASCII( strValue, pos, '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;
         }
         else
@@ -149,19 +200,32 @@ public class JavaIntegerSyntaxChecker ex
 
         if ( pos != strValue.length() )
         {
-            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;
         }
 
         try
         {
             Integer.valueOf( 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 ( NumberFormatException e )
         {
-            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;
         }
     }



Mime
View raw message