You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/08/24 08:38:06 UTC
svn commit: r807099 - in
/directory/shared/branches/shared-schema/ldap/src/main: antlr/
java/org/apache/directory/shared/ldap/schema/parsers/
Author: elecharny
Date: Mon Aug 24 06:38:06 2009
New Revision: 807099
URL: http://svn.apache.org/viewvc?rev=807099&view=rev
Log:
Fixed the MatchingRuleUse set of classes, and fixed typoes in the MatchingRule classes
Modified:
directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescription.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescription.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
Modified: directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g?rev=807099&r1=807098&r2=807099&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/antlr/schema.g Mon Aug 24 06:38:06 2009
@@ -562,13 +562,13 @@
* extensions WSP RPAREN ; extensions
* </pre>
*/
-matchingRuleUseDescription returns [MatchingRuleUseDescription mrud = new MatchingRuleUseDescription()]
+matchingRuleUseDescription returns [MatchingRuleUseDescription mrud]
{
matchedProduction( "matchingRuleUseDescription()" );
ElementTracker et = new ElementTracker();
}
:
- ( oid:STARTNUMERICOID { mrud.setNumericOid(numericoid(oid.getText())); } )
+ ( oid:STARTNUMERICOID { mrud = new MatchingRuleUseDescription(numericoid(oid.getText())); } )
(
( name:NAME { et.track("NAME", name); mrud.setNames(qdescrs(name.getText())); } )
|
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescription.java?rev=807099&r1=807098&r2=807099&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescription.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescription.java Mon Aug 24 06:38:06 2009
@@ -39,7 +39,7 @@
private String syntax;
/**
- * Creates a new instance of MatcfhingRuleDescription
+ * Creates a new instance of MatchingRuleDescription
*/
public MatchingRuleDescription( String oid )
{
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java?rev=807099&r1=807098&r2=807099&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleDescriptionSchemaParser.java Mon Aug 24 06:38:06 2009
@@ -105,10 +105,10 @@
/**
- * Parses a MatchingRul description
+ * Parses a MatchingRule description
*
- * @param The MatchingRul description to parse
- * @return An instance of MatchingRulDescription
+ * @param The MatchingRule description to parse
+ * @return An instance of MatchingRuleDescription
*/
public MatchingRuleDescription parse( String schemaDescription ) throws ParseException
{
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescription.java?rev=807099&r1=807098&r2=807099&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescription.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescription.java Mon Aug 24 06:38:06 2009
@@ -21,10 +21,11 @@
package org.apache.directory.shared.ldap.schema.parsers;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
import java.util.List;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.shared.ldap.schema.SchemaObjectType;
+
/**
* RFC 4512 - 4.1.4. Matching Rule Use Description
@@ -32,31 +33,40 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class MatchingRuleUseDescription extends AbstractSchemaDescription
+public class MatchingRuleUseDescription extends SchemaObject
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /** The list of attributes types the matching rule applies to */
private List<String> applicableAttributes;
- public MatchingRuleUseDescription()
+ /**
+ * Creates a new instance of MatchingRuleUseDescription
+ */
+ public MatchingRuleUseDescription( String oid )
{
- numericOid = "";
- names = new ArrayList<String>();
- description = "";
- isObsolete = false;
- applicableAttributes = new ArrayList<String>();
- extensions = new LinkedHashMap<String, List<String>>();
+ super( SchemaObjectType.MATCHING_RULE_USE, oid );
}
+
-
+ /**
+ * @return The matchingRule's list of Attribute types the MRU applies to
+ */
public List<String> getApplicableAttributes()
{
return applicableAttributes;
}
+ /**
+ * Set the matchingRule's Attribute types the MRU applies to. description
+ *
+ * @param applicableAttributes The Attribute types list
+ */
public void setApplicableAttributes( List<String> applicableAttributes )
{
this.applicableAttributes = applicableAttributes;
}
-
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java?rev=807099&r1=807098&r2=807099&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/MatchingRuleUseDescriptionSchemaParser.java Mon Aug 24 06:38:06 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,9 @@
*/
public class MatchingRuleUseDescriptionSchemaParser extends AbstractSchemaParser
{
+ /** The LoggerFactory used by this class */
+ protected static final Logger LOG = LoggerFactory.getLogger( MatchingRuleUseDescriptionSchemaParser.class );
+
/**
* Creates a schema parser instance.
@@ -70,6 +76,7 @@
if ( matchingRuleUseDescription == null )
{
+ LOG.error( "Cannot parse a null MatchingRuleUse" );
throw new ParseException( "Null", 0 );
}
@@ -82,24 +89,31 @@
}
catch ( RecognitionException re )
{
- String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription;
- msg += "\nAntlr message: " + re.getMessage();
- msg += "\nAntlr column: " + re.getColumn();
+ String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription +
+ "\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 matching rule description:\n\t" + matchingRuleUseDescription;
- msg += "\nAntlr message: " + tse.getMessage();
+ String msg = "Parser failure on matching rule description:\n\t" + matchingRuleUseDescription +
+ "\nAntlr message: " + tse.getMessage();
+ LOG.error( msg );
throw new ParseException( msg, 0 );
}
}
- public AbstractSchemaDescription parse( String schemaDescription ) throws ParseException
+ /**
+ * Parses a MatchingRuleUse description
+ *
+ * @param The MatchingRuleUse description to parse
+ * @return An instance of MatchingRuleUseDescription
+ */
+ public MatchingRuleUseDescription parse( String schemaDescription ) throws ParseException
{
return parseMatchingRuleUseDescription( schemaDescription );
}
-
}