directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1789429 [3/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/JavaLongSyntaxChecker.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/JavaLongSyntaxChecker.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/JavaLongSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaLongSyntaxChecker.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,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class JavaLongSyntaxChecker extends SyntaxChecker
+public final class JavaLongSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( JavaLongSyntaxChecker.class );
-    
     /**
      * A static instance of JavaLongSyntaxChecker
      */
-    public static final JavaLongSyntaxChecker INSTANCE = new JavaLongSyntaxChecker();
+    public static final JavaLongSyntaxChecker INSTANCE = new JavaLongSyntaxChecker( SchemaConstants.JAVA_LONG_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<JavaLongSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super(  SchemaConstants.JAVA_LONG_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of JavaLongSyntaxChecker
+         * @return A new instance of JavaLongSyntaxChecker
+         */
+        @Override
+        public JavaLongSyntaxChecker build()
+        {
+            return new JavaLongSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of JavaLongSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private JavaLongSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public JavaLongSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.JAVA_LONG_SYNTAX );
+        return new Builder();
     }
 
 
@@ -78,7 +109,11 @@ public class JavaLongSyntaxChecker 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;
         }
 
@@ -97,7 +132,11 @@ public class JavaLongSyntaxChecker 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;
         }
 
@@ -112,27 +151,40 @@ public class JavaLongSyntaxChecker 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
@@ -147,7 +199,11 @@ public class JavaLongSyntaxChecker 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;
         }
 
@@ -155,12 +211,21 @@ public class JavaLongSyntaxChecker exten
         try
         {
             Long.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/JavaShortSyntaxChecker.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/JavaShortSyntaxChecker.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/JavaShortSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JavaShortSyntaxChecker.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,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class JavaShortSyntaxChecker extends SyntaxChecker
+public final class JavaShortSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( JavaShortSyntaxChecker.class );
-    
     /**
      * A static instance of JavaShortSyntaxChecker
      */
-    public static final JavaShortSyntaxChecker INSTANCE = new JavaShortSyntaxChecker();
+    public static final JavaShortSyntaxChecker INSTANCE = new JavaShortSyntaxChecker( SchemaConstants.JAVA_SHORT_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<JavaShortSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.JAVA_SHORT_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of JavaShortSyntaxChecker
+         * @return A new instance of JavaShortSyntaxChecker
+         */
+        @Override
+        public JavaShortSyntaxChecker build()
+        {
+            return new JavaShortSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of JavaShortSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private JavaShortSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public JavaShortSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.JAVA_SHORT_SYNTAX );
+        return new Builder();
     }
 
 
@@ -78,7 +109,11 @@ public class JavaShortSyntaxChecker 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;
         }
 
@@ -97,7 +132,11 @@ public class JavaShortSyntaxChecker exte
 
         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,27 +151,40 @@ public class JavaShortSyntaxChecker exte
         }
         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
@@ -147,7 +199,11 @@ public class JavaShortSyntaxChecker exte
 
         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;
         }
 
@@ -155,12 +211,21 @@ public class JavaShortSyntaxChecker exte
         try
         {
             Short.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/JpegSyntaxChecker.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/JpegSyntaxChecker.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/JpegSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.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;
 
 
 /**
@@ -45,23 +43,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class JpegSyntaxChecker extends SyntaxChecker
+public final class JpegSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( JpegSyntaxChecker.class );
-    
     /**
      * A static instance of JpegSyntaxChecker
      */
-    public static final JpegSyntaxChecker INSTANCE = new JpegSyntaxChecker();
+    public static final JpegSyntaxChecker INSTANCE = new JpegSyntaxChecker( SchemaConstants.JPEG_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<JpegSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.JPEG_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of JpegSyntaxChecker
+         * @return A new instance of JpegSyntaxChecker
+         */
+        @Override
+        public JpegSyntaxChecker build()
+        {
+            return new JpegSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of JpegSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private JpegSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public JpegSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.JPEG_SYNTAX );
+        return new Builder();
     }
 
 
@@ -73,14 +104,22 @@ public class JpegSyntaxChecker extends S
     {
         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;
         }
 
         // The value must be a byte array
         if ( !( value instanceof byte[] ) )
         {
-            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;
         }
 
@@ -89,7 +128,11 @@ public class JpegSyntaxChecker extends S
         // The header must be at least 11 bytes long
         if ( bytes.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;
         }
 
@@ -106,7 +149,11 @@ public class JpegSyntaxChecker extends S
                 && ( bytes[9] == 'F' )
                 && ( bytes[10] == 0x00 ) )
             {
-                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;
             }
         // EXIF Format
@@ -117,12 +164,20 @@ public class JpegSyntaxChecker extends S
                     && ( bytes[9] == 'f' )
                     && ( bytes[10] == 0x00 ) )
             {
-                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;
             }
         }
 
-        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/LdapSyntaxDescriptionSyntaxChecker.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/LdapSyntaxDescriptionSyntaxChecker.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/LdapSyntaxDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/LdapSyntaxDescriptionSyntaxChecker.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.LdapSyntaxDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -45,28 +43,59 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class LdapSyntaxDescriptionSyntaxChecker extends SyntaxChecker
+public final class LdapSyntaxDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( LdapSyntaxDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the LdapSyntax description Syntax */
     private transient LdapSyntaxDescriptionSchemaParser schemaParser = new LdapSyntaxDescriptionSchemaParser();
-    
     /**
      * A static instance of LdapSyntaxDescriptionSyntaxChecker
      */
-    public static final LdapSyntaxDescriptionSyntaxChecker INSTANCE = new LdapSyntaxDescriptionSyntaxChecker();
+    public static final LdapSyntaxDescriptionSyntaxChecker INSTANCE = 
+        new LdapSyntaxDescriptionSyntaxChecker( SchemaConstants.LDAP_SYNTAX_DESCRIPTION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<LdapSyntaxDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.LDAP_SYNTAX_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of LdapSyntaxDescriptionSyntaxChecker
+         * @return A new instance of LdapSyntaxDescriptionSyntaxChecker
+         */
+        @Override
+        public LdapSyntaxDescriptionSyntaxChecker build()
+        {
+            return new LdapSyntaxDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of LdapSyntaxDescriptionSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private LdapSyntaxDescriptionSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public LdapSyntaxDescriptionSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.LDAP_SYNTAX_DESCRIPTION_SYNTAX );
+        return new Builder();
     }
 
 
@@ -80,7 +109,11 @@ public class LdapSyntaxDescriptionSyntax
 
         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;
         }
 
@@ -100,13 +133,21 @@ public class LdapSyntaxDescriptionSyntax
         try
         {
             schemaParser.parseLdapSyntaxDescription( 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/MailPreferenceSyntaxChecker.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/MailPreferenceSyntaxChecker.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/MailPreferenceSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MailPreferenceSyntaxChecker.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;
 
 
 /**
@@ -39,26 +37,40 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class MailPreferenceSyntaxChecker extends SyntaxChecker
+public final class MailPreferenceSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( MailPreferenceSyntaxChecker.class );
-    
     /**
      * A static instance of MailPreferenceSyntaxChecker
      */
-    public static final MailPreferenceSyntaxChecker INSTANCE = new MailPreferenceSyntaxChecker();
-
+    public static final MailPreferenceSyntaxChecker INSTANCE = 
+        new MailPreferenceSyntaxChecker( SchemaConstants.MAIL_PREFERENCE_SYNTAX );
     
     /**
-     * Creates a new instance of MailPreferenceSyntaxChecker.
+     * A static Builder for this class
      */
-    public MailPreferenceSyntaxChecker()
+    public static final class Builder extends SCBuilder<MailPreferenceSyntaxChecker>
     {
-        super( SchemaConstants.MAIL_PREFERENCE_SYNTAX );
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.MAIL_PREFERENCE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of MailPreferenceSyntaxChecker
+         * @return A new instance of MailPreferenceSyntaxChecker
+         */
+        @Override
+        public MailPreferenceSyntaxChecker build()
+        {
+            return new MailPreferenceSyntaxChecker( oid );
+        }
     }
 
-
+    
     /**
      * 
      * Creates a new instance of MailPreferenceSyntaxChecker.
@@ -66,11 +78,20 @@ public class MailPreferenceSyntaxChecker
      * @param oid the oid to associate with this new SyntaxChecker
      *
      */
-    protected MailPreferenceSyntaxChecker( String oid )
+    private MailPreferenceSyntaxChecker( String oid )
     {
         super( oid );
     }
 
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
+    }
+
 
     /**
      * {@inheritDoc}
@@ -82,7 +103,11 @@ public class MailPreferenceSyntaxChecker
 
         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;
         }
 
@@ -101,22 +126,29 @@ public class MailPreferenceSyntaxChecker
 
         if ( ( strValue.length() < 8 ) || ( strValue.length() > 18 ) )
         {
-            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 = ( "NO-LISTS".equals( strValue ) ) || ( "ANY-LIST".equals( strValue ) )
             || ( "PROFESSIONAL-LISTS".equals( strValue ) );
 
-        if ( result )
+        if ( LOG.isDebugEnabled() )
         {
-            LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            if ( result )
+            {
+                LOG.debug( I18n.msg( I18n.MSG_04490_SYNTAX_VALID, value ) );
+            }
+            else
+            {
+                LOG.debug( I18n.err( I18n.ERR_04489_SYNTAX_INVALID, 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/MasterAndShadowAccessPointSyntaxChecker.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/MasterAndShadowAccessPointSyntaxChecker.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/MasterAndShadowAccessPointSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MasterAndShadowAccessPointSyntaxChecker.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;
 
 
 /**
@@ -34,33 +31,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class MasterAndShadowAccessPointSyntaxChecker extends SyntaxChecker
+public final class MasterAndShadowAccessPointSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( MasterAndShadowAccessPointSyntaxChecker.class );
-    
     /**
      * A static instance of MasterAndShadowAccessPointSyntaxChecker
      */
-    public static final MasterAndShadowAccessPointSyntaxChecker INSTANCE = new MasterAndShadowAccessPointSyntaxChecker();
+    public static final MasterAndShadowAccessPointSyntaxChecker INSTANCE = 
+        new MasterAndShadowAccessPointSyntaxChecker( SchemaConstants.MASTER_AND_SHADOW_ACCESS_POINTS_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<MasterAndShadowAccessPointSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.MASTER_AND_SHADOW_ACCESS_POINTS_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of MasterAndShadowAccessPointSyntaxChecker
+         * @return A new instance of MasterAndShadowAccessPointSyntaxChecker
+         */
+        @Override
+        public MasterAndShadowAccessPointSyntaxChecker build()
+        {
+            return new MasterAndShadowAccessPointSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Create a new instance of MasterAndShadowAccessPointSyntaxChecker
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public MasterAndShadowAccessPointSyntaxChecker()
+    private MasterAndShadowAccessPointSyntaxChecker( String oid )
     {
-        super( SchemaConstants.MASTER_AND_SHADOW_ACCESS_POINTS_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/MatchingRuleDescriptionSyntaxChecker.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/MatchingRuleDescriptionSyntaxChecker.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/MatchingRuleDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MatchingRuleDescriptionSyntaxChecker.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.MatchingRuleDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -51,28 +49,60 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class MatchingRuleDescriptionSyntaxChecker extends SyntaxChecker
+public final class MatchingRuleDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( MatchingRuleDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the MatchingRuleDescription Syntax */
     private transient MatchingRuleDescriptionSchemaParser schemaParser = new MatchingRuleDescriptionSchemaParser();
     
     /**
      * A static instance of MatchingRuleDescriptionSyntaxChecker
      */
-    public static final MatchingRuleDescriptionSyntaxChecker INSTANCE = new MatchingRuleDescriptionSyntaxChecker();
+    public static final MatchingRuleDescriptionSyntaxChecker INSTANCE = 
+        new MatchingRuleDescriptionSyntaxChecker( SchemaConstants.MATCHING_RULE_DESCRIPTION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<MatchingRuleDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.MATCHING_RULE_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of MatchingRuleDescriptionSyntaxChecker
+         * @return A new instance of MatchingRuleDescriptionSyntaxChecker
+         */
+        @Override
+        public MatchingRuleDescriptionSyntaxChecker build()
+        {
+            return new MatchingRuleDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of MatchingRuleDescriptionSchemaParser.
      *
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public MatchingRuleDescriptionSyntaxChecker()
+    private MatchingRuleDescriptionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.MATCHING_RULE_DESCRIPTION_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -86,7 +116,11 @@ public class MatchingRuleDescriptionSynt
 
         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,13 +140,21 @@ public class MatchingRuleDescriptionSynt
         try
         {
             schemaParser.parseMatchingRuleDescription( 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/MatchingRuleUseDescriptionSyntaxChecker.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/MatchingRuleUseDescriptionSyntaxChecker.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/MatchingRuleUseDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MatchingRuleUseDescriptionSyntaxChecker.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.MatchingRuleUseDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -48,28 +46,60 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class MatchingRuleUseDescriptionSyntaxChecker extends SyntaxChecker
+public final class MatchingRuleUseDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( MatchingRuleUseDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the MatchingRuleUseDescription Syntax */
     private transient MatchingRuleUseDescriptionSchemaParser schemaParser = new MatchingRuleUseDescriptionSchemaParser();
-    
+
     /**
      * A static instance of MatchingRuleUseDescriptionSyntaxChecker
      */
-    public static final MatchingRuleUseDescriptionSyntaxChecker INSTANCE = new MatchingRuleUseDescriptionSyntaxChecker();
+    public static final MatchingRuleUseDescriptionSyntaxChecker INSTANCE = 
+        new MatchingRuleUseDescriptionSyntaxChecker( SchemaConstants.MATCHING_RULE_USE_DESCRIPTION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<MatchingRuleUseDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.MATCHING_RULE_USE_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of MatchingRuleUseDescriptionSyntaxChecker
+         * @return A new instance of MatchingRuleUseDescriptionSyntaxChecker
+         */
+        @Override
+        public MatchingRuleUseDescriptionSyntaxChecker build()
+        {
+            return new MatchingRuleUseDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of MatchingRuleUseDescriptionSchemaParser.
      *
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public MatchingRuleUseDescriptionSyntaxChecker()
+    private MatchingRuleUseDescriptionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.MATCHING_RULE_USE_DESCRIPTION_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -83,7 +113,11 @@ public class MatchingRuleUseDescriptionS
 
         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;
         }
 
@@ -103,15 +137,22 @@ public class MatchingRuleUseDescriptionS
         try
         {
             schemaParser.parseMatchingRuleUseDescription( 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/MhsOrAddressSyntaxChecker.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/MhsOrAddressSyntaxChecker.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/MhsOrAddressSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/MhsOrAddressSyntaxChecker.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;
 
 
 /**
@@ -34,33 +31,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class MhsOrAddressSyntaxChecker extends SyntaxChecker
+public final class MhsOrAddressSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( MhsOrAddressSyntaxChecker.class );
-    
     /**
      * A static instance of MhsOrAddressSyntaxChecker
      */
-    public static final MhsOrAddressSyntaxChecker INSTANCE = new MhsOrAddressSyntaxChecker();
+    public static final MhsOrAddressSyntaxChecker INSTANCE = 
+        new MhsOrAddressSyntaxChecker( SchemaConstants.MHS_OR_ADDRESS_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<MhsOrAddressSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.MHS_OR_ADDRESS_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of MhsOrAddressSyntaxChecker
+         * @return A new instance of MhsOrAddressSyntaxChecker
+         */
+        @Override
+        public MhsOrAddressSyntaxChecker build()
+        {
+            return new MhsOrAddressSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of MHSORAddressSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public MhsOrAddressSyntaxChecker()
+    private MhsOrAddressSyntaxChecker( String oid )
     {
-        super( SchemaConstants.MHS_OR_ADDRESS_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/NameAndOptionalUIDSyntaxChecker.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/NameAndOptionalUIDSyntaxChecker.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/NameAndOptionalUIDSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.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;
 
 
 /**
@@ -45,23 +43,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class NameAndOptionalUIDSyntaxChecker extends SyntaxChecker
+public final class NameAndOptionalUIDSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( NameAndOptionalUIDSyntaxChecker.class );
-    
     /**
      * A static instance of NameAndOptionalUIDSyntaxChecker
      */
-    public static final NameAndOptionalUIDSyntaxChecker INSTANCE = new NameAndOptionalUIDSyntaxChecker();
+    public static final NameAndOptionalUIDSyntaxChecker INSTANCE = 
+        new NameAndOptionalUIDSyntaxChecker( SchemaConstants.NAME_AND_OPTIONAL_UID_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NameAndOptionalUIDSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NAME_AND_OPTIONAL_UID_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NameAndOptionalUIDSyntaxChecker
+         * @return A new instance of NameAndOptionalUIDSyntaxChecker
+         */
+        @Override
+        public NameAndOptionalUIDSyntaxChecker build()
+        {
+            return new NameAndOptionalUIDSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of NameAndOptionalUIDSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private NameAndOptionalUIDSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public NameAndOptionalUIDSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.NAME_AND_OPTIONAL_UID_SYNTAX );
+        return new Builder();
     }
 
 
@@ -75,7 +107,11 @@ public class NameAndOptionalUIDSyntaxChe
 
         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;
         }
 
@@ -94,7 +130,11 @@ public class NameAndOptionalUIDSyntaxChe
 
         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;
         }
 
@@ -108,7 +148,11 @@ public class NameAndOptionalUIDSyntaxChe
             {
                 // Yes, we have one : this is not allowed, it should have been
                 // escaped.
-                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;
             }
 
@@ -124,13 +168,16 @@ public class NameAndOptionalUIDSyntaxChe
                 {
                     boolean result = Dn.isValid( strValue.substring( 0, sharpPos ) );
 
-                    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;
@@ -139,14 +186,22 @@ public class NameAndOptionalUIDSyntaxChe
                 else
                 {
                     // The Dn must not be null ?
-                    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
             {
                 // We have found a '#' but no UID part.
-                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,13 +211,16 @@ public class NameAndOptionalUIDSyntaxChe
             // 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/NameFormDescriptionSyntaxChecker.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/NameFormDescriptionSyntaxChecker.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/NameFormDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NameFormDescriptionSyntaxChecker.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.NameFormDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -50,28 +48,60 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class NameFormDescriptionSyntaxChecker extends SyntaxChecker
+public final class NameFormDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( NameFormDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private transient NameFormDescriptionSchemaParser schemaParser = new NameFormDescriptionSchemaParser();
     
     /**
      * A static instance of NameFormDescriptionSyntaxChecker
      */
-    public static final NameFormDescriptionSyntaxChecker INSTANCE = new NameFormDescriptionSyntaxChecker();
+    public static final NameFormDescriptionSyntaxChecker INSTANCE = 
+        new NameFormDescriptionSyntaxChecker( SchemaConstants.NAME_FORM_DESCRIPTION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NameFormDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NAME_FORM_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NameFormDescriptionSyntaxChecker
+         * @return A new instance of NameFormDescriptionSyntaxChecker
+         */
+        @Override
+        public NameFormDescriptionSyntaxChecker build()
+        {
+            return new NameFormDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
-     * 
      * Creates a new instance of DITContentRuleDescriptionSyntaxChecker.
      *
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private NameFormDescriptionSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public NameFormDescriptionSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.NAME_FORM_DESCRIPTION_SYNTAX );
+        return new Builder();
     }
 
 
@@ -85,7 +115,11 @@ public class NameFormDescriptionSyntaxCh
 
         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;
         }
 
@@ -105,11 +139,16 @@ public class NameFormDescriptionSyntaxCh
         try
         {
             schemaParser.parseNameFormDescription( strValue );
+            
             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/NormalizerSyntaxChecker.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/NormalizerSyntaxChecker.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/NormalizerSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NormalizerSyntaxChecker.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,19 +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 NormalizerSyntaxChecker extends Ia5StringSyntaxChecker
+public final class NormalizerSyntaxChecker extends SyntaxChecker
 {
     /**
      * A static instance of NormalizerSyntaxChecker
      */
-    public static final NormalizerSyntaxChecker INSTANCE = new NormalizerSyntaxChecker();
+    public static final NormalizerSyntaxChecker INSTANCE = new NormalizerSyntaxChecker( SchemaConstants.NORMALIZER_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NormalizerSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NORMALIZER_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NormalizerSyntaxChecker
+         * @return A new instance of NormalizerSyntaxChecker
+         */
+        @Override
+        public NormalizerSyntaxChecker build()
+        {
+            return new NormalizerSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of NormalizerSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private NormalizerSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public NormalizerSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.NORMALIZER_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/NumberSyntaxChecker.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/NumberSyntaxChecker.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/NumberSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumberSyntaxChecker.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;
 
 
 /**
@@ -41,23 +39,56 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class NumberSyntaxChecker extends SyntaxChecker
+public final class NumberSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( NumberSyntaxChecker.class );
-    
     /**
      * A static instance of NumberSyntaxChecker
      */
-    public static final NumberSyntaxChecker INSTANCE = new NumberSyntaxChecker();
+    public static final NumberSyntaxChecker INSTANCE = new NumberSyntaxChecker( SchemaConstants.NUMBER_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NumberSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NUMBER_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NumberSyntaxChecker
+         * @return A new instance of NumberSyntaxChecker
+         */
+        @Override
+        public NumberSyntaxChecker build()
+        {
+            return new NumberSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of NumberSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private NumberSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public NumberSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.NUMBER_SYNTAX );
+        return new Builder();
     }
 
 
@@ -71,7 +102,11 @@ public class NumberSyntaxChecker 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;
         }
 
@@ -91,7 +126,11 @@ public class NumberSyntaxChecker extends
         // We should have at least one char
         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,7 +152,11 @@ public class NumberSyntaxChecker extends
                     continue;
 
                 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;
             }
         }
@@ -122,11 +165,19 @@ public class NumberSyntaxChecker extends
         {
             // A number can't start with a '0' unless it's the only
             // 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;
         }
 
-        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/NumericOidSyntaxChecker.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/NumericOidSyntaxChecker.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/NumericOidSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumericOidSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -25,8 +25,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;
 
 
 /**
@@ -45,23 +43,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class NumericOidSyntaxChecker extends SyntaxChecker
+public final class NumericOidSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( NumericOidSyntaxChecker.class );
-    
     /**
      * A static instance of NumericOidSyntaxChecker
      */
-    public static final NumericOidSyntaxChecker INSTANCE = new NumericOidSyntaxChecker();
+    public static final NumericOidSyntaxChecker INSTANCE = 
+        new NumericOidSyntaxChecker( SchemaConstants.NUMERIC_OID_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NumericOidSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NUMERIC_OID_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NumericOidSyntaxChecker
+         * @return A new instance of NumericOidSyntaxChecker
+         */
+        @Override
+        public NumericOidSyntaxChecker build()
+        {
+            return new NumericOidSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of NumericOidSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public NumericOidSyntaxChecker()
+    private NumericOidSyntaxChecker( String oid )
     {
-        super( SchemaConstants.NUMERIC_OID_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -75,7 +107,11 @@ public class NumericOidSyntaxChecker 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;
         }
 
@@ -94,20 +130,27 @@ public class NumericOidSyntaxChecker ext
 
         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;
         }
 
         // Just check that the value is a valid OID
         boolean result = Oid.isOid( 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/NumericStringSyntaxChecker.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/NumericStringSyntaxChecker.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/NumericStringSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/NumericStringSyntaxChecker.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;
 
 
 /**
@@ -44,23 +42,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class NumericStringSyntaxChecker extends SyntaxChecker
+public final class NumericStringSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( NumericStringSyntaxChecker.class );
-    
     /**
      * A static instance of NumericStringSyntaxChecker
      */
-    public static final NumericStringSyntaxChecker INSTANCE = new NumericStringSyntaxChecker();
+    public static final NumericStringSyntaxChecker INSTANCE = 
+        new NumericStringSyntaxChecker( SchemaConstants.NUMERIC_STRING_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<NumericStringSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.NUMERIC_STRING_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of NumericStringSyntaxChecker
+         * @return A new instance of NumericStringSyntaxChecker
+         */
+        @Override
+        public NumericStringSyntaxChecker build()
+        {
+            return new NumericStringSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of NumericStringSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private NumericStringSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public NumericStringSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.NUMERIC_STRING_SYNTAX );
+        return new Builder();
     }
 
 
@@ -74,7 +106,11 @@ public class NumericStringSyntaxChecker
 
         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;
         }
 
@@ -94,7 +130,11 @@ public class NumericStringSyntaxChecker
         // We should have at least one char
         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;
         }
 
@@ -117,12 +157,20 @@ public class NumericStringSyntaxChecker
                     continue;
 
                 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;
             }
         }
 
-        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/ObjectClassDescriptionSyntaxChecker.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/ObjectClassDescriptionSyntaxChecker.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/ObjectClassDescriptionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectClassDescriptionSyntaxChecker.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.ObjectClassDescriptionSchemaParser;
 import org.apache.directory.api.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -56,26 +54,60 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class ObjectClassDescriptionSyntaxChecker extends SyntaxChecker
+public final class ObjectClassDescriptionSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( ObjectClassDescriptionSyntaxChecker.class );
-
     /** The schema parser used to parse the ObjectClassDescription Syntax */
     private transient ObjectClassDescriptionSchemaParser schemaParser = new ObjectClassDescriptionSchemaParser();
     
     /**
      * A static instance of ObjectClassDescriptionSyntaxChecker
      */
-    public static final ObjectClassDescriptionSyntaxChecker INSTANCE = new ObjectClassDescriptionSyntaxChecker();
+    public static final ObjectClassDescriptionSyntaxChecker INSTANCE = 
+        new ObjectClassDescriptionSyntaxChecker( SchemaConstants.OBJECT_CLASS_DESCRIPTION_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<ObjectClassDescriptionSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.OBJECT_CLASS_DESCRIPTION_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of ObjectClassDescriptionSyntaxChecker
+         * @return A new instance of ObjectClassDescriptionSyntaxChecker
+         */
+        @Override
+        public ObjectClassDescriptionSyntaxChecker build()
+        {
+            return new ObjectClassDescriptionSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of ObjectClassDescriptionSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
      */
-    public ObjectClassDescriptionSyntaxChecker()
+    private ObjectClassDescriptionSyntaxChecker( String oid )
     {
-        super( SchemaConstants.OBJECT_CLASS_DESCRIPTION_SYNTAX );
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -89,7 +121,11 @@ public class ObjectClassDescriptionSynta
 
         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;
         }
 
@@ -109,12 +145,21 @@ public class ObjectClassDescriptionSynta
         try
         {
             schemaParser.parseObjectClassDescription( 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/ObjectClassTypeSyntaxChecker.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/ObjectClassTypeSyntaxChecker.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/ObjectClassTypeSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectClassTypeSyntaxChecker.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;
 
 
 /**
@@ -35,23 +33,57 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class ObjectClassTypeSyntaxChecker extends SyntaxChecker
+public final class ObjectClassTypeSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( ObjectClassTypeSyntaxChecker.class );
-    
     /**
      * A static instance of ObjectClassTypeSyntaxChecker
      */
-    public static final ObjectClassTypeSyntaxChecker INSTANCE = new ObjectClassTypeSyntaxChecker();
+    public static final ObjectClassTypeSyntaxChecker INSTANCE = 
+        new ObjectClassTypeSyntaxChecker( SchemaConstants.OBJECT_CLASS_TYPE_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<ObjectClassTypeSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.OBJECT_CLASS_TYPE_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of ObjectClassTypeSyntaxChecker
+         * @return A new instance of ObjectClassTypeSyntaxChecker
+         */
+        @Override
+        public ObjectClassTypeSyntaxChecker build()
+        {
+            return new ObjectClassTypeSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of ObjectClassTypeSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private ObjectClassTypeSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public ObjectClassTypeSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.OBJECT_CLASS_TYPE_SYNTAX );
+        return new Builder();
     }
 
 
@@ -65,7 +97,11 @@ public class ObjectClassTypeSyntaxChecke
 
         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;
         }
 
@@ -84,7 +120,11 @@ public class ObjectClassTypeSyntaxChecke
 
         if ( strValue.length() < 8 || strValue.length() > 10 )
         {
-            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;
         }
 
@@ -93,11 +133,19 @@ public class ObjectClassTypeSyntaxChecke
             case "AUXILIARY" :
             case "ABSTRACT" :
             case "STRUCTURAL" :
-                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/ObjectNameSyntaxChecker.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/ObjectNameSyntaxChecker.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/ObjectNameSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ObjectNameSyntaxChecker.java Thu Mar 30 03:29:51 2017
@@ -20,15 +20,12 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 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;
 
 
 /**
@@ -49,11 +46,8 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @SuppressWarnings("serial")
-public class ObjectNameSyntaxChecker extends SyntaxChecker
+public final class ObjectNameSyntaxChecker extends SyntaxChecker
 {
-    /** A logger for this class */
-    private static final Logger LOG = LoggerFactory.getLogger( ObjectNameSyntaxChecker.class );
-
     private static final String REGEXP = "^([a-zA-Z][a-zA-Z0-9-;]*)$";
 
     private static final Pattern PATTERN = Pattern.compile( REGEXP );
@@ -61,15 +55,52 @@ public class ObjectNameSyntaxChecker ext
     /**
      * A static instance of ObjectNameSyntaxChecker
      */
-    public static final ObjectNameSyntaxChecker INSTANCE = new ObjectNameSyntaxChecker();
+    public static final ObjectNameSyntaxChecker INSTANCE = 
+        new ObjectNameSyntaxChecker( SchemaConstants.OBJECT_NAME_SYNTAX );
+    
+    /**
+     * A static Builder for this class
+     */
+    public static final class Builder extends SCBuilder<ObjectNameSyntaxChecker>
+    {
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.OBJECT_NAME_SYNTAX );
+        }
+        
+        
+        /**
+         * Create a new instance of ObjectNameSyntaxChecker
+         * @return A new instance of ObjectNameSyntaxChecker
+         */
+        @Override
+        public ObjectNameSyntaxChecker build()
+        {
+            return new ObjectNameSyntaxChecker( oid );
+        }
+    }
 
     
     /**
      * Creates a new instance of ObjectNameSyntaxChecker.
+     * 
+     * @param oid The OID to use for this SyntaxChecker
+     */
+    private ObjectNameSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @return An instance of the Builder for this class
      */
-    public ObjectNameSyntaxChecker()
+    public static Builder builder()
     {
-        super( SchemaConstants.OBJECT_NAME_SYNTAX );
+        return new Builder();
     }
 
 
@@ -83,7 +114,11 @@ public class ObjectNameSyntaxChecker 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;
         }
 
@@ -102,22 +137,27 @@ public class ObjectNameSyntaxChecker ext
 
         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;
         }
 
         // Search for the '$' separator
-        Matcher match = PATTERN.matcher( strValue );
+        boolean result = PATTERN.matcher( strValue ).matches();
 
-        boolean result = match.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;



Mime
View raw message