Class OpenLdapSchemaParser
- java.lang.Object
-
- org.apache.directory.api.ldap.model.schema.parsers.OpenLdapSchemaParser
-
public class OpenLdapSchemaParser extends Object
A reusable wrapper for hand parser OpenLDAP schema.- Author:
- Apache Directory Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOpenLdapSchemaParser.AttributeTypeElementsThe list of AttributeTypeDescription elements that can be seenprivate static classOpenLdapSchemaParser.DitContentRuleElementsThe list of DitContentRuleDescription elements that can be seenprivate static classOpenLdapSchemaParser.DitStructureRuleElementsThe list of DitStructureRuleDescription elements that can be seenprivate static classOpenLdapSchemaParser.LdapComparatorElementsThe list of LdapComparatorDescription elements that can be seenprivate static classOpenLdapSchemaParser.LdapSyntaxElementsThe list of LdapSyntaxDescription elements that can be seenprivate static classOpenLdapSchemaParser.MatchingRuleElementsThe list of MatchingRuleDescription elements that can be seenprivate static classOpenLdapSchemaParser.MatchingRuleUseElementsThe list of MatchingRuleUseDescription elements that can be seenprivate static classOpenLdapSchemaParser.NameFormElementsThe list of NameFormDescription elements that can be seenprivate static classOpenLdapSchemaParser.NormalizerElementsThe list of NormalizerDescription elements that can be seenprivate static classOpenLdapSchemaParser.ObjectClassElementsThe list of ObjectClassDescription elements that can be seenprivate classOpenLdapSchemaParser.PosSchemaprivate static interfaceOpenLdapSchemaParser.SchemaObjectElementsprivate static classOpenLdapSchemaParser.SyntaxCheckerElementsThe list of SyntaxCheckerDescription elements that can be seen
-
Field Summary
Fields Modifier and Type Field Description private static StringABSTRACT_STRprivate static StringAPPLIES_STRSome contant strings used in descriptionsprivate List<AttributeType>attributeTypesThe list of attribute type, initialized by splitParsedSchemaDescriptions()private static StringAUX_STRprivate static StringAUXILIARY_STRprivate static StringBYTECODE_STRprivate static StringCOLLECTIVE_STRprivate static charCOLONTokensprivate static StringDESC_STRprivate static StringDIRECTORY_OPERATION_STRUsageprivate static StringDISTRIBUTED_OPERATION_STRprivate static charDOLLARprivate static charDOTprivate static charDQUOTEprivate static StringDSA_OPERATION_STRprivate static charEQUALprivate static StringEQUALITY_STRprivate static charESCAPEprivate static StringEXTENSION_PREFIXprivate static StringFORM_STRprivate static StringFQCN_STRprivate static charHYPHENprivate booleanisQuirksModeEnabledA flag used to tell the parser if it should be strict or notprivate booleanisResolveObjectIdentifierMacrosFlag whether object identifier macros should be resolved.private static charLBRACEprotected intlineNumberthe number of the current line being parsed by the readerprotected static org.slf4j.LoggerLOGThe LoggerFactory used by this classprivate static charLPARENprivate static StringMAY_STRprivate static StringMUST_STRprivate static StringNAME_STRprivate static StringNO_USER_MODIFICATION_STRprivate static StringNOT_STRprivate List<ObjectClass>objectClassesThe list of object classes, initialized by splitParsedSchemaDescriptions()private Map<String,OpenLdapObjectIdentifierMacro>objectIdentifierMacrosThe map of object identifier macros, initialized by splitParsedSchemaDescriptions()private static StringOBSOLETE_STRprivate static StringOC_STRprivate static StringORDERING_STRprivate static charPLUSprivate static charRBRACEprivate static booleanRELAXEDprivate static charRPARENprivate List<Object>schemaDescriptionsThe list of parsed schema descriptionsprivate static charSEMI_COLONprivate static charSHARPprivate static StringSINGLE_VALUE_STRprivate static charSLASHprivate static charSQUOTEprivate static booleanSTRICTFlag for strict or relaxed modeprivate static StringSTRUCTURAL_STRprivate static StringSUBSTR_STRprivate static StringSUP_STRprivate static StringSYNTAX_STRprivate static booleanUN_QUOTEDprivate static charUNDERSCOREprivate static StringUSAGE_STRprivate static StringUSER_APPLICATIONS_STR
-
Constructor Summary
Constructors Constructor Description OpenLdapSchemaParser()Creates a reusable instance of an OpenLdapSchemaParser.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidafterParse()Splits parsed schema descriptions and resolved object identifier macros.private static intcheckElement(int elementsSeen, OpenLdapSchemaParser.SchemaObjectElements element, OpenLdapSchemaParser.PosSchema pos)voidclear()Reset the parserList<AttributeType>getAttributeTypes()Gets the attribute types.private static StringgetByteCode(OpenLdapSchemaParser.PosSchema pos)A base64 stringprivate static StringgetDescrRelaxed(OpenLdapSchemaParser.PosSchema pos)In quirksMode :private static StringgetDescrStrict(OpenLdapSchemaParser.PosSchema pos)In strict mode :private static StringgetFqcn(OpenLdapSchemaParser.PosSchema pos)A FQCNprivate static voidgetLine(Reader reader, OpenLdapSchemaParser.PosSchema pos)private StringgetMacro(OpenLdapSchemaParser.PosSchema pos)private static voidgetNoidLenRelaxed(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos)noidlen = oidRelaxed [ LCURLY len RCURLY ]private static voidgetNoidLenStrict(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos)noidlen = oidStrict [ LCURLY len RCURLY ]private static StringgetNumericOid(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 StringgetOidAndMacroRelaxed(OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)In relaxed mode :private static StringgetOidRelaxed(OpenLdapSchemaParser.PosSchema pos, boolean hadQuote)In quirks mode :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 StringgetOidStrict(OpenLdapSchemaParser.PosSchema pos)In normal mode :private static StringgetPartialNumericOid(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 StringgetQDescrRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos)qdescr ::== SQUOTE descr SQUOTE descr ::= keystring keystring ::= leadkeychar *keychar leadkeychar ::= ALPHA keychar ::= ALPHA | DIGIT | HYPHENprivate 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 / HYPHENprivate static StringgetQDescrStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos)qdescr ::== SQUOTE descr SQUOTE descr ::= keystring keystring ::= leadkeychar *keychar leadkeychar ::= ALPHA keychar ::= ALPHA | DIGIT | HYPHENprivate static StringgetQDString(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 stringprivate StringgetResolveOid(String oid)Return a complete OID from a macro followed by an OID.private static intgetRuleId(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 UsageEnumgetUsageRelaxed(OpenLdapSchemaParser.PosSchema pos)private static UsageEnumgetUsageStrict(OpenLdapSchemaParser.PosSchema pos)private static StringgetXString(OpenLdapSchemaParser.PosSchema pos)xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+private static booleanisAlpha(OpenLdapSchemaParser.PosSchema pos)private static booleanisComment(OpenLdapSchemaParser.PosSchema pos)private static booleanisDigit(OpenLdapSchemaParser.PosSchema pos)private static booleanisEmpty(OpenLdapSchemaParser.PosSchema pos)private static booleanisEscape(OpenLdapSchemaParser.PosSchema pos)private static booleanisEscape(OpenLdapSchemaParser.PosSchema pos, int index)booleanisQuirksMode()Checks if quirks mode is enabled.booleanisResolveObjectIdentifierMacros()Checks if object identifier macros should be resolved.voidparse(File schemaFile)Parses a file of OpenLDAP schemaObject elements/objects.voidparse(InputStream schemaIn)Parses a stream of OpenLDAP schemaObject elements/objects.voidparse(Reader reader)Reads an entry in a ldif buffer, and returns the resulting lines, without comments, and unfolded.SchemaObjectparse(String schemaObject)Parses an OpenLDAP schemaObject element/object.AttributeTypeparseAttributeType(String attributeTypeDescription)Production for matching attribute type descriptions.private static AttributeTypeparseAttributeTypeRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching attribute type descriptions.private static AttributeTypeparseAttributeTypeStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching attribute type descriptions.DitContentRuleparseDitContentRule(String ditContentRuleDescription)Production for matching DitContentRule descriptions.private static DitContentRuleparseDitContentRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for DitContentRule descriptions.private static DitContentRuleparseDitContentRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for DitContentRule descriptions.DitStructureRuleparseDitStructureRule(String ditStructureRuleDescription)Production for matching DitStructureRule descriptions.private static DitStructureRuleparseDitStructureRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for DitStructureRule descriptions.private static DitStructureRuleparseDitStructureRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos)Production for DitStructureRule descriptions.LdapComparatorDescriptionparseLdapComparator(String ldapComparatorDescription)Production for LdapComparator descriptions.private static LdapComparatorDescriptionparseLdapComparatorRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for LdapComparator descriptions.private static LdapComparatorDescriptionparseLdapComparatorStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for LdapComparator descriptions.LdapSyntaxparseLdapSyntax(String ldapSyntaxDescription)Production for matching ldap syntax descriptions.private static LdapSyntaxparseLdapSyntaxRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching ldap syntax descriptions.private static LdapSyntaxparseLdapSyntaxStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching ldap syntax descriptions.MatchingRuleparseMatchingRule(String matchingRuleDescription)Production for matching MatchingRule descriptions.private static MatchingRuleparseMatchingRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching rule descriptions.private static MatchingRuleparseMatchingRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching rule descriptions.MatchingRuleUseparseMatchingRuleUse(String matchingRuleUseDescription)Production for matching MatchingRuleUse descriptions.private static MatchingRuleUseparseMatchingRuleUseRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for MatchingRuleUse descriptions.private static MatchingRuleUseparseMatchingRuleUseStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for MatchingRuleUse descriptions.NameFormparseNameForm(String nameFormDescription)Production for NameForm descriptions.private static NameFormparseNameFormRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for NameForm descriptions.private static NameFormparseNameFormStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for NameForm descriptions.NormalizerDescriptionparseNormalizer(String normalizerDescription)Production for Normalizer descriptions.private static NormalizerDescriptionparseNormalizerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for Normalizer descriptions.private static NormalizerDescriptionparseNormalizerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for Normalizer descriptions.ObjectClassparseObjectClass(String objectClassDescription)Production for matching ObjectClass descriptions.private static ObjectClassparseObjectClassRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching ObjectClass descriptions.private static ObjectClassparseObjectClassStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for matching ObjectClass descriptions.SyntaxCheckerDescriptionparseSyntaxChecker(String syntaxCheckerDescription)Production for SyntaxChecker descriptions.private static SyntaxCheckerDescriptionparseSyntaxCheckerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for SyntaxChecker descriptions.private static SyntaxCheckerDescriptionparseSyntaxCheckerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros)Production for SyntaxChecker descriptions.private static voidprocessExtension(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 stringprivate voidprocessObjectIdentifier(Reader reader, OpenLdapSchemaParser.PosSchema pos)Process OpenLDAP macros, like : objectidentifier DUAConfSchemaOID 1.3.6.1.4.1.11.1.3.1.private voidresolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro)Find the proper OID from a OID which may contain a macrovoidsetQuirksMode(boolean enabled)Sets the quirks mode.voidsetResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)Sets if object identifier macros should be resolved.private static voidskipWhites(Reader reader, OpenLdapSchemaParser.PosSchema pos, boolean mandatory)private static booleanstartsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c)Check if the stream starts with a given char at a given positionprivate static booleanstartsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c, boolean quoted)Check if the stream at the given position starts with a given charprivate static booleanstartsWith(OpenLdapSchemaParser.PosSchema pos, char c)private static booleanstartsWith(OpenLdapSchemaParser.PosSchema pos, String text)
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
The LoggerFactory used by this class
-
isQuirksModeEnabled
private boolean isQuirksModeEnabled
A flag used to tell the parser if it should be strict or not
-
lineNumber
protected int lineNumber
the number of the current line being parsed by the reader
-
attributeTypes
private List<AttributeType> attributeTypes
The list of attribute type, initialized by splitParsedSchemaDescriptions()
-
objectClasses
private List<ObjectClass> objectClasses
The list of object classes, initialized by splitParsedSchemaDescriptions()
-
objectIdentifierMacros
private Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros
The map of object identifier macros, initialized by splitParsedSchemaDescriptions()
-
APPLIES_STR
private static final String APPLIES_STR
Some contant strings used in descriptions- See Also:
- Constant Field Values
-
ABSTRACT_STR
private static final String ABSTRACT_STR
- See Also:
- Constant Field Values
-
AUX_STR
private static final String AUX_STR
- See Also:
- Constant Field Values
-
AUXILIARY_STR
private static final String AUXILIARY_STR
- See Also:
- Constant Field Values
-
BYTECODE_STR
private static final String BYTECODE_STR
- See Also:
- Constant Field Values
-
COLLECTIVE_STR
private static final String COLLECTIVE_STR
- See Also:
- Constant Field Values
-
DESC_STR
private static final String DESC_STR
- See Also:
- Constant Field Values
-
EQUALITY_STR
private static final String EQUALITY_STR
- See Also:
- Constant Field Values
-
FORM_STR
private static final String FORM_STR
- See Also:
- Constant Field Values
-
FQCN_STR
private static final String FQCN_STR
- See Also:
- Constant Field Values
-
MAY_STR
private static final String MAY_STR
- See Also:
- Constant Field Values
-
MUST_STR
private static final String MUST_STR
- See Also:
- Constant Field Values
-
NAME_STR
private static final String NAME_STR
- See Also:
- Constant Field Values
-
NO_USER_MODIFICATION_STR
private static final String NO_USER_MODIFICATION_STR
- See Also:
- Constant Field Values
-
NOT_STR
private static final String NOT_STR
- See Also:
- Constant Field Values
-
OBSOLETE_STR
private static final String OBSOLETE_STR
- See Also:
- Constant Field Values
-
OC_STR
private static final String OC_STR
- See Also:
- Constant Field Values
-
ORDERING_STR
private static final String ORDERING_STR
- See Also:
- Constant Field Values
-
SINGLE_VALUE_STR
private static final String SINGLE_VALUE_STR
- See Also:
- Constant Field Values
-
STRUCTURAL_STR
private static final String STRUCTURAL_STR
- See Also:
- Constant Field Values
-
SUBSTR_STR
private static final String SUBSTR_STR
- See Also:
- Constant Field Values
-
SUP_STR
private static final String SUP_STR
- See Also:
- Constant Field Values
-
SYNTAX_STR
private static final String SYNTAX_STR
- See Also:
- Constant Field Values
-
USAGE_STR
private static final String USAGE_STR
- See Also:
- Constant Field Values
-
EXTENSION_PREFIX
private static final String EXTENSION_PREFIX
- See Also:
- Constant Field Values
-
DIRECTORY_OPERATION_STR
private static final String DIRECTORY_OPERATION_STR
Usage- See Also:
- Constant Field Values
-
DISTRIBUTED_OPERATION_STR
private static final String DISTRIBUTED_OPERATION_STR
- See Also:
- Constant Field Values
-
DSA_OPERATION_STR
private static final String DSA_OPERATION_STR
- See Also:
- Constant Field Values
-
USER_APPLICATIONS_STR
private static final String USER_APPLICATIONS_STR
- See Also:
- Constant Field Values
-
COLON
private static final char COLON
Tokens- See Also:
- Constant Field Values
-
DOLLAR
private static final char DOLLAR
- See Also:
- Constant Field Values
-
DOT
private static final char DOT
- See Also:
- Constant Field Values
-
EQUAL
private static final char EQUAL
- See Also:
- Constant Field Values
-
ESCAPE
private static final char ESCAPE
- See Also:
- Constant Field Values
-
HYPHEN
private static final char HYPHEN
- See Also:
- Constant Field Values
-
LBRACE
private static final char LBRACE
- See Also:
- Constant Field Values
-
LPAREN
private static final char LPAREN
- See Also:
- Constant Field Values
-
PLUS
private static final char PLUS
- See Also:
- Constant Field Values
-
RBRACE
private static final char RBRACE
- See Also:
- Constant Field Values
-
RPAREN
private static final char RPAREN
- See Also:
- Constant Field Values
-
SEMI_COLON
private static final char SEMI_COLON
- See Also:
- Constant Field Values
-
SHARP
private static final char SHARP
- See Also:
- Constant Field Values
-
SLASH
private static final char SLASH
- See Also:
- Constant Field Values
-
SQUOTE
private static final char SQUOTE
- See Also:
- Constant Field Values
-
UNDERSCORE
private static final char UNDERSCORE
- See Also:
- Constant Field Values
-
DQUOTE
private static final char DQUOTE
- See Also:
- Constant Field Values
-
isResolveObjectIdentifierMacros
private boolean isResolveObjectIdentifierMacros
Flag whether object identifier macros should be resolved.
-
UN_QUOTED
private static final boolean UN_QUOTED
- See Also:
- Constant Field Values
-
STRICT
private static final boolean STRICT
Flag for strict or relaxed mode- See Also:
- Constant Field Values
-
RELAXED
private static final boolean RELAXED
- See Also:
- Constant Field Values
-
-
Method Detail
-
clear
public void clear()
Reset the parser
-
getAttributeTypes
public List<AttributeType> getAttributeTypes()
Gets the attribute types.- Returns:
- the attribute types
-
getObjectClasses
public List<ObjectClass> getObjectClasses()
Gets the object class types.- Returns:
- the object class types
-
getObjectIdentifierMacros
public Map<String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
Gets the object identifier macros.- Returns:
- the object identifier macros
-
afterParse
private void afterParse() throws ParseExceptionSplits parsed schema descriptions and resolved object identifier macros.- Throws:
ParseException- the parse exception
-
getResolveOid
private String getResolveOid(String oid)
Return a complete OID from a macro followed by an OID.- Parameters:
oid- The OID to find- Returns:
- The extended OID
-
resolveObjectIdentifierMacro
private void resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro) throws ParseException
Find the proper OID from a OID which may contain a macro- Parameters:
macro- The element to resolve- Throws:
ParseException- If teh OID is invalid
-
parse
public SchemaObject parse(String schemaObject) throws ParseException
Parses an OpenLDAP schemaObject element/object.- Parameters:
schemaObject- the String image of a complete schema object- Returns:
- the schema object
- Throws:
ParseException- If the schemaObject can't be parsed
-
parse
public void parse(InputStream schemaIn) throws ParseException, LdapSchemaException, IOException
Parses a stream of OpenLDAP schemaObject elements/objects. Default charset is used.- Parameters:
schemaIn- a stream of schema objects- Throws:
ParseException- If the schema can't be parsedLdapSchemaException- If there is an error in the schemaIOException- If the stream can't be read
-
skipWhites
private static void skipWhites(Reader reader, OpenLdapSchemaParser.PosSchema pos, boolean mandatory) throws IOException, LdapSchemaException
- Parameters:
reader- The stream readerpos- The position in the Schemamandatory- If the spaces are mandatory- Throws:
IOException- If the stream can't be readLdapSchemaException- If the schema is wrong
-
isComment
private static boolean isComment(OpenLdapSchemaParser.PosSchema pos)
- Parameters:
pos- The position in the Schema- Returns:
- true if this is a comment
-
isEmpty
private static boolean isEmpty(OpenLdapSchemaParser.PosSchema pos)
- Parameters:
pos- The position in the Schema- Returns:
- true of the line is empty
-
startsWith
private static boolean startsWith(OpenLdapSchemaParser.PosSchema pos, String text)
- Parameters:
pos- The position in the Schematext- The text to find at the beginning of the line- Returns:
- true if teh line starts with the given text
-
startsWith
private static boolean startsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c) throws IOException, LdapSchemaException
Check if the stream starts with a given char at a given position- Parameters:
reader- The stream readerpos- The position in the Schemac- The char to check- Returns:
- true if the stream starts with the given char at the given position
- Throws:
IOException- If we can't read the streamLdapSchemaException- If we have no char to read
-
startsWith
private static boolean startsWith(Reader reader, OpenLdapSchemaParser.PosSchema pos, char c, boolean quoted) throws IOException, LdapSchemaException
Check if the stream at the given position starts with a given char- Parameters:
reader- The stream readerpos- The position in the Schemac- The char to checkquoted- true if the char is quoted- Returns:
- true if the stream starts with the given char at the given position
- Throws:
IOException- If we can't read the streamLdapSchemaException- If we have no char to read
-
startsWith
private static boolean startsWith(OpenLdapSchemaParser.PosSchema pos, char c)
- Parameters:
pos- The position in the Schemac- The char to find at the beginning of the line- Returns:
- true if the char is found at the beginning of the line
-
isAlpha
private static boolean isAlpha(OpenLdapSchemaParser.PosSchema pos)
- Parameters:
pos- The position in the Schema- Returns:
- true if the first char is alphabetic
-
isDigit
private static boolean isDigit(OpenLdapSchemaParser.PosSchema pos)
- Parameters:
pos- The position in the Schema- Returns:
- true if the first char is a digit
-
isEscape
private static boolean isEscape(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
- Throws:
LdapSchemaException
-
isEscape
private static boolean isEscape(OpenLdapSchemaParser.PosSchema pos, int index) throws LdapSchemaException
- Throws:
LdapSchemaException
-
getLine
private static void getLine(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException
- Parameters:
reader- The stream readerpos- The position in the Schema- Throws:
IOException- If the stream can't be read
-
getNumericOid
private 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 (".")- Parameters:
pos- The position in the Schema- Returns:
- The numeric OID
- Throws:
LdapSchemaException- If the schema is wrong
-
getPartialNumericOid
private 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 (".")- Parameters:
pos- The position in the Schema- Returns:
- The found OID
- Throws:
LdapSchemaException- If the schema is wrong
-
getOidAndMacroRelaxed
private static String getOidAndMacroRelaxed(OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws LdapSchemaException
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 (".") COLON ::= %x3A ; colon (":") SEMI_COLON ::= %x3B ; semi-colon(";") SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")- Parameters:
pos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- The found OID
- Throws:
LdapSchemaException- If the schema is wrong
-
getOidStrict
private static String getOidStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
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 (".") HYPHEN ::= %x2D ; hyphen ("-")- Parameters:
pos- The position in the Schema- Returns:
- The found OID
- Throws:
LdapSchemaException- If the schema is wrong
-
getOidRelaxed
private static String getOidRelaxed(OpenLdapSchemaParser.PosSchema pos, boolean hadQuote) throws LdapSchemaException
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 (".") COLON ::= %x3A ; colon (":") SEMI_COLON ::= %x3B ; semi-colon(";") SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")- Parameters:
pos- The position in the SchemahadQuote- If we have had a quote- Returns:
- the found OID
- Throws:
LdapSchemaException- If the schema is wrong
-
getDescrStrict
private static String getDescrStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
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 (".") HYPHEN ::= %x2D ; hyphen ("-")- Parameters:
pos- The position in the Schema- Returns:
- The descr
- Throws:
LdapSchemaException- If the schema is wrong
-
getDescrRelaxed
private static String getDescrRelaxed(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
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 (".") COLON ::= %x3A ; colon (":") SEMI_COLON ::= %x3B ; semi-colon(";") SHARP ::= %x23 ; octothorpe (or sharp sign) ("#")- Parameters:
pos- The position in the Schema- Returns:
- The descr
- Throws:
LdapSchemaException- If the schema is wrong
-
getMacro
private String getMacro(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
- Parameters:
pos- The position in the Schema- Returns:
- The found macro, if any
- Throws:
LdapSchemaException- If the schema is wrong
-
getQDescrStrict
private 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 | 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
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The QDescr
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getQDescrRelaxed
private 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 | 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
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- the QDescr
- Throws:
IOException- If the stream can't be readLdapSchemaException- If the schema is wrong
-
getQDString
private static String getQDString(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
No relaxed version.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 ("\")In quirksMode :qdstring ::== SQUOTE dstring SQUOTE dstring ::= ( QS | QQ | QUTF8 | ESC )+ ; escaped UTF-8 string or backslash 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 ("\")- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The QDString
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getQDescrs
private 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
- Parameters:
reader- The stream readerpos- The position in the Schemarelaxed- If the schema is to be processed in relaxed mode- Returns:
- The list of QDescr
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getQDStrings
private 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
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The list of QDString
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getOidsStrict
private 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 )
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The list of OIDs
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getOidsRelaxed
private 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 )
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The list of OIDs
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getNoidLenStrict
private static void getNoidLenStrict(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
noidlen = oidStrict [ LCURLY len RCURLY ]
- Parameters:
attributeType- The AttributeTypepos- The position in the Schema- Throws:
LdapSchemaException- If the schema is wrong
-
getNoidLenRelaxed
private static void getNoidLenRelaxed(AttributeType attributeType, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
noidlen = oidRelaxed [ LCURLY len RCURLY ]
- Parameters:
attributeType- The AttributeTypepos- The position in the Schema- Throws:
LdapSchemaException- If the schema is wrong
-
getRuleId
private static int getRuleId(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
ruleid ::= number number ::= DIGIT | LDIGIT DIGIT+ DIGIT ::= [0-9] LDIGIT ::= [1-9]
- Parameters:
pos- The position in the Schema- Returns:
- The RuleID
- Throws:
LdapSchemaException- If the schema is wrong
-
getRuleIds
private static List<Integer> getRuleIds(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException, IOException
ruleids ::= ruleid | ( LPAREN WSP ruleidlist WSP RPAREN ) ruleidlist ::= ruleid ( SP ruleid )*
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- The list of RuleIDs
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
getUsageStrict
private static UsageEnum getUsageStrict(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
- Parameters:
pos- The position in the Schema- Returns:
- The USAGE
- Throws:
LdapSchemaException- If the schema is wrong
-
getUsageRelaxed
private static UsageEnum getUsageRelaxed(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
- Parameters:
pos- The position in the Schema- Returns:
- The USAGE
- Throws:
LdapSchemaException- If the schema is wrong
-
processExtension
private 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
- Parameters:
reader- The stream readerpos- The position in the SchemaschemaObject- The SchemaObject- Throws:
IOException- If the stream can't be readLdapSchemaException- If the schema is wrong
-
getXString
private static String getXString(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
xstring ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+
- Parameters:
pos- The position in the Schema- Returns:
- the X-String
- Throws:
LdapSchemaException- If the schema is wrong
-
getFqcn
private static String getFqcn(OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException
A FQCNFQCN ::= FQCN_IDENTIFIER ( '.' FQCN_IDENTIFIER )* FQCN_IDENTIFIER ::= ( JavaLetter ( JavaLetterOrDigit )*
- Parameters:
pos- The position in the Schema- Returns:
- The FQCN
- Throws:
LdapSchemaException- If the schema is wrong
-
getByteCode
private static String getByteCode(OpenLdapSchemaParser.PosSchema pos)
A base64 stringbyteCode ::= ( [a-z] | [A-Z] | [0-9] | '+' | '/' | '=' )*
- Parameters:
pos- The position in the Schema- Returns:
- The ByteCode
-
checkElement
private static int checkElement(int elementsSeen, OpenLdapSchemaParser.SchemaObjectElements element, OpenLdapSchemaParser.PosSchema pos) throws LdapSchemaException- Parameters:
elementsSeen- The elements that have been processed alreadyelement- The current elementpos- T he position in the Schema- Returns:
- The elements we have just processed
- Throws:
LdapSchemaException- If the schema is wrong
-
parseAttributeType
public AttributeType parseAttributeType(String attributeTypeDescription) throws ParseException
Production for matching attribute type descriptions. It is fault-tolerant against element ordering.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 )- Parameters:
attributeTypeDescription- The String containing the AttributeTypeDescription- Returns:
- An instance of AttributeType
- Throws:
ParseException- If the element was invalid
-
parseAttributeTypeStrict
private static AttributeType parseAttributeTypeStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching attribute type descriptions. It is fault-tolerant against element ordering. It's strict.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 )- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of AttributeType
- Throws:
IOException- If the stream can't be readLdapSchemaException- If the schema is wrong
-
parseAttributeTypeRelaxed
private static AttributeType parseAttributeTypeRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching attribute type descriptions. It is fault-tolerant against element ordering. It's relaxed.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 )- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of AttributeType
- Throws:
IOException- If the stream can't be readLdapSchemaException- If the schema is wrong
-
parseDitContentRule
public DitContentRule parseDitContentRule(String ditContentRuleDescription) throws ParseException
Production for matching DitContentRule descriptions. It is fault-tolerant against element ordering.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- Parameters:
ditContentRuleDescription- The String containing the DitContentRuleDescription- Returns:
- An instance of ditContentRule
- Throws:
ParseException- If the element was invalid
-
parseDitContentRuleStrict
private static DitContentRule parseDitContentRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for DitContentRule descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of DitContentRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseDitContentRuleRelaxed
private static DitContentRule parseDitContentRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for DitContentRule descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of DitContentRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseDitStructureRule
public DitStructureRule parseDitStructureRule(String ditStructureRuleDescription) throws ParseException
Production for matching DitStructureRule descriptions. It is fault-tolerant against element ordering.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
- Parameters:
ditStructureRuleDescription- The String containing the DitStructureRuleDescription- Returns:
- An instance of DitStructureRule
- Throws:
ParseException- If the element was invalid
-
parseDitStructureRuleStrict
private static DitStructureRule parseDitStructureRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException, LdapSchemaException
Production for DitStructureRule descriptions. It is fault-tolerant against element ordering.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
- Parameters:
reader- The stream readerpos- The position in the Schema- Returns:
- An instance of DitStructureRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseDitStructureRuleRelaxed
private static DitStructureRule parseDitStructureRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for DitStructureRule descriptions. It is fault-tolerant against element ordering.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
- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of DitStructureRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseLdapComparator
public LdapComparatorDescription parseLdapComparator(String ldapComparatorDescription) throws ParseException
Production for LdapComparator descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
ldapComparatorDescription- The String containing the LdapComparatorDescription- Returns:
- An instance of LdapComparatorDescription
- Throws:
ParseException- If the element was invalid
-
parseLdapComparatorStrict
private static LdapComparatorDescription parseLdapComparatorStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for LdapComparator descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of LdapComparatorDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseLdapComparatorRelaxed
private static LdapComparatorDescription parseLdapComparatorRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for LdapComparator descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of LdapComparatorDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseLdapSyntax
public LdapSyntax parseLdapSyntax(String ldapSyntaxDescription) throws ParseException
Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.SyntaxDescription = LPAREN WSP numericoid ; object identifier [ SP "DESC" SP qdstring ] ; description extensions WSP RPAREN ; extensions- Parameters:
ldapSyntaxDescription- The String containing the Ldap Syntax description- Returns:
- An instance of LdapSyntax
- Throws:
ParseException- If the element was invalid
-
parseLdapSyntaxStrict
private static LdapSyntax parseLdapSyntaxStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.SyntaxDescription = LPAREN WSP numericoid ; object identifier [ SP "DESC" SP qdstring ] ; description extensions WSP RPAREN ; extensions- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of LdapSyntax
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseLdapSyntaxRelaxed
private static LdapSyntax parseLdapSyntaxRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.SyntaxDescription = LPAREN WSP numericoid ; object identifier [ SP "DESC" SP qdstring ] ; description extensions WSP RPAREN ; extensions- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of LdapSyntax
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseMatchingRule
public MatchingRule parseMatchingRule(String matchingRuleDescription) throws ParseException
Production for matching MatchingRule descriptions. It is fault-tolerant against element ordering.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- Parameters:
matchingRuleDescription- The String containing the MatchingRuledescription- Returns:
- An instance of MatchingRule
- Throws:
ParseException- If the element was invalid
-
parseMatchingRuleStrict
private static MatchingRule parseMatchingRuleStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching rule descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of MatchingRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseMatchingRuleRelaxed
private static MatchingRule parseMatchingRuleRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching rule descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of MatchingRule
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseMatchingRuleUse
public MatchingRuleUse parseMatchingRuleUse(String matchingRuleUseDescription) throws ParseException
Production for matching MatchingRuleUse descriptions. It is fault-tolerant against element ordering.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- Parameters:
matchingRuleUseDescription- The String containing the MatchingRuleUsedescription- Returns:
- An instance of MatchingRuleUse
- Throws:
ParseException- If the element was invalid
-
parseMatchingRuleUseStrict
private static MatchingRuleUse parseMatchingRuleUseStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for MatchingRuleUse descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of MatchingRuleUse
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseMatchingRuleUseRelaxed
private static MatchingRuleUse parseMatchingRuleUseRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for MatchingRuleUse descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of MatchingRuleUse
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseNameForm
public NameForm parseNameForm(String nameFormDescription) throws ParseException
Production for NameForm descriptions. It is fault-tolerant against element ordering.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- Parameters:
nameFormDescription- The String containing the NameFormdescription- Returns:
- An instance of NameForm
- Throws:
ParseException- If the element was invalid
-
parseNameFormStrict
private static NameForm parseNameFormStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for NameForm descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of NameForm
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseNameFormRelaxed
private static NameForm parseNameFormRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for NameForm descriptions. It is fault-tolerant against element ordering.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- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of NameForm
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseNormalizer
public NormalizerDescription parseNormalizer(String normalizerDescription) throws ParseException
Production for Normalizer descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
normalizerDescription- The String containing the NormalizerDescription- Returns:
- An instance of NormalizerDescription
- Throws:
ParseException- If the element was invalid
-
parseNormalizerStrict
private static NormalizerDescription parseNormalizerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for Normalizer descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of NormalizerDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseNormalizerRelaxed
private static NormalizerDescription parseNormalizerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for Normalizer descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of NormalizerDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseObjectClass
public ObjectClass parseObjectClass(String objectClassDescription) throws ParseException
Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.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"
- Parameters:
objectClassDescription- The String containing the ObjectClassDescription- Returns:
- An instance of objectClass
- Throws:
ParseException- If the element was invalid
-
parseObjectClassStrict
private static ObjectClass parseObjectClassStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.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"
- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of ObjectClass
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseObjectClassRelaxed
private static ObjectClass parseObjectClassRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.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"
- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of ObjectClass
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseSyntaxChecker
public SyntaxCheckerDescription parseSyntaxChecker(String syntaxCheckerDescription) throws ParseException
Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
syntaxCheckerDescription- The String containing the SyntaxCheckerDescription- Returns:
- An instance of SyntaxCheckerDescription
- Throws:
ParseException- If the element was invalid
-
parseSyntaxCheckerStrict
private static SyntaxCheckerDescription parseSyntaxCheckerStrict(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of SyntaxCheckerDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
parseSyntaxCheckerRelaxed
private static SyntaxCheckerDescription parseSyntaxCheckerRelaxed(Reader reader, OpenLdapSchemaParser.PosSchema pos, Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros) throws IOException, LdapSchemaException
Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.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 = ???- Parameters:
reader- The stream readerpos- The position in the SchemaobjectIdentifierMacros- The set of existing Macros- Returns:
- An instance of SyntaxCheckerDescription
- Throws:
LdapSchemaException- If the schema is wrongIOException- If the stream can't be read
-
processObjectIdentifier
private void processObjectIdentifier(Reader reader, OpenLdapSchemaParser.PosSchema pos) throws IOException, LdapSchemaException
Process OpenLDAP macros, like : objectidentifier DUAConfSchemaOID 1.3.6.1.4.1.11.1.3.1.objectidentifier ::= 'objectidentifier' descr SP+ macroOid descr ::= ALPHA ( ALPHA | DIGIT | HYPHEN )* macroOid ::= (descr ':')? oid
- Parameters:
reader- The stream readerpos- The position in the Schema- Throws:
LdapSchemaException- If something went wrong in the schemaIOException- If the stream can't be read
-
parse
public void parse(Reader reader) throws LdapSchemaException, IOException
Reads an entry in a ldif buffer, and returns the resulting lines, without comments, and unfolded. The lines represent *one* entry.- Parameters:
reader- The stream reader- Throws:
LdapSchemaException- If something went wrong in the schemaIOException- If the stream can't be read
-
parse
public void parse(File schemaFile) throws ParseException
Parses a file of OpenLDAP schemaObject elements/objects. Default charset is used.- Parameters:
schemaFile- a file of schema objects- Throws:
ParseException- If the schemaObject can't be parsed
-
isResolveObjectIdentifierMacros
public boolean isResolveObjectIdentifierMacros()
Checks if object identifier macros should be resolved.- Returns:
- true, object identifier macros should be resolved.
-
setResolveObjectIdentifierMacros
public void setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
Sets if object identifier macros should be resolved.- Parameters:
resolveObjectIdentifierMacros- true if object identifier macros should be resolved
-
isQuirksMode
public boolean isQuirksMode()
Checks if quirks mode is enabled.- Returns:
- true, if is quirks mode is enabled
-
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
-
-