public class OpenLdapSchemaParser extends AbstractSchemaParser<SchemaObject>
| Modifier and Type | Field and Description |
|---|---|
private List<MutableAttributeType> |
attributeTypes
The list of attribute type, initialized by splitParsedSchemaDescriptions()
|
private boolean |
isResolveObjectIdentifierMacros
Flag whether object identifier macros should be resolved.
|
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 List<Object> |
schemaDescriptions
The list of parsed schema descriptions
|
lexer, LOG, monitor, parser| 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.
|
void |
clear()
Reset the parser
|
protected SchemaObject |
doParse()
Parse a SchemaObject description and returns back an instance of SchemaObject.
|
List<MutableAttributeType> |
getAttributeTypes()
Gets the attribute types.
|
List<ObjectClass> |
getObjectClassTypes()
Gets the object class types.
|
Map<String,OpenLdapObjectIdentifierMacro> |
getObjectIdentifierMacros()
Gets the object identifier macros.
|
private String |
getResolveOid(String oid) |
private void |
invokeParser(String subject) |
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.
|
SchemaObject |
parse(String schemaObject)
Parses an OpenLDAP schemaObject element/object.
|
private void |
resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro) |
void |
setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
Sets if object identifier macros should be resolved.
|
isQuirksMode, reset, setParserMonitor, setQuirksModeprivate List<MutableAttributeType> attributeTypes
private List<ObjectClass> objectClasses
private Map<String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros
private boolean isResolveObjectIdentifierMacros
public OpenLdapSchemaParser()
throws IOException
IOException - if the pipe cannot be formedprotected SchemaObject doParse() throws antlr.RecognitionException, antlr.TokenStreamException
AbstractSchemaParserdoParse in class AbstractSchemaParser<SchemaObject>antlr.RecognitionException - the native antlr exceptionantlr.TokenStreamException - the native antlr exceptionpublic void clear()
public List<MutableAttributeType> getAttributeTypes()
public List<ObjectClass> getObjectClassTypes()
public Map<String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
private void afterParse()
throws ParseException
ParseException - the parse exceptionprivate void resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro) throws ParseException
ParseExceptionpublic SchemaObject parse(String schemaObject) throws ParseException
parse in class AbstractSchemaParser<SchemaObject>schemaObject - the String image of a complete schema objectParseException - If the schemaObject can't be parsedprivate void invokeParser(String subject) throws ParseException
ParseExceptionpublic void parse(InputStream schemaIn) throws IOException, ParseException
schemaIn - a stream of schema objectsIOException - If the schemaObject can't be transformed to a byteArrayInputStreamParseException - If the schemaObject can't be parsedpublic void parse(File schemaFile) throws IOException, ParseException
schemaFile - a file of schema objectsIOException - If the schemaObject can't be transformed to a byteArrayInputStreamParseException - If the schemaObject can't be parsedpublic boolean isResolveObjectIdentifierMacros()
public void setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
resolveObjectIdentifierMacros - true if object identifier macros should be resolvedCopyright © 2003–2017 The Apache Software Foundation. All rights reserved.