directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r488370 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/
Date Mon, 18 Dec 2006 17:57:38 GMT
Author: elecharny
Date: Mon Dec 18 09:57:36 2006
New Revision: 488370

URL: http://svn.apache.org/viewvc?view=rev&rev=488370
Log:
Added an AbstractSyntaxChecker class
Modified the interface
Modified all the classes to reflect these modifications

Added:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java   (with props)
Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AcceptAllSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeUsageSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BinarySyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BitStringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CountrySyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DNSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DeliveryMethodSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DirectoryStringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/FacsimileTelephoneNumberSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/GeneralizedTimeSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/IntegerSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameAndOptionalUIDSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameFormDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumberSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericOidSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericStringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OctetStringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidLenSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/RegexSyntaxChecker.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxChecker.java

Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java?view=auto&rev=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java (added)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.schema.syntax;
+
+
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
+
+
+/**
+ * Document me.
+ *
+ * @todo put me into shared-ldap
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 485042 $
+ */
+public abstract class AbstractSyntaxChecker implements SyntaxChecker
+{
+    /** the oid of the syntax checker */
+    private String oid = null;
+    
+    /**
+     * 
+     * Creates a new instance of AbstractSyntaxChecker.
+     *
+     * @param oid The inherited class OID
+     */
+    protected AbstractSyntaxChecker( String oid )
+    {
+        this.oid = oid;
+    }
+
+    /**
+     * Gets the OID of this SyntaxChecker.
+     *
+     * @return the OID of this SyntaxChecker.
+     */
+    public String getSyntaxOid()
+    {
+        return oid;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
+     */
+    public void assertSyntax( Object value ) throws NamingException
+    {
+        if ( !isValidSyntax( value ) )
+        {
+            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+        }
+    }
+}

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AbstractSyntaxChecker.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AcceptAllSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AcceptAllSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AcceptAllSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AcceptAllSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,22 +20,14 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-
 /**
  * A SyntaxChecker implementation which accepts all values as valid.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class AcceptAllSyntaxChecker implements SyntaxChecker
+public class AcceptAllSyntaxChecker extends AbstractSyntaxChecker
 {
-    /** the OID of the Syntax this checker is associated with */
-    private final String oid;
-
-
     /**
      * Creates a SyntaxChecker which accepts all values.
      * 
@@ -44,16 +36,7 @@
      */
     public AcceptAllSyntaxChecker(String oid)
     {
-        this.oid = oid;
-    }
-
-
-    /**
-     * @see SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
+        super( oid );
     }
 
 
@@ -65,15 +48,5 @@
     public boolean isValidSyntax( Object a_value )
     {
         return true;
-    }
-
-
-    /**
-     * Does nothing but return immediately and no exceptions are ever thrown.
-     * 
-     * @see SyntaxChecker#assertSyntax(Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.AttributeTypeDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -72,16 +68,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class AttributeTypeDescriptionSyntaxChecker implements SyntaxChecker
+public class AttributeTypeDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.1 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.3";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.3";
 
 	/** The schema parser used to parse the AttributeTypeDescription Syntax */
     private AttributeTypeDescriptionSchemaParser schemaParser = new AttributeTypeDescriptionSchemaParser();
 
-
     /**
      * 
      * Creates a new instance of AttributeTypeDescriptionSchemaParser.
@@ -89,29 +84,8 @@
      */
     public AttributeTypeDescriptionSyntaxChecker()
     {
+        super( SC_OID );
     }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeUsageSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeUsageSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeUsageSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeUsageSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,10 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -38,52 +34,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class AttributeTypeUsageSyntaxChecker implements SyntaxChecker
+public class AttributeTypeUsageSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Apache OID for meta syntax checker */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.18060.0.4.0.0.3";
-    
-    /** I don't really know if this member is usefull ... */
-    private final String oid;
- 
+    private static final String SC_OID = "1.3.6.1.4.1.18060.0.4.0.0.3";
     
-    public AttributeTypeUsageSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
-    
-    /**
-     * 
-     * Creates a new instance of AttributeTypeUsageSyntaxChecker.
-     *
-     */
     public AttributeTypeUsageSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
-
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BinarySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BinarySyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BinarySyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BinarySyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,62 +20,25 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-
 /**
  * A binary value (universal value acceptor) syntax checker.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BinarySyntaxChecker implements SyntaxChecker
+public class BinarySyntaxChecker extends AbstractSyntaxChecker
 {
-    /** an instance so we don't have to create one every time */
-    public static final SyntaxChecker INSTANCE = new BinarySyntaxChecker();
-
     /** the Apache assigned internal OID for this syntax checker */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.5";
-
-
-    /**
-     * Gets the singleton instance for this class.
-     * 
-     * @return the singleton instance
-     */
-    public static SyntaxChecker getSingletonInstance()
-    {
-        return INSTANCE;
-    }
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.5";
 
 
     /**
      * Private default constructor to prevent unnecessary instantiation.
      */
-    private BinarySyntaxChecker()
+    public BinarySyntaxChecker()
     {
-        // so people are not creating this unnecesarily
+        super( SC_OID );
     }
-
-
-    /**
-     * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#assertSyntax(Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        // do nothing because everything is valid
-    }
-
-
-    /**
-     * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
 
     /**
      * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#isValidSyntax(Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BitStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BitStringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BitStringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BitStringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -41,19 +36,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BitStringSyntaxChecker implements SyntaxChecker
+public class BitStringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.2 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.6";
-    
-    /** The Syntax OID */
-    private final String oid;
-    
-    
-    public BitStringSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.6";
     
     /**
      * 
@@ -62,30 +48,9 @@
      */
     public BitStringSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
     /**
      * A shared and static method used to check that the string is a BitString.
      * A BitString is a string of bits, between quots and followed by a 'B' :

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -39,10 +34,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BooleanSyntaxChecker implements SyntaxChecker
+public class BooleanSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.3 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.7";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.7";
     
     /**
      * 
@@ -51,30 +46,10 @@
      */
     public BooleanSyntaxChecker()
     {
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CountrySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CountrySyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CountrySyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CountrySyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -23,11 +23,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -43,13 +38,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class CountrySyntaxChecker implements SyntaxChecker
+public class CountrySyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.4 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.11";
-    
-    /** The Syntax OID */
-    private final String oid;
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.11";
     
     /** The ISO 3166 list of countries, as of 2006 */
     private static final String[] COUNTRY_ISO_3166 =
@@ -93,11 +85,6 @@
         }
     }
     
-    public CountrySyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
-    
     /**
      * 
      * Creates a new instance of CountrySyntaxChecker.
@@ -105,31 +92,10 @@
      */
     public CountrySyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.DITContentRuleDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -50,11 +46,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DITContentRuleDescriptionSyntaxChecker implements SyntaxChecker
+public class DITContentRuleDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.7 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.16";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.16";
 
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private DITContentRuleDescriptionSchemaParser schemaParser = new DITContentRuleDescriptionSchemaParser();
@@ -67,27 +63,7 @@
      */
     public DITContentRuleDescriptionSyntaxChecker()
     {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.DITStructureRuleDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -52,11 +48,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DITStructureRuleDescriptionSyntaxChecker implements SyntaxChecker
+public class DITStructureRuleDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.8 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.17";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.17";
 
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private DITStructureRuleDescriptionSchemaParser schemaParser = new DITStructureRuleDescriptionSchemaParser();
@@ -69,29 +65,8 @@
      */
     public DITStructureRuleDescriptionSyntaxChecker()
     {
+        super( SC_OID );
     }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DNSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DNSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DNSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DNSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -36,19 +31,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DNSyntaxChecker implements SyntaxChecker
+public class DNSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according RFC 4517, par. 3.3.9 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.12";
-    
-    /** The Syntax OID */
-    private final String oid;
-    
-    
-    public DNSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.12";
     
     /**
      * 
@@ -57,30 +43,8 @@
      */
     public DNSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
-    }
-    
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DeliveryMethodSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DeliveryMethodSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DeliveryMethodSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DeliveryMethodSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -23,11 +23,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -50,14 +45,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DeliveryMethodSyntaxChecker implements SyntaxChecker
+public class DeliveryMethodSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.5 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.14";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.14";
     
-    /** The Syntax OID */
-    private final String oid;
-
     private static final String[] PDMS = 
         {
             "any", "mhs", "physical", "telex", "teletex",
@@ -77,11 +69,6 @@
     }
 
     
-    public DeliveryMethodSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
-    
     /**
      * 
      * Creates a new instance of DeliveryMethodSyntaxChecker.
@@ -89,30 +76,9 @@
      */
     public DeliveryMethodSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
     /**
      * 
      * Check if the string contains a delivery method which has 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DirectoryStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DirectoryStringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DirectoryStringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/DirectoryStringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,10 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -36,10 +32,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 437007 $
  */
-public class DirectoryStringSyntaxChecker implements SyntaxChecker
+public class DirectoryStringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.6 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.15";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.15";
     
 
     /**
@@ -49,27 +45,9 @@
      */
     public DirectoryStringSyntaxChecker()
     {
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
     
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/FacsimileTelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/FacsimileTelephoneNumberSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/FacsimileTelephoneNumberSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/FacsimileTelephoneNumberSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -23,11 +23,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -56,7 +51,7 @@
 public class FacsimileTelephoneNumberSyntaxChecker extends TelephoneNumberSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.11 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.22";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.22";
     
     /** Fax parameters possible values */
     private final static String TWO_DIMENSIONAL  = "twoDimensional";
@@ -87,26 +82,7 @@
      */
     public FacsimileTelephoneNumberSyntaxChecker()
     {
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/GeneralizedTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/GeneralizedTimeSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/GeneralizedTimeSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/GeneralizedTimeSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,11 +22,6 @@
 
 import java.util.regex.Pattern;
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -69,10 +64,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class GeneralizedTimeSyntaxChecker implements SyntaxChecker
+public class GeneralizedTimeSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.13 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.24";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.24";
     
     /** The GeneralizedDate pattern matching */
     private static final String GENERALIZED_TIME_PATTERN = 
@@ -97,30 +92,9 @@
      */
     public GeneralizedTimeSyntaxChecker()
     {
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,10 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -36,10 +32,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 437007 $
  */
-public class Ia5StringSyntaxChecker implements SyntaxChecker
+public class Ia5StringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.15 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.26";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.26";
     
 
     /**
@@ -49,26 +45,7 @@
      */
     public Ia5StringSyntaxChecker()
     {
-    }
-    
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
+        super( SC_OID );
     }
     
     /* (non-Javadoc)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/IntegerSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/IntegerSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/IntegerSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/IntegerSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -45,10 +40,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class IntegerSyntaxChecker implements SyntaxChecker
+public class IntegerSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.16 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.27";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.27";
     
     /**
      * 
@@ -57,30 +52,10 @@
      */
     public IntegerSyntaxChecker()
     {
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,12 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-
-
 /**
  * A SyntaxChecker which verifies that a value is a Jpeg according to RFC 4517.
  * 
@@ -42,12 +36,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 437007 $
  */
-public class JpegSyntaxChecker implements SyntaxChecker
+public class JpegSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.25 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.28";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.28";
     
-
     /**
      * 
      * Creates a new instance of JpegSyntaxChecker.
@@ -55,27 +48,9 @@
      */
     public JpegSyntaxChecker()
     {
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
     
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.LdapSyntaxDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -44,11 +40,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class LdapSyntaxDescriptionSyntaxChecker implements SyntaxChecker
+public class LdapSyntaxDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.18 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.54";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.54";
 
 	/** The schema parser used to parse the LdapSyntaxDescription Syntax */
     private LdapSyntaxDescriptionSchemaParser schemaParser = new LdapSyntaxDescriptionSchemaParser();
@@ -61,29 +57,8 @@
      */
     public LdapSyntaxDescriptionSyntaxChecker()
     {
+        super( SC_OID );
     }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
 
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.MatchingRuleDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -51,11 +47,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class MatchingRuleDescriptionSyntaxChecker implements SyntaxChecker
+public class MatchingRuleDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.19 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.30";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.30";
 
 	/** The schema parser used to parse the MatchingRuleDescription Syntax */
     private MatchingRuleDescriptionSchemaParser schemaParser = new MatchingRuleDescriptionSchemaParser();
@@ -68,27 +64,7 @@
      */
     public MatchingRuleDescriptionSyntaxChecker()
     {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.MatchingRuleUseDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -48,11 +44,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class MatchingRuleUseDescriptionSyntaxChecker implements SyntaxChecker
+public class MatchingRuleUseDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.20 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.31";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.31";
 
 	/** The schema parser used to parse the MatchingRuleUseDescription Syntax */
     private MatchingRuleUseDescriptionSchemaParser schemaParser = new MatchingRuleUseDescriptionSchemaParser();
@@ -65,27 +61,7 @@
      */
     public MatchingRuleUseDescriptionSyntaxChecker()
     {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameAndOptionalUIDSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameAndOptionalUIDSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameAndOptionalUIDSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameAndOptionalUIDSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -44,10 +39,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NameAndOptionalUIDSyntaxChecker implements SyntaxChecker
+public class NameAndOptionalUIDSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according RFC 4517, par. 3.3.21 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.34";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.34";
     
     /**
      * 
@@ -56,30 +51,10 @@
      */
     public NameAndOptionalUIDSyntaxChecker()
     {
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return DEFAULT_OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameFormDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameFormDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameFormDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NameFormDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.NameFormDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -49,11 +45,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NameFormDescriptionSyntaxChecker implements SyntaxChecker
+public class NameFormDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.22 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.35";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.35";
 
     /** The schema parser used to parse the DITContentRuleDescription Syntax */
     private NameFormDescriptionSchemaParser schemaParser = new NameFormDescriptionSchemaParser();
@@ -66,27 +62,7 @@
      */
     public NameFormDescriptionSyntaxChecker()
     {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumberSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumberSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumberSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -40,10 +35,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NumberSyntaxChecker implements SyntaxChecker
+public class NumberSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.23 */
-    public static final String OID = "1.3.6.1.4.1.18060.0.4.0.0.4";
+    private static final String SC_OID = "1.3.6.1.4.1.18060.0.4.0.0.4";
     
     /**
      * 
@@ -52,30 +47,10 @@
      */
     public NumberSyntaxChecker()
     {
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericOidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericOidSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericOidSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericOidSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,12 +20,8 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
 
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -45,45 +41,22 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NumericOidSyntaxChecker implements SyntaxChecker
+public class NumericOidSyntaxChecker extends AbstractSyntaxChecker
 {
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.18060.0.4.0.0.2";
-    private final String oid;
-    
-    
-    public NumericOidSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
-    
+    /** The numericOIDSyntaxChecker's OID */
+    private static final String SC_OID = "1.3.6.1.4.1.18060.0.4.0.0.2";
     
+    /**
+     * 
+     * Creates a new instance of NumericOidSyntaxChecker.
+     *
+     */
     public NumericOidSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericStringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericStringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/NumericStringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -44,10 +39,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class NumericStringSyntaxChecker implements SyntaxChecker
+public class NumericStringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.23 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.36";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.36";
     
     /**
      * 
@@ -56,30 +51,10 @@
      */
     public NumericStringSyntaxChecker()
     {
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -22,10 +22,6 @@
 
 import java.text.ParseException;
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.syntax.parser.ObjectClassDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -55,11 +51,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ObjectClassDescriptionSyntaxChecker implements SyntaxChecker
+public class ObjectClassDescriptionSyntaxChecker extends AbstractSyntaxChecker
 {
 
     /** The Syntax OID, according to RFC 4517, par. 3.3.24 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.37";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.37";
 
 	/** The schema parser used to parse the ObjectClassDescription Syntax */
     private ObjectClassDescriptionSchemaParser schemaParser = new ObjectClassDescriptionSchemaParser();
@@ -72,27 +68,7 @@
      */
     public ObjectClassDescriptionSyntaxChecker()
     {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( !isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
+        super( SC_OID );
     }
 
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,10 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -34,19 +30,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ObjectClassTypeSyntaxChecker implements SyntaxChecker
+public class ObjectClassTypeSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Apache OID for meta syntax checker */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.18060.0.4.0.0.1";
-    
-    /** I don't really know if this member is usefull ... */
-    private final String oid;
- 
-    
-    public ObjectClassTypeSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
+    private static final String SC_OID = "1.3.6.1.4.1.18060.0.4.0.0.1";
     
     /**
      * 
@@ -55,31 +42,10 @@
      */
     public ObjectClassTypeSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
 
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OctetStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OctetStringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OctetStringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OctetStringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,12 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-
-
 /**
  * A SyntaxChecker which verifies that a value is a Octet String according to RFC 4517.
  * 
@@ -38,10 +32,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 437007 $
  */
-public class OctetStringSyntaxChecker implements SyntaxChecker
+public class OctetStringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.25 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.40";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.40";
     
 
     /**
@@ -51,26 +45,7 @@
      */
     public OctetStringSyntaxChecker()
     {
-    }
-    
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
+        super( SC_OID );
     }
     
     /* (non-Javadoc)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidLenSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidLenSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidLenSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidLenSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,12 +20,7 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -49,52 +44,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class OidLenSyntaxChecker implements SyntaxChecker
+public class OidLenSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.18060.0.4.0.0.5";
-    
-    /** The Syntax OID */
-    private final String oid;
-    
+    private static final String SC_OID = "1.3.6.1.4.1.18060.0.4.0.0.5";
     
-    public OidLenSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
-    
-    /**
-     * 
-     * Creates a new instance of OidLenSyntaxChecker.
-     *
-     */
     public OidLenSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OidSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,12 +20,7 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -51,19 +46,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class OidSyntaxChecker implements SyntaxChecker
+public class OidSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according RFC 4517, par. 3.3.26 */
-    public static final String DEFAULT_OID = "1.3.6.1.4.1.1466.115.121.1.38";
-    
-    /** The Syntax OID */
-    private final String oid;
-    
-    
-    public OidSyntaxChecker( String oid )
-    {
-        this.oid = oid;
-    }
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.38";
     
     /**
      * 
@@ -72,31 +58,10 @@
      */
     public OidSyntaxChecker()
     {
-        this.oid = DEFAULT_OID;
+        super( SC_OID );
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -59,10 +54,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class PrintableStringSyntaxChecker implements SyntaxChecker
+public class PrintableStringSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.29 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.44";
+    private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.44";
     
     /** A table containing booleans when the corresponding char is printable */
     private static final boolean[] IS_PRINTABLE_CHAR =
@@ -92,28 +87,9 @@
      */
     public PrintableStringSyntaxChecker()
     {
+        super( SC_OID );
     }
     
-    
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
     
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/RegexSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/RegexSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/RegexSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/RegexSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -20,11 +20,6 @@
 package org.apache.directory.shared.ldap.schema.syntax;
 
 
-import javax.naming.NamingException;
-import javax.naming.directory.InvalidAttributeValueException;
-
-
-
 /**
  * A SyntaxChecker implemented using Perl5 regular expressions to constrain
  * values.
@@ -32,11 +27,8 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RegexSyntaxChecker implements SyntaxChecker
+public class RegexSyntaxChecker extends AbstractSyntaxChecker
 {
-    /** the oid of the syntax checked */
-    private final String oid;
-
     /** the set of regular expressions */
     private final String[] expressions;
 
@@ -50,19 +42,10 @@
      * @param matchExprArray
      *            the array of matching expressions
      */
-    public RegexSyntaxChecker(String oid, String[] matchExprArray)
+    public RegexSyntaxChecker( String oid, String[] matchExprArray )
     {
+        super( oid );
         expressions = matchExprArray;
-        this.oid = oid;
-    }
-
-
-    /**
-     * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return oid;
     }
 
 
@@ -90,19 +73,5 @@
         }
 
         return match;
-    }
-
-
-    /**
-     * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( isValidSyntax( value ) )
-        {
-            return;
-        }
-
-        throw new InvalidAttributeValueException( value + " does not conform to the syntax specified by " + oid );
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxChecker.java?view=diff&rev=488370&r1=488369&r2=488370
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxChecker.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxChecker.java Mon Dec 18 09:57:36 2006
@@ -25,11 +25,6 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import javax.naming.NamingException;
-
-
-import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -47,10 +42,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class TelephoneNumberSyntaxChecker implements SyntaxChecker
+public class TelephoneNumberSyntaxChecker extends AbstractSyntaxChecker
 {
     /** The Syntax OID, according to RFC 4517, par. 3.3.31 */
-    public static final String OID = "1.3.6.1.4.1.1466.115.121.1.50";
+    private static final String OID = "1.3.6.1.4.1.1466.115.121.1.50";
     
     /** Other regexps to extend the initial one */
     private List<String> regexps;
@@ -72,6 +67,15 @@
      */
     public TelephoneNumberSyntaxChecker()
     {
+        super( OID );
+    }
+
+    /**
+     * Creates a new instance of TelephoneNumberSyntaxChecker.
+     */
+    protected TelephoneNumberSyntaxChecker( String oid )
+    {
+        super( oid );
     }
 
     /**
@@ -123,27 +127,6 @@
         }
     }
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
-    public void assertSyntax( Object value ) throws NamingException
-    {
-        if ( ! isValidSyntax( value ) )
-        {
-            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#getSyntaxOid()
-     */
-    public String getSyntaxOid()
-    {
-        return OID;
-    }
-
-
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
      */



Mime
View raw message