public class OpenLdapSchemaParser extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
OpenLdapSchemaParser.AttributeTypeElements
The list of AttributeTypeDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.DitContentRuleElements
The list of DitContentRuleDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.DitStructureRuleElements
The list of DitStructureRuleDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.LdapComparatorElements
The list of LdapComparatorDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.LdapSyntaxElements
The list of LdapSyntaxDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.MatchingRuleElements
The list of MatchingRuleDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.MatchingRuleUseElements
The list of MatchingRuleUseDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.NameFormElements
The list of NameFormDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.NormalizerElements
The list of NormalizerDescription elements that can be seen
|
private static class |
OpenLdapSchemaParser.ObjectClassElements
The list of ObjectClassDescription elements that can be seen
|
private class |
OpenLdapSchemaParser.PosSchema |
private static interface |
OpenLdapSchemaParser.SchemaObjectElements |
private static class |
OpenLdapSchemaParser.SyntaxCheckerElements
The list of SyntaxCheckerDescription elements that can be seen
|
| Modifier and Type | Field and Description |
|---|---|
private static String |
ABSTRACT_STR |
private static String |
APPLIES_STR
Some contant strings used in descriptions
|
private List<AttributeType> |
attributeTypes
The list of attribute type, initialized by splitParsedSchemaDescriptions()
|
private static String |
AUX_STR |
private static String |
AUXILIARY_STR |
private static String |
BYTECODE_STR |
private static String |
COLLECTIVE_STR |
private static char |
COLON
Tokens
|
private static String |
DESC_STR |
private static String |
DIRECTORY_OPERATION_STR
Usage
|
private static String |
DISTRIBUTED_OPERATION_STR |
private static char |
DOLLAR |
private static char |
DOT |
private static char |
DQUOTE |
private static String |
DSA_OPERATION_STR |
private static char |
EQUAL |
private static String |
EQUALITY_STR |
private static char |
ESCAPE |
private static String |
EXTENSION_PREFIX |
private static String |
FORM_STR |
private static String |
FQCN_STR |
private static char |
HYPHEN |
private boolean |
isQuirksModeEnabled
A flag used to tell the parser if it should be strict or not
|
private boolean |
isResolveObjectIdentifierMacros
Flag whether object identifier macros should be resolved.
|
private static char |
LBRACE |
protected int |
lineNumber
the number of the current line being parsed by the reader
|
protected static org.slf4j.Logger |
LOG
The LoggerFactory used by this class
|
private static char |
LPAREN |
private static String |
MAY_STR |
private static String |
MUST_STR |
private static String |
NAME_STR |
private static String |
NO_USER_MODIFICATION_STR |
private static String |
NOT_STR |
private List<ObjectClass> |
objectClasses
The list of object classes, initialized by splitParsedSchemaDescriptions()
|
private Map<String,OpenLdapObjectIdentifierMacro> |
objectIdentifierMacros
The map of object identifier macros, initialized by splitParsedSchemaDescriptions()
|
private static String |
OBSOLETE_STR |
private static String |
OC_STR |
private static String |
ORDERING_STR |
private static char |
PLUS |
private static char |
RBRACE |
private static boolean |
RELAXED |
private static char |
RPAREN |
private List<Object> |
schemaDescriptions
The list of parsed schema descriptions
|
private static char |
SEMI_COLON |
private static char |
SHARP |
private static String |
SINGLE_VALUE_STR |
private static char |
SLASH |
private static char |
SQUOTE |
private static boolean |
STRICT
Flag for strict or relaxed mode
|
private static String |
STRUCTURAL_STR |
private static String |
SUBSTR_STR |
private static String |
SUP_STR |
private static String |
SYNTAX_STR |
private static boolean |
UN_QUOTED |
private static char |
UNDERSCORE |
private static String |
USAGE_STR |
private static String |
USER_APPLICATIONS_STR |
| Constructor and Description |
|---|
OpenLdapSchemaParser()
Creates a reusable instance of an OpenLdapSchemaParser.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
afterParse()
Splits parsed schema descriptions and resolved
object identifier macros.
|
private static int |
checkElement(int elementsSeen,
OpenLdapSchemaParser.SchemaObjectElements element,
OpenLdapSchemaParser.PosSchema pos) |
void |
clear()
Reset the parser
|
List<AttributeType> |
getAttributeTypes()
Gets the attribute types.
|
private static String |
getByteCode(OpenLdapSchemaParser.PosSchema pos)
A base64 string
byteCode ::= ( [a-z] | [A-Z] | [0-9] | '+' | '/' | '=' )*
|
private static String |
getDescrRelaxed(OpenLdapSchemaParser.PosSchema pos)
In quirksMode :
descr ::= descrQ (COLON numericoid)
descrQ ::= keystringQ
keystringQ ::= LkeycharQ keycharQ*
LkeycharQ ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keycharQ ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
|
private static String |
getDescrStrict(OpenLdapSchemaParser.PosSchema pos)
In strict mode :
descr ::= keystring
keystring ::= leadkeychar keychar*
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
numericoid ::= number ( DOT number )+ |
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
|
private static String |
getFqcn(OpenLdapSchemaParser.PosSchema pos)
A FQCN
FQCN ::= FQCN_IDENTIFIER ( '.'
|
private static void |
getLine(Reader reader,
OpenLdapSchemaParser.PosSchema pos) |
private String |
getMacro(OpenLdapSchemaParser.PosSchema pos) |
private static void |
getNoidLenRelaxed(AttributeType attributeType,
OpenLdapSchemaParser.PosSchema pos)
noidlen = oidRelaxed [ LCURLY len RCURLY ]
|
private static void |
getNoidLenStrict(AttributeType attributeType,
OpenLdapSchemaParser.PosSchema pos)
noidlen = oidStrict [ LCURLY len RCURLY ]
|
private static String |
getNumericOid(OpenLdapSchemaParser.PosSchema pos)
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
|
List<ObjectClass> |
getObjectClasses()
Gets the object class types.
|
Map<String,OpenLdapObjectIdentifierMacro> |
getObjectIdentifierMacros()
Gets the object identifier macros.
|
private static String |
getOidAndMacroRelaxed(OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
In relaxed mode :
oid ::= descr | numericoid
descr ::= descrQ (COLON numericoid)
descrQ ::= keystringQ
keystringQ ::= LkeycharQ keycharQ*
LkeycharQ ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keycharQ ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
|
private static String |
getOidRelaxed(OpenLdapSchemaParser.PosSchema pos,
boolean hadQuote)
In quirks mode :
oid ::= descr-relaxed | numericoid | SQUOTE descr-relaxed SQUOTE |
DQUOTE descr-relaxed DQUOTE | SQUOTE numericoid SQUOTE |
DQUOTE numericoid DQUOTE
descr-relaxed::= macro (COLON numericoid)
macro ::= keystring
keystring ::= Lkeychar keychar*
Lkeychar ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
|
private static List<String> |
getOidsRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
oids ::= oid | ( LPAREN WSP oidlist WSP RPAREN )
oidlist ::= oid *( WSP DOLLAR WSP oid )
|
private static List<String> |
getOidsStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
oids ::= oid | ( LPAREN WSP oidlist WSP RPAREN )
oidlist ::= oid *( WSP DOLLAR WSP oid )
|
private static String |
getOidStrict(OpenLdapSchemaParser.PosSchema pos)
In normal mode :
oid ::= descr | numericoid
descr ::= keystring
keystring ::= leadkeychar keychar*
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
numericoid ::= number ( DOT number )+ |
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
|
private static String |
getPartialNumericOid(OpenLdapSchemaParser.PosSchema pos)
partialNumericoid ::= number ( DOT number )*
number ::= DIGIT | LDIGIT DIGIT+
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
|
private static String |
getQDescrRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
qdescr ::== SQUOTE descr SQUOTE
descr ::= keystring
keystring ::= leadkeychar *keychar
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
In quirksMode :
qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE
descr ::= keystring
keystring ::= keychar+
keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
|
private static List<String> |
getQDescrs(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
boolean relaxed)
qdescrs ::= qdescr | LPAREN WSP qdescrlist WSP RPAREN
qdescrlist ::= [ qdescr *( SP qdescr ) ]
qdescr ::== SQUOTE descr SQUOTE
descr ::= keystring
keystring ::= leadkeychar *keychar
leadkeychar ::= ALPHA
keychar ::= ALPHA / DIGIT / HYPHEN
|
private static String |
getQDescrStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
qdescr ::== SQUOTE descr SQUOTE
descr ::= keystring
keystring ::= leadkeychar *keychar
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
In quirksMode :
qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE
descr ::= keystring
keystring ::= keychar+
keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
|
private static String |
getQDString(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
No relaxed version.
|
private static List<String> |
getQDStrings(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
qdstrings ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN )
qdstringlist ::= qdstring *( SP qdstring )*
qdstring ::= SQUOTE dstring SQUOTE
dstring ::= 1*( QS / QQ / QUTF8 ) ; escaped UTF-8 string
|
private String |
getResolveOid(String oid)
Return a complete OID from a macro followed by an OID.
|
private static int |
getRuleId(OpenLdapSchemaParser.PosSchema pos)
ruleid ::= number
number ::= DIGIT | LDIGIT DIGIT+
DIGIT ::= [0-9]
LDIGIT ::= [1-9]
|
private static List<Integer> |
getRuleIds(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
ruleids ::= ruleid | ( LPAREN WSP ruleidlist WSP RPAREN )
ruleidlist ::= ruleid ( SP ruleid )*
|
private static UsageEnum |
getUsageRelaxed(OpenLdapSchemaParser.PosSchema pos) |
private static UsageEnum |
getUsageStrict(OpenLdapSchemaParser.PosSchema pos) |
private static String |
getXString(OpenLdapSchemaParser.PosSchema pos)
xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+
|
private static boolean |
isAlpha(OpenLdapSchemaParser.PosSchema pos) |
private static boolean |
isComment(OpenLdapSchemaParser.PosSchema pos) |
private static boolean |
isDigit(OpenLdapSchemaParser.PosSchema pos) |
private static boolean |
isEmpty(OpenLdapSchemaParser.PosSchema pos) |
boolean |
isQuirksMode()
Checks if quirks mode is enabled.
|
boolean |
isResolveObjectIdentifierMacros()
Checks if object identifier macros should be resolved.
|
void |
parse(File schemaFile)
Parses a file of OpenLDAP schemaObject elements/objects.
|
void |
parse(InputStream schemaIn)
Parses a stream of OpenLDAP schemaObject elements/objects.
|
void |
parse(Reader reader)
Reads an entry in a ldif buffer, and returns the resulting lines, without
comments, and unfolded.
|
SchemaObject |
parse(String schemaObject)
Parses an OpenLDAP schemaObject element/object.
|
AttributeType |
parseAttributeType(String attributeTypeDescription)
Production for matching attribute type descriptions.
|
private static AttributeType |
parseAttributeTypeRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching attribute type descriptions.
|
private static AttributeType |
parseAttributeTypeStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching attribute type descriptions.
|
DitContentRule |
parseDitContentRule(String ditContentRuleDescription)
Production for matching DitContentRule descriptions.
|
private static DitContentRule |
parseDitContentRuleRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for DitContentRule descriptions.
|
private static DitContentRule |
parseDitContentRuleStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for DitContentRule descriptions.
|
DitStructureRule |
parseDitStructureRule(String ditStructureRuleDescription)
Production for matching DitStructureRule descriptions.
|
private static DitStructureRule |
parseDitStructureRuleRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for DitStructureRule descriptions.
|
private static DitStructureRule |
parseDitStructureRuleStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
Production for DitStructureRule descriptions.
|
LdapComparatorDescription |
parseLdapComparator(String ldapComparatorDescription)
Production for LdapComparator descriptions.
|
private static LdapComparatorDescription |
parseLdapComparatorRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for LdapComparator descriptions.
|
private static LdapComparatorDescription |
parseLdapComparatorStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for LdapComparator descriptions.
|
LdapSyntax |
parseLdapSyntax(String ldapSyntaxDescription)
Production for matching ldap syntax descriptions.
|
private static LdapSyntax |
parseLdapSyntaxRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching ldap syntax descriptions.
|
private static LdapSyntax |
parseLdapSyntaxStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching ldap syntax descriptions.
|
MatchingRule |
parseMatchingRule(String matchingRuleDescription)
Production for matching MatchingRule descriptions.
|
private static MatchingRule |
parseMatchingRuleRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching rule descriptions.
|
private static MatchingRule |
parseMatchingRuleStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching rule descriptions.
|
MatchingRuleUse |
parseMatchingRuleUse(String matchingRuleUseDescription)
Production for matching MatchingRuleUse descriptions.
|
private static MatchingRuleUse |
parseMatchingRuleUseRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for MatchingRuleUse descriptions.
|
private static MatchingRuleUse |
parseMatchingRuleUseStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for MatchingRuleUse descriptions.
|
NameForm |
parseNameForm(String nameFormDescription)
Production for NameForm descriptions.
|
private static NameForm |
parseNameFormRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for NameForm descriptions.
|
private static NameForm |
parseNameFormStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for NameForm descriptions.
|
NormalizerDescription |
parseNormalizer(String normalizerDescription)
Production for Normalizer descriptions.
|
private static NormalizerDescription |
parseNormalizerRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for Normalizer descriptions.
|
private static NormalizerDescription |
parseNormalizerStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for Normalizer descriptions.
|
ObjectClass |
parseObjectClass(String objectClassDescription)
Production for matching ObjectClass descriptions.
|
private static ObjectClass |
parseObjectClassRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching ObjectClass descriptions.
|
private static ObjectClass |
parseObjectClassStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for matching ObjectClass descriptions.
|
SyntaxCheckerDescription |
parseSyntaxChecker(String syntaxCheckerDescription)
Production for SyntaxChecker descriptions.
|
private static SyntaxCheckerDescription |
parseSyntaxCheckerRelaxed(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for SyntaxChecker descriptions.
|
private static SyntaxCheckerDescription |
parseSyntaxCheckerStrict(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
Production for SyntaxChecker descriptions.
|
private static void |
processExtension(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
SchemaObject schemaObject)
extension ::= xstring SP qdstrings
xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+
qdstrings ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN )
qdstringlist ::= qdstring *( SP qdstring )*
qdstring ::= SQUOTE dstring SQUOTE
dstring ::= 1*( QS / QQ / QUTF8 ) ; escaped UTF-8 string
|
private void |
processObjectIdentifier(Reader reader,
OpenLdapSchemaParser.PosSchema pos)
Process OpenLDAP macros, like : objectidentifier DUAConfSchemaOID 1.3.6.1.4.1.11.1.3.1.
|
private void |
resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro)
Find the proper OID from a OID which may contain a macro
|
void |
setQuirksMode(boolean enabled)
Sets the quirks mode.
|
void |
setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
Sets if object identifier macros should be resolved.
|
private static void |
skipWhites(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
boolean mandatory) |
private static boolean |
startsWith(OpenLdapSchemaParser.PosSchema pos,
char c) |
private static boolean |
startsWith(OpenLdapSchemaParser.PosSchema pos,
String text) |
private static boolean |
startsWith(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
char c)
Check if the stream starts with a given char at a given position
|
private static boolean |
startsWith(Reader reader,
OpenLdapSchemaParser.PosSchema pos,
char c,
boolean quoted)
Check if the stream at the given position starts with a given char
|
protected static final org.slf4j.Logger LOG
private boolean isQuirksModeEnabled
protected int lineNumber
private List<AttributeType> attributeTypes
private List<ObjectClass> objectClasses
private Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros
private static final String APPLIES_STR
private static final String ABSTRACT_STR
private static final String AUX_STR
private static final String AUXILIARY_STR
private static final String BYTECODE_STR
private static final String COLLECTIVE_STR
private static final String DESC_STR
private static final String EQUALITY_STR
private static final String FORM_STR
private static final String FQCN_STR
private static final String MAY_STR
private static final String MUST_STR
private static final String NAME_STR
private static final String NO_USER_MODIFICATION_STR
private static final String NOT_STR
private static final String OBSOLETE_STR
private static final String OC_STR
private static final String ORDERING_STR
private static final String SINGLE_VALUE_STR
private static final String STRUCTURAL_STR
private static final String SUBSTR_STR
private static final String SUP_STR
private static final String SYNTAX_STR
private static final String USAGE_STR
private static final String EXTENSION_PREFIX
private static final String DIRECTORY_OPERATION_STR
private static final String DISTRIBUTED_OPERATION_STR
private static final String DSA_OPERATION_STR
private static final String USER_APPLICATIONS_STR
private static final char COLON
private static final char DOLLAR
private static final char DOT
private static final char EQUAL
private static final char ESCAPE
private static final char HYPHEN
private static final char LBRACE
private static final char LPAREN
private static final char PLUS
private static final char RBRACE
private static final char RPAREN
private static final char SEMI_COLON
private static final char SHARP
private static final char SLASH
private static final char SQUOTE
private static final char UNDERSCORE
private static final char DQUOTE
private boolean isResolveObjectIdentifierMacros
private static final boolean UN_QUOTED
private static final boolean STRICT
private static final boolean RELAXED
public OpenLdapSchemaParser()
public void clear()
public List<AttributeType> getAttributeTypes()
public List<ObjectClass> getObjectClasses()
public Map<String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
private void afterParse()
throws ParseException
ParseException - the parse exceptionprivate String getResolveOid(String oid)
oid - The OID to findprivate void resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro) throws ParseException
macro - The element to resolveParseException - If teh OID is invalidpublic SchemaObject parse(String schemaObject) throws ParseException
schemaObject - the String image of a complete schema objectParseException - If the schemaObject can't be parsedpublic void parse(InputStream schemaIn) throws ParseException, LdapSchemaException, IOException
schemaIn - a stream of schema objectsParseException - If the schema can't be parsedLdapSchemaException - If there is an error in the schemaIOException - If the stream can't be readprivate static void skipWhites(Reader reader, OpenLdapSchemaParser.PosSchema pos, boolean mandatory) throws IOException, LdapSchemaException
reader - The stream readerpos - The position in the Schemamandatory - If the spaces are mandatoryIOException - If the stream can't be readLdapSchemaException - If the schema is wrongprivate static boolean isComment(OpenLdapSchemaParser.PosSchema pos)
pos - The position in the Schemaprivate static boolean isEmpty(OpenLdapSchemaParser.PosSchema pos)
pos - The position in the Schemaprivate static boolean startsWith(OpenLdapSchemaParser.PosSchema pos, String text)
pos - The position in the Schematext - The text to find at the beginning of the lineprivate static boolean startsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c) throws IOException, LdapSchemaException
reader - The stream readerpos - The position in the Schemac - The char to checkIOException - If we can't read the streamLdapSchemaException - If we have no char to readprivate static boolean startsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c, boolean quoted) throws IOException, LdapSchemaException
reader - The stream readerpos - The position in the Schemac - The char to checkquoted - true if the char is quotedIOException - If we can't read the streamLdapSchemaException - If we have no char to readprivate static boolean startsWith(OpenLdapSchemaParser.PosSchema pos, char c)
pos - The position in the Schemac - The char to find at the beginning of the lineprivate static boolean isAlpha(OpenLdapSchemaParser.PosSchema pos)
pos - The position in the Schemaprivate static boolean isDigit(OpenLdapSchemaParser.PosSchema pos)
pos - The position in the Schemaprivate static void getLine(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException
reader - The stream readerpos - The position in the SchemaIOException - If the stream can't be readprivate static String getNumericOid(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getPartialNumericOid(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
partialNumericoid ::= number ( DOT number )*
number ::= DIGIT | LDIGIT DIGIT+
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getOidAndMacroRelaxed(OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws LdapSchemaException
oid ::= descr | numericoid
descr ::= descrQ (COLON numericoid)
descrQ ::= keystringQ
keystringQ ::= LkeycharQ keycharQ*
LkeycharQ ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keycharQ ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
COLON ::= %x3A ; colon (":")
SEMI_COLON ::= %x3B ; semi-colon(";")
SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")
pos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongprivate static String getOidStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
oid ::= descr | numericoid
descr ::= keystring
keystring ::= leadkeychar keychar*
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
numericoid ::= number ( DOT number )+ |
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
HYPHEN ::= %x2D ; hyphen ("-")
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getOidRelaxed(OpenLdapSchemaParser.PosSchema pos, boolean hadQuote) throws LdapSchemaException
oid ::= descr-relaxed | numericoid | SQUOTE descr-relaxed SQUOTE |
DQUOTE descr-relaxed DQUOTE | SQUOTE numericoid SQUOTE |
DQUOTE numericoid DQUOTE
descr-relaxed::= macro (COLON numericoid)
macro ::= keystring
keystring ::= Lkeychar keychar*
Lkeychar ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
COLON ::= %x3A ; colon (":")
SEMI_COLON ::= %x3B ; semi-colon(";")
SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")
pos - The position in the SchemahadQuote - If we have had a quoteLdapSchemaException - If the schema is wrongprivate static String getDescrStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
descr ::= keystring
keystring ::= leadkeychar keychar*
leadkeychar ::= ALPHA
keychar ::= ALPHA | DIGIT | HYPHEN
numericoid ::= number ( DOT number )+ |
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
DOT ::= %x2E ; period (".")
HYPHEN ::= %x2D ; hyphen ("-")
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getDescrRelaxed(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
descr ::= descrQ (COLON numericoid)
descrQ ::= keystringQ
keystringQ ::= LkeycharQ keycharQ*
LkeycharQ ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
keycharQ ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
numericoid ::= number ( DOT number )+
number ::= DIGIT | LDIGIT DIGIT+
ALPHA ::= %x41-5A | %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT ::= %x30 | LDIGIT ; "0"-"9"
LDIGIT ::= %x31-39 ; "1"-"9"
HYPHEN ::= %x2D ; hyphen ("-")
UNDERSCORE ::= %x5F ; underscore ("_")
DOT ::= %x2E ; period (".")
COLON ::= %x3A ; colon (":")
SEMI_COLON ::= %x3B ; semi-colon(";")
SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate String getMacro(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getQDescrStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
qdescr ::== SQUOTE descr SQUOTE descr ::= keystring keystring ::= leadkeychar *keychar leadkeychar ::= ALPHA keychar ::= ALPHA | DIGIT | HYPHENIn quirksMode :
qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE descr ::= keystring keystring ::= keychar+ keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static String getQDescrRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
qdescr ::== SQUOTE descr SQUOTE descr ::= keystring keystring ::= leadkeychar *keychar leadkeychar ::= ALPHA keychar ::= ALPHA | DIGIT | HYPHENIn quirksMode :
qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE descr ::= keystring keystring ::= keychar+ keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP
reader - The stream readerpos - The position in the SchemaIOException - If the stream can't be readLdapSchemaException - If the schema is wrongprivate static String getQDString(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
qdstring ::== SQUOTE dstring SQUOTE
dstring ::= ( QS | QQ | QUTF8 )+ ; escaped UTF-8 string
QS ::= ESC %x35 ( %x43 | %x63 ) ; "\5C" | "\5c", escape char
QQ ::= ESC %x32 %x37 ; "\27", simple quote char
QUTF8 ::= QUTF1 | UTFMB
QUTF1 ::= %x00-26 | %x28-5B | %x5D-7F ; All ascii but ' and \
UTFMB ::= UTF2 | UTF3 | UTF4
UTF0 ::= %x80-BF
UTF2 ::= %xC2-DF UTF0
UTF3 ::= %xE0 %xA0-BF UTF0 | %xE1-EC UTF0 UTF0 | %xED %x80-9F UTF0 | %xEE-EF UTF0 UTF0
UTF4 ::= %xF0 %x90-BF UTF0 UTF0 | %xF1-F3 UTF0 UTF0 UTF0 | %xF4 %x80-8F UTF0 UTF0
ESC ::= %x5C ; backslash ("\")
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static List<String> getQDescrs(Reader reader, OpenLdapSchemaParser.PosSchema pos, boolean relaxed) throws LdapSchemaException, IOException
qdescrs ::= qdescr | LPAREN WSP qdescrlist WSP RPAREN qdescrlist ::= [ qdescr *( SP qdescr ) ] qdescr ::== SQUOTE descr SQUOTE descr ::= keystring keystring ::= leadkeychar *keychar leadkeychar ::= ALPHA keychar ::= ALPHA / DIGIT / HYPHEN
reader - The stream readerpos - The position in the Schemarelaxed - If the schema is to be processed in relaxed modeLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static List<String> getQDStrings(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
qdstrings ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN ) qdstringlist ::= qdstring *( SP qdstring )* qdstring ::= SQUOTE dstring SQUOTE dstring ::= 1*( QS / QQ / QUTF8 ) ; escaped UTF-8 string
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static List<String> getOidsStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
oids ::= oid | ( LPAREN WSP oidlist WSP RPAREN ) oidlist ::= oid *( WSP DOLLAR WSP oid )
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static List<String> getOidsRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
oids ::= oid | ( LPAREN WSP oidlist WSP RPAREN ) oidlist ::= oid *( WSP DOLLAR WSP oid )
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static void getNoidLenStrict(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
noidlen = oidStrict [ LCURLY len RCURLY ]
attributeType - The AttributeTypepos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static void getNoidLenRelaxed(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
noidlen = oidRelaxed [ LCURLY len RCURLY ]
attributeType - The AttributeTypepos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static int getRuleId(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
ruleid ::= number number ::= DIGIT | LDIGIT DIGIT+ DIGIT ::= [0-9] LDIGIT ::= [1-9]
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static List<Integer> getRuleIds(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
ruleids ::= ruleid | ( LPAREN WSP ruleidlist WSP RPAREN ) ruleidlist ::= ruleid ( SP ruleid )*
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static UsageEnum getUsageStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static UsageEnum getUsageRelaxed(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static void processExtension(Reader reader, OpenLdapSchemaParser.PosSchema pos, SchemaObject schemaObject) throws LdapSchemaException, IOException
extension ::= xstring SP qdstrings xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+ qdstrings ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN ) qdstringlist ::= qdstring *( SP qdstring )* qdstring ::= SQUOTE dstring SQUOTE dstring ::= 1*( QS / QQ / QUTF8 ) ; escaped UTF-8 string
reader - The stream readerpos - The position in the SchemaschemaObject - The SchemaObjectIOException - If the stream can't be readLdapSchemaException - If the schema is wrongprivate static String getXString(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getFqcn(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
FQCN ::= FQCN_IDENTIFIER ( '.' FQCN_IDENTIFIER )* FQCN_IDENTIFIER ::= ( JavaLetter ( JavaLetterOrDigit )*
pos - The position in the SchemaLdapSchemaException - If the schema is wrongprivate static String getByteCode(OpenLdapSchemaParser.PosSchema pos)
byteCode ::= ( [a-z] | [A-Z] | [0-9] | '+' | '/' | '=' )*
pos - The position in the Schemaprivate static int checkElement(int elementsSeen,
OpenLdapSchemaParser.SchemaObjectElements element,
OpenLdapSchemaParser.PosSchema pos)
throws LdapSchemaException
elementsSeen - The elements that have been processed alreadyelement - The current elementpos - T he position in the SchemaLdapSchemaException - If the schema is wrongpublic AttributeType parseAttributeType(String attributeTypeDescription) throws ParseException
AttributeTypeDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "SUP" SP oid ] ; supertype
[ SP "EQUALITY" SP oid ] ; equality matching rule
[ SP "ORDERING" SP oid ] ; ordering matching rule
[ SP "SUBSTR" SP oid ] ; substrings matching rule
[ SP "SYNTAX" SP noidlen ] ; value syntax
[ SP "SINGLE-VALUE" ] ; single-value
[ SP "COLLECTIVE" ] ; collective
[ SP "NO-USER-MODIFICATION" ] ; not user modifiable
[ SP "USAGE" SP usage ] ; usage
extensions WSP RPAREN ; extensions
usage = "userApplications" / ; user
"directoryOperation" / ; directory operational
"distributedOperation" / ; DSA-shared operational
"dSAOperation" ; DSA-specific operational
extensions = *( SP xstring SP qdstrings )
xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE )
attributeTypeDescription - The String containing the AttributeTypeDescriptionParseException - If the element was invalidprivate static AttributeType parseAttributeTypeStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
AttributeTypeDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "SUP" SP oid ] ; supertype
[ SP "EQUALITY" SP oid ] ; equality matching rule
[ SP "ORDERING" SP oid ] ; ordering matching rule
[ SP "SUBSTR" SP oid ] ; substrings matching rule
[ SP "SYNTAX" SP noidlen ] ; value syntax
[ SP "SINGLE-VALUE" ] ; single-value
[ SP "COLLECTIVE" ] ; collective
[ SP "NO-USER-MODIFICATION" ] ; not user modifiable
[ SP "USAGE" SP usage ] ; usage
extensions WSP RPAREN ; extensions
usage = "userApplications" / ; user
"directoryOperation" / ; directory operational
"distributedOperation" / ; DSA-shared operational
"dSAOperation" ; DSA-specific operational
extensions = *( SP xstring SP qdstrings )
xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE )
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosIOException - If the stream can't be readLdapSchemaException - If the schema is wrongprivate static AttributeType parseAttributeTypeRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
AttributeTypeDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "SUP" SP oid ] ; supertype
[ SP "EQUALITY" SP oid ] ; equality matching rule
[ SP "ORDERING" SP oid ] ; ordering matching rule
[ SP "SUBSTR" SP oid ] ; substrings matching rule
[ SP "SYNTAX" SP noidlen ] ; value syntax
[ SP "SINGLE-VALUE" ] ; single-value
[ SP "COLLECTIVE" ] ; collective
[ SP "NO-USER-MODIFICATION" ] ; not user modifiable
[ SP "USAGE" SP usage ] ; usage
extensions WSP RPAREN ; extensions
usage = "userApplications" / ; user
"directoryOperation" / ; directory operational
"distributedOperation" / ; DSA-shared operational
"dSAOperation" ; DSA-specific operational
extensions = *( SP xstring SP qdstrings )
xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE )
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosIOException - If the stream can't be readLdapSchemaException - If the schema is wrongpublic DitContentRule parseDitContentRule(String ditContentRuleDescription) throws ParseException
DITContentRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "AUX" SP oids ] ; auxiliary object classes
[ SP "MUST" SP oids ] ; attribute types
[ SP "MAY" SP oids ] ; attribute types
[ SP "NOT" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
ditContentRuleDescription - The String containing the DitContentRuleDescriptionParseException - If the element was invalidprivate static DitContentRule parseDitContentRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
DITContentRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "AUX" SP oids ] ; auxiliary object classes
[ SP "MUST" SP oids ] ; attribute types
[ SP "MAY" SP oids ] ; attribute types
[ SP "NOT" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static DitContentRule parseDitContentRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
DITContentRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "AUX" SP oids ] ; auxiliary object classes
[ SP "MUST" SP oids ] ; attribute types
[ SP "MAY" SP oids ] ; attribute types
[ SP "NOT" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic DitStructureRule parseDitStructureRule(String ditStructureRuleDescription) throws ParseException
DITStructureRuleDescription = LPAREN WSP ruleid ; rule identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active SP "FORM" SP oid ; NameForm [ SP "SUP" ruleids ] ; superior rules extensions WSP RPAREN ; extensions ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN ) ruleidlist = ruleid *( SP ruleid ) ruleid = number
ditStructureRuleDescription - The String containing the DitStructureRuleDescriptionParseException - If the element was invalidprivate static DitStructureRule parseDitStructureRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException, LdapSchemaException
DITStructureRuleDescription = LPAREN WSP ruleid ; rule identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active SP "FORM" SP oid ; NameForm [ SP "SUP" ruleids ] ; superior rules extensions WSP RPAREN ; extensions ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN ) ruleidlist = ruleid *( SP ruleid ) ruleid = number
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static DitStructureRule parseDitStructureRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
DITStructureRuleDescription = LPAREN WSP ruleid ; rule identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active SP "FORM" SP oid ; NameForm [ SP "SUP" ruleids ] ; superior rules extensions WSP RPAREN ; extensions ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN ) ruleidlist = ruleid *( SP ruleid ) ruleid = number
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic LdapComparatorDescription parseLdapComparator(String ldapComparatorDescription) throws ParseException
LdapComparatorDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
ldapComparatorDescription - The String containing the LdapComparatorDescriptionParseException - If the element was invalidprivate static LdapComparatorDescription parseLdapComparatorStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
LdapComparatorDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static LdapComparatorDescription parseLdapComparatorRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
LdapComparatorDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic LdapSyntax parseLdapSyntax(String ldapSyntaxDescription) throws ParseException
SyntaxDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
extensions WSP RPAREN ; extensions
ldapSyntaxDescription - The String containing the Ldap Syntax descriptionParseException - If the element was invalidprivate static LdapSyntax parseLdapSyntaxStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
SyntaxDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static LdapSyntax parseLdapSyntaxRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
SyntaxDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic MatchingRule parseMatchingRule(String matchingRuleDescription) throws ParseException
MatchingRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "SYNTAX" SP numericoid ; assertion syntax
extensions WSP RPAREN ; extensions
matchingRuleDescription - The String containing the MatchingRuledescriptionParseException - If the element was invalidprivate static MatchingRule parseMatchingRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
MatchingRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "SYNTAX" SP numericoid ; assertion syntax
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static MatchingRule parseMatchingRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
MatchingRuleDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "SYNTAX" SP numericoid ; assertion syntax
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic MatchingRuleUse parseMatchingRuleUse(String matchingRuleUseDescription) throws ParseException
MatchingRuleUseDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "APPLIES" SP oids ; attribute types
extensions WSP RPAREN ; extensions
matchingRuleUseDescription - The String containing the MatchingRuleUsedescriptionParseException - If the element was invalidprivate static MatchingRuleUse parseMatchingRuleUseStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
MatchingRuleUseDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "APPLIES" SP oids ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static MatchingRuleUse parseMatchingRuleUseRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
MatchingRuleUseDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "APPLIES" SP oids ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic NameForm parseNameForm(String nameFormDescription) throws ParseException
NameFormDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "OC" SP oid ; structural object class
SP "MUST" SP oids ; attribute types
[ SP "MAY" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
nameFormDescription - The String containing the NameFormdescriptionParseException - If the element was invalidprivate static NameForm parseNameFormStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
NameFormDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "OC" SP oid ; structural object class
SP "MUST" SP oids ; attribute types
[ SP "MAY" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static NameForm parseNameFormRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
NameFormDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
SP "OC" SP oid ; structural object class
SP "MUST" SP oids ; attribute types
[ SP "MAY" SP oids ] ; attribute types
extensions WSP RPAREN ; extensions
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic NormalizerDescription parseNormalizer(String normalizerDescription) throws ParseException
NormalizerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
normalizerDescription - The String containing the NormalizerDescriptionParseException - If the element was invalidprivate static NormalizerDescription parseNormalizerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
NormalizerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static NormalizerDescription parseNormalizerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
NormalizerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic ObjectClass parseObjectClass(String objectClassDescription) throws ParseException
ObjectClassDescription = LPAREN WSP numericoid ; object identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active [ SP "SUP" SP oids ] ; superior object classes [ SP kind ] ; kind of class [ SP "MUST" SP oids ] ; attribute types [ SP "MAY" SP oids ] ; attribute types extensions WSP RPAREN kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
objectClassDescription - The String containing the ObjectClassDescriptionParseException - If the element was invalidprivate static ObjectClass parseObjectClassStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
ObjectClassDescription = LPAREN WSP numericoid ; object identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active [ SP "SUP" SP oids ] ; superior object classes [ SP kind ] ; kind of class [ SP "MUST" SP oids ] ; attribute types [ SP "MAY" SP oids ] ; attribute types extensions WSP RPAREN kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static ObjectClass parseObjectClassRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
ObjectClassDescription = LPAREN WSP numericoid ; object identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active [ SP "SUP" SP oids ] ; superior object classes [ SP kind ] ; kind of class [ SP "MUST" SP oids ] ; attribute types [ SP "MAY" SP oids ] ; attribute types extensions WSP RPAREN kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readpublic SyntaxCheckerDescription parseSyntaxChecker(String syntaxCheckerDescription) throws ParseException
SyntaxCheckerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
syntaxCheckerDescription - The String containing the SyntaxCheckerDescriptionParseException - If the element was invalidprivate static SyntaxCheckerDescription parseSyntaxCheckerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
SyntaxCheckerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate static SyntaxCheckerDescription parseSyntaxCheckerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
SyntaxCheckerDescription = LPAREN WSP
numericoid ; object identifier
[ SP "DESC" SP qdstring ] ; description
SP "FQCN" SP fqcn ; fully qualified class name
[ SP "BYTECODE" SP base64 ] ; optional base64 encoded bytecode
extensions WSP RPAREN ; extensions
base64 = *(4base64-char)
base64-char = ALPHA / DIGIT / "+" / "/"
fqcn = fqcnComponent 1*( DOT fqcnComponent )
fqcnComponent = ???
reader - The stream readerpos - The position in the SchemaobjectIdentifierMacros - The set of existing MacrosLdapSchemaException - If the schema is wrongIOException - If the stream can't be readprivate void processObjectIdentifier(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException, LdapSchemaException
objectidentifier ::= 'objectidentifier' descr SP+ macroOid descr ::= ALPHA ( ALPHA | DIGIT | HYPHEN )* macroOid ::= (descr ':')? oid
reader - The stream readerpos - The position in the SchemaLdapSchemaException - If something went wrong in the schemaIOException - If the stream can't be readpublic void parse(Reader reader) throws LdapSchemaException, IOException
reader - The stream readerLdapSchemaException - If something went wrong in the schemaIOException - If the stream can't be readpublic void parse(File schemaFile) throws ParseException
schemaFile - a file of schema objectsParseException - If the schemaObject can't be parsedpublic boolean isResolveObjectIdentifierMacros()
public void setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
resolveObjectIdentifierMacros - true if object identifier macros should be resolvedpublic boolean isQuirksMode()
public void setQuirksMode(boolean enabled)
enabled - the new quirks modeCopyright © 2003–2022 The Apache Software Foundation. All rights reserved.