public class OpenLdapSchemaParser extends Object
Constructor and Description |
---|
OpenLdapSchemaParser()
Creates a reusable instance of an OpenLdapSchemaParser.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset the parser
|
List<AttributeType> |
getAttributeTypes()
Gets the attribute types.
|
List<ObjectClass> |
getObjectClasses()
Gets the object class types.
|
Map<String,OpenLdapObjectIdentifierMacro> |
getObjectIdentifierMacros()
Gets the object identifier macros.
|
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.
|
DitContentRule |
parseDitContentRule(String ditContentRuleDescription)
Production for matching DitContentRule descriptions.
|
DitStructureRule |
parseDitStructureRule(String ditStructureRuleDescription)
Production for matching DitStructureRule descriptions.
|
LdapComparatorDescription |
parseLdapComparator(String ldapComparatorDescription)
Production for LdapComparator descriptions.
|
LdapSyntax |
parseLdapSyntax(String ldapSyntaxDescription)
Production for matching ldap syntax descriptions.
|
MatchingRule |
parseMatchingRule(String matchingRuleDescription)
Production for matching MatchingRule descriptions.
|
MatchingRuleUse |
parseMatchingRuleUse(String matchingRuleUseDescription)
Production for matching MatchingRuleUse descriptions.
|
NameForm |
parseNameForm(String nameFormDescription)
Production for NameForm descriptions.
|
NormalizerDescription |
parseNormalizer(String normalizerDescription)
Production for Normalizer descriptions.
|
ObjectClass |
parseObjectClass(String objectClassDescription)
Production for matching ObjectClass descriptions.
|
SyntaxCheckerDescription |
parseSyntaxChecker(String syntaxCheckerDescription)
Production for SyntaxChecker descriptions.
|
void |
setQuirksMode(boolean enabled)
Sets the quirks mode.
|
void |
setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
Sets if object identifier macros should be resolved.
|
public OpenLdapSchemaParser()
public void clear()
public List<AttributeType> getAttributeTypes()
public List<ObjectClass> getObjectClasses()
public Map<String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
public 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 readpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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 invalidpublic 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–2020 The Apache Software Foundation. All rights reserved.