Class SubtreeSpecificationParser
java.lang.Object
org.apache.directory.api.ldap.model.subtree.SubtreeSpecificationParser
A LDAP subtree parser base on the specification as defined by
RFC 3672.
The parsed grammar is:
subtreeSpecification = OPEN_CURLY ( SP )*
( subtreeSpecificationComponent ( SP )*
( SEP ( SP )* subtreeSpecificationComponent ( SP )* )*
)?
CLOSE_CURLY
subtreeSpecificationComponent = ss_base | ss_specificExclusions | ss_minimum | ss_maximum | ss_specificationFilter
ss_base = ID_base ( SP )+ distinguishedName
ss_specificExclusions = ID_specificExclusions ( SP )+ specificExclusions
specificExclusions = OPEN_CURLY ( SP )*
( specificExclusion ( SP )*
( SEP ( SP )* specificExclusion ( SP )* )*
)?
CLOSE_CURLY
specificExclusion = chopBefore | chopAfter
chopBefore = ID_chopBefore ( SP )* COLON ( SP )* distinguishedName
chopAfter = ID_chopAfter ( SP )* COLON ( SP )* distinguishedName
ss_minimum = ID_minimum ( SP )+ INTEGER
ss_maximum = ID_maximum ( SP )+ INTEGER
ss_specificationFilter = ID_specificationFilter ( SP )+ ( refinement [| FILTER] )
refinements = OPEN_CURLY ( SP )*
(
refinement ( SP )* ( SEP ( SP )* refinement ( SP )* )*
)?
CLOSE_CURLY
refinement = item | and | or | not
item = ID_item ( SP )* COLON ( SP )* oid
and = ID_and ( SP )* COLON ( SP )* refinements
or = ID_or ( SP )* COLON ( SP )* refinements
not = ID_not ( SP )* COLON ( SP )* refinement
[FILTER = '(' ( '&' (SP)* FILTER+ | '|' (SP)* FILTER+ | '!' (SP)* FILTER | FILTER_VALUE ) ')' (SP)*
FILTER_VALUE = every char but '(', ')', '&', '|', '!']
Note: the 'filter' part is not present in RFC 3672- Author:
- Apache Directory Project
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSubtreeSpecificationParser(NormalizerMappingResolver resolver, SchemaManager schemaManager) Creates a normalizing subtree specification parser.SubtreeSpecificationParser(SchemaManager schemaManager) Creates a subtree specification parser. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck a subtree specificationbooleanTests to see if this parser is normalizing.Parses a subtree specification
-
Constructor Details
-
SubtreeSpecificationParser
Creates a subtree specification parser.- Parameters:
schemaManager- The SchemaManager
-
SubtreeSpecificationParser
Creates a normalizing subtree specification parser.- Parameters:
resolver- The resolver to useschemaManager- The SchemaManager
-
-
Method Details
-
parse
Parses a subtree specification- Parameters:
spec- the specification to be parsed- Returns:
- the specification bean
- Throws:
ParseException- if there are any recognition errors (bad syntax)
-
check
Check a subtree specification- Parameters:
spec- the specification to be checked- Returns:
trueif the subtree specification is valid,falseotherwise
-
isNormilizing
public boolean isNormilizing()Tests to see if this parser is normalizing.- Returns:
- true if it normalizes false otherwise
-