Class TriggerSpecificationParser
- java.lang.Object
-
- org.apache.directory.api.ldap.trigger.TriggerSpecificationParser
-
public class TriggerSpecificationParser extends Object
A reusable wrapper around the ANTLR generated parser for a TriggerSpecification. This class enables the reuse of the antlr parser/lexer pair without having to recreate them every time.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisNormalizingprivate ReusableAntlrTriggerSpecificationLexerlexerthe antlr generated lexer being wrappedprivate ReusableAntlrTriggerSpecificationParserparserthe antlr generated parser being wrapped
-
Constructor Summary
Constructors Constructor Description TriggerSpecificationParser()Creates a TriggerSpecification parser.TriggerSpecificationParser(org.apache.directory.api.ldap.model.schema.NormalizerMappingResolver<org.apache.directory.api.ldap.model.schema.Normalizer> resolver)Creates a normalizing TriggerSpecification parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisNormizing()Tests to see if this parser is normalizing.TriggerSpecificationparse(String spec)Parses an TriggerSpecification without exhausting the parser.private voidreset(String spec)Initializes the plumbing by creating a pipe and coupling the parser/lexer pair with it.
-
-
-
Field Detail
-
parser
private ReusableAntlrTriggerSpecificationParser parser
the antlr generated parser being wrapped
-
lexer
private ReusableAntlrTriggerSpecificationLexer lexer
the antlr generated lexer being wrapped
-
isNormalizing
private final boolean isNormalizing
-
-
Constructor Detail
-
TriggerSpecificationParser
public TriggerSpecificationParser()
Creates a TriggerSpecification parser.
-
TriggerSpecificationParser
public TriggerSpecificationParser(org.apache.directory.api.ldap.model.schema.NormalizerMappingResolver<org.apache.directory.api.ldap.model.schema.Normalizer> resolver)
Creates a normalizing TriggerSpecification parser.- Parameters:
resolver- the resolver
-
-
Method Detail
-
reset
private void reset(String spec)
Initializes the plumbing by creating a pipe and coupling the parser/lexer pair with it.- Parameters:
spec- the specification to be parsed
-
parse
public TriggerSpecification parse(String spec) throws ParseException
Parses an TriggerSpecification without exhausting the parser.- Parameters:
spec- the specification to be parsed- Returns:
- the specification bean
- Throws:
ParseException- if there are any recognition errors (bad syntax)
-
isNormizing
public boolean isNormizing()
Tests to see if this parser is normalizing.- Returns:
- true if it normalizes false otherwise
-
-