directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 53890 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema
Date Wed, 06 Oct 2004 18:03:27 GMT
Author: akarasulu
Date: Wed Oct  6 11:03:25 2004
New Revision: 53890

Modified:
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseSyntax.java
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BinarySyntaxChecker.java
Log:
using BiSyChecker as the default in BaseSyntax

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseSyntax.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseSyntax.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseSyntax.java
Wed Oct  6 11:03:25 2004
@@ -25,6 +25,8 @@
  */
 public class BaseSyntax implements Syntax
 {
+    /** use default binary syntax checker (where all values accepted) */
+    private final SyntaxChecker DEFAULT_CHECKER = BinarySyntaxChecker.INSTANCE;
     /** the oid of this Syntax */
     private final String oid;
 
@@ -51,6 +53,8 @@
     public BaseSyntax( String oid )
     {
         this.oid = oid;
+        this.isHumanReadible = false;
+        this.checker = DEFAULT_CHECKER;
     }
     
     

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BinarySyntaxChecker.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BinarySyntaxChecker.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BinarySyntaxChecker.java
Wed Oct  6 11:03:25 2004
@@ -28,6 +28,30 @@
  */
 public class BinarySyntaxChecker implements SyntaxChecker
 {
+    /** an instance so we don't have to create one every time */
+    public static final SyntaxChecker INSTANCE = new BinarySyntaxChecker();
+
+
+    /**
+     * Gets the singleton instance for this class.
+     *
+     * @return the singleton instance
+     */
+    public static SyntaxChecker getSingletonInstance()
+    {
+        return INSTANCE;
+    }
+
+    
+    /**
+     * Private default constructor to prevent unnecessary instantiation.
+     */
+    private BinarySyntaxChecker()
+    {
+        // so people are not creating this unnecesarily
+    }
+
+
     /**
      * @see org.apache.ldap.common.schema.SyntaxChecker#assertSyntax(Object)
      */

Mime
View raw message