directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r806856 - in /directory/shared/branches/shared-schema/ldap/src: main/java/org/apache/directory/shared/ldap/schema/parsers/ test/java/org/apache/directory/shared/ldap/schema/syntax/parser/
Date Sat, 22 Aug 2009 14:10:04 GMT
Author: elecharny
Date: Sat Aug 22 14:10:04 2009
New Revision: 806856

URL: http://svn.apache.org/viewvc?rev=806856&view=rev
Log:
o Modified the LdapSyntax parser and description classes
o Renamed the ComparatorDescriptionSchemaParser class to LdapComparator...

Added:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapComparatorDescriptionSchemaParser.java
      - copied, changed from r806826, directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ComparatorDescriptionSchemaParser.java
Removed:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ComparatorDescriptionSchemaParser.java
Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescription.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java

Copied: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapComparatorDescriptionSchemaParser.java
(from r806826, directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ComparatorDescriptionSchemaParser.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapComparatorDescriptionSchemaParser.java?p2=directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapComparatorDescriptionSchemaParser.java&p1=directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ComparatorDescriptionSchemaParser.java&r1=806826&r2=806856&rev=806856&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ComparatorDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapComparatorDescriptionSchemaParser.java
Sat Aug 22 14:10:04 2009
@@ -36,15 +36,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ComparatorDescriptionSchemaParser extends AbstractSchemaParser
+public class LdapComparatorDescriptionSchemaParser extends AbstractSchemaParser
 {
     /** The LoggerFactory used by this class */
-    protected static final Logger LOG = LoggerFactory.getLogger( ComparatorDescriptionSchemaParser.class
);
+    protected static final Logger LOG = LoggerFactory.getLogger( LdapComparatorDescriptionSchemaParser.class
);
 
     /**
      * Creates a schema parser instance.
      */
-    public ComparatorDescriptionSchemaParser()
+    public LdapComparatorDescriptionSchemaParser()
     {
         super();
     }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescription.java?rev=806856&r1=806855&r2=806856&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescription.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescription.java
Sat Aug 22 14:10:04 2009
@@ -21,8 +21,8 @@
 package org.apache.directory.shared.ldap.schema.parsers;
 
 
-import java.util.LinkedHashMap;
-import java.util.List;
+import org.apache.directory.shared.ldap.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.schema.SchemaObjectType;
 
 
 /**
@@ -31,37 +31,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LdapSyntaxDescription extends AbstractSchemaDescription
+public class LdapSyntaxDescription extends LoadableSchemaObject
 {
-    /**
-     * Creates a new instance of LdapSyntaxDescription with empty string values.
-     */
-    public LdapSyntaxDescription()
-    {
-        this.numericOid = "";
-        description = "";
-        extensions = new LinkedHashMap<String, List<String>>();
-    }
-
+    /** The serialVersionUID */
+    private static final long serialVersionUID = 1L;
 
     /**
-     * LDAP Syntax Descriptions do not support the OBSOLETE keyword.
-     * 
-     * @throws UnsupportedOperationException every time
-     */
-    public boolean isObsolete()
-    {
-        throw new UnsupportedOperationException( "Not supported by LdapSyntaxDescription"
);
-    }
-
-
-    /**
-     * LDAP Syntax Descriptions do not support the OBSOLETE keyword.
-     * 
-     * @throws UnsupportedOperationException every time
+     * Creates a new instance of LdapSyntaxDescription with empty string values.
      */
-    public void setObsolete( boolean isObsolete )
+    public LdapSyntaxDescription( String oid )
     {
-        throw new UnsupportedOperationException( "Not supported by LdapSyntaxDescription"
);
+        super(  SchemaObjectType.LDAP_SYNTAX, oid );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=806856&r1=806855&r2=806856&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
Sat Aug 22 14:10:04 2009
@@ -22,6 +22,9 @@
 
 import java.text.ParseException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -35,6 +38,8 @@
  */
 public class LdapSyntaxDescriptionSchemaParser extends AbstractSchemaParser
 {
+    /** The LoggerFactory used by this class */
+    protected static final Logger LOG = LoggerFactory.getLogger( LdapSyntaxDescriptionSchemaParser.class
);
 
     /**
      * Creates a schema parser instance.
@@ -64,6 +69,7 @@
 
         if ( ldapSyntaxDescription == null )
         {
+            LOG.error( "Cannot parse a null LdapSyntax" );
             throw new ParseException( "Null", 0 );
         }
 
@@ -76,24 +82,30 @@
         }
         catch ( RecognitionException re )
         {
-            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription;
-            msg += "\nAntlr message: " + re.getMessage();
-            msg += "\nAntlr column: " + re.getColumn();
+            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription
+
+                "\nAntlr message: " + re.getMessage() +
+                "\nAntlr column: " + re.getColumn();
+            LOG.error( msg );
             throw new ParseException( msg, re.getColumn() );
         }
         catch ( TokenStreamException tse )
         {
-            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription;
-            msg += "\nAntlr message: " + tse.getMessage();
+            String msg = "Parser failure on LDAP syntay description:\n\t" + ldapSyntaxDescription
+
+                "\nAntlr message: " + tse.getMessage();
+            LOG.error(  msg  );
             throw new ParseException( msg, 0 );
         }
-
     }
 
 
-    public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+    /**
+     * Parses a LdapSyntax description
+     * 
+     * @param The LdapSyntax description to parse
+     * @return An instance of LdapSyntaxDescription
+     */
+    public LdapSyntaxDescription parse( String schemaDescription ) throws ParseException
     {
         return parseLdapSyntaxDescription( schemaDescription );
     }
-
 }

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java?rev=806856&r1=806855&r2=806856&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
Sat Aug 22 14:10:04 2009
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.ComparatorDescriptionSchemaParser;
+import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
 import org.junit.After;
 import org.junit.Before;
@@ -39,13 +39,13 @@
 public class ComparatorDescriptionSchemaParserTest
 {
     /** the parser instance */
-    private ComparatorDescriptionSchemaParser parser;
+    private LdapComparatorDescriptionSchemaParser parser;
 
 
     @Before
     public void setUp() throws Exception
     {
-        parser = new ComparatorDescriptionSchemaParser();
+        parser = new LdapComparatorDescriptionSchemaParser();
     }
 
 



Mime
View raw message