org.apache.directory.shared.ldap.schema.parsers
Class AbstractSchemaParser

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaParser
Direct Known Subclasses:
AttributeTypeDescriptionSchemaParser, DITContentRuleDescriptionSchemaParser, DITStructureRuleDescriptionSchemaParser, LdapComparatorDescriptionSchemaParser, LdapSyntaxDescriptionSchemaParser, MatchingRuleDescriptionSchemaParser, MatchingRuleUseDescriptionSchemaParser, NameFormDescriptionSchemaParser, NormalizerDescriptionSchemaParser, ObjectClassDescriptionSchemaParser, OpenLdapSchemaParser, SyntaxCheckerDescriptionSchemaParser

public abstract class AbstractSchemaParser
extends java.lang.Object

TODO AbstractSchemaParser.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
protected  ReusableAntlrSchemaLexer lexer
          the antlr generated lexer being wrapped
protected  ParserMonitor monitor
          the monitor to use for this parser
protected  ReusableAntlrSchemaParser parser
          the antlr generated parser being wrapped
 
Constructor Summary
protected AbstractSchemaParser()
           
 
Method Summary
 boolean isQuirksMode()
          Checks if quirks mode is enabled.
abstract  SchemaObject parse(java.lang.String schemaDescription)
          Parse a SchemaObject description and returns back an instance of SchemaObject.
protected  void reset(java.lang.String spec)
          Initializes the plumbing by creating a pipe and coupling the parser/lexer pair with it.
 void setParserMonitor(ParserMonitor monitor)
          Sets the parser monitor.
 void setQuirksMode(boolean enabled)
          Sets the quirks mode.
protected  void setSchemaName(SchemaObject schemaObject)
          Update the schemaName for this SchemaObject, accordingly to the X-SCHEMA parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitor

protected ParserMonitor monitor
the monitor to use for this parser


parser

protected ReusableAntlrSchemaParser parser
the antlr generated parser being wrapped


lexer

protected ReusableAntlrSchemaLexer lexer
the antlr generated lexer being wrapped

Constructor Detail

AbstractSchemaParser

protected AbstractSchemaParser()
Method Detail

reset

protected void reset(java.lang.String spec)
Initializes the plumbing by creating a pipe and coupling the parser/lexer pair with it. param spec the specification to be parsed


setParserMonitor

public void setParserMonitor(ParserMonitor monitor)
Sets the parser monitor.

Parameters:
monitor - the new parser monitor

setQuirksMode

public void setQuirksMode(boolean enabled)
Sets the quirks mode. If enabled the parser accepts non-numeric OIDs and some special characters in descriptions.

Parameters:
enabled - the new quirks mode

isQuirksMode

public boolean isQuirksMode()
Checks if quirks mode is enabled.

Returns:
true, if is quirks mode is enabled

parse

public abstract SchemaObject parse(java.lang.String schemaDescription)
                            throws java.text.ParseException
Parse a SchemaObject description and returns back an instance of SchemaObject.

Parameters:
schemaDescription - The SchemaObject description
Returns:
A SchemaObject instance
Throws:
java.text.ParseException - If the parsing failed

setSchemaName

protected void setSchemaName(SchemaObject schemaObject)
Update the schemaName for this SchemaObject, accordingly to the X-SCHEMA parameter. If not present, default to 'other'



Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.