public class OpenLdapSchemaParser extends AbstractSchemaParser<SchemaObject>
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<MutableAttributeType> |
attributeTypes
The list of attribute type, initialized by splitParsedSchemaDescriptions()
|
private boolean |
isResolveObjectIdentifierMacros
Flag whether object identifier macros should be resolved.
|
private java.util.List<ObjectClass> |
objectClasses
The list of object classes, initialized by splitParsedSchemaDescriptions()
|
private java.util.Map<java.lang.String,OpenLdapObjectIdentifierMacro> |
objectIdentifierMacros
The map of object identifier macros, initialized by splitParsedSchemaDescriptions()
|
private java.util.List<java.lang.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.
|
java.util.List<MutableAttributeType> |
getAttributeTypes()
Gets the attribute types.
|
java.util.List<ObjectClass> |
getObjectClassTypes()
Gets the object class types.
|
java.util.Map<java.lang.String,OpenLdapObjectIdentifierMacro> |
getObjectIdentifierMacros()
Gets the object identifier macros.
|
private java.lang.String |
getResolveOid(java.lang.String oid) |
private void |
invokeParser(java.lang.String subject) |
boolean |
isResolveObjectIdentifierMacros()
Checks if object identifier macros should be resolved.
|
void |
parse(java.io.File schemaFile)
Parses a file of OpenLDAP schemaObject elements/objects.
|
void |
parse(java.io.InputStream schemaIn)
Parses a stream of OpenLDAP schemaObject elements/objects.
|
SchemaObject |
parse(java.lang.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 java.util.List<java.lang.Object> schemaDescriptions
private java.util.List<MutableAttributeType> attributeTypes
private java.util.List<ObjectClass> objectClasses
private java.util.Map<java.lang.String,OpenLdapObjectIdentifierMacro> objectIdentifierMacros
private boolean isResolveObjectIdentifierMacros
public OpenLdapSchemaParser()
throws java.io.IOException
java.io.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 java.util.List<MutableAttributeType> getAttributeTypes()
public java.util.List<ObjectClass> getObjectClassTypes()
public java.util.Map<java.lang.String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
private void afterParse()
throws java.text.ParseException
java.text.ParseException - the parse exceptionprivate java.lang.String getResolveOid(java.lang.String oid)
private void resolveObjectIdentifierMacro(OpenLdapObjectIdentifierMacro macro) throws java.text.ParseException
java.text.ParseExceptionpublic SchemaObject parse(java.lang.String schemaObject) throws java.text.ParseException
parse in class AbstractSchemaParser<SchemaObject>schemaObject - the String image of a complete schema objectjava.text.ParseException - If the schemaObject can't be parsedprivate void invokeParser(java.lang.String subject)
throws java.text.ParseException
java.text.ParseExceptionpublic void parse(java.io.InputStream schemaIn)
throws java.io.IOException,
java.text.ParseException
schemaIn - a stream of schema objectsjava.io.IOException - If the schemaObject can't be transformed to a byteArrayInputStreamjava.text.ParseException - If the schemaObject can't be parsedpublic void parse(java.io.File schemaFile)
throws java.io.IOException,
java.text.ParseException
schemaFile - a file of schema objectsjava.io.IOException - If the schemaObject can't be transformed to a byteArrayInputStreamjava.text.ParseException - If the schemaObject can't be parsedpublic boolean isResolveObjectIdentifierMacros()
public void setResolveObjectIdentifierMacros(boolean resolveObjectIdentifierMacros)
resolveObjectIdentifierMacros - true if object identifier macros should be resolved