org.apache.directory.api.ldap.model.schema.parsers
Class AbstractSchemaParser

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

public abstract class AbstractSchemaParser
extends Object

TODO AbstractSchemaParser.

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()
          Instantiates a new abstract schema parser.
 
Method Summary
 boolean isQuirksMode()
          Checks if quirks mode is enabled.
abstract  SchemaObject parse(String schemaDescription)
          Parse a SchemaObject description and returns back an instance of SchemaObject.
protected  void reset(String spec)
          Initializes the plumbing by creating a pipe and coupling the parser/lexer pair with it.
 void setParserMonitor(ParserMonitor parserMonitor)
          Sets the parser monitor.
 void setQuirksMode(boolean enabled)
          Sets the quirks mode.
protected static void updateSchemaName(SchemaObject schemaObject)
          Update the schemaName for the given 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()
Instantiates a new abstract schema parser.

Method Detail

reset

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

Parameters:
spec - the spec

setParserMonitor

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

Parameters:
parserMonitor - 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(String schemaDescription)
                            throws ParseException
Parse a SchemaObject description and returns back an instance of SchemaObject.

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

updateSchemaName

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

Parameters:
schemaObject - the schema object where the name should be updated


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.