org.apache.directory.shared.ldap.schema.parsers
Class OpenLdapSchemaParser

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaParser
      extended by org.apache.directory.shared.ldap.schema.parsers.OpenLdapSchemaParser

public class OpenLdapSchemaParser
extends AbstractSchemaParser

A reusable wrapper for antlr generated OpenLDAP schema parsers.

Version:
$Rev: 494164 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaParser
lexer, monitor, parser
 
Constructor Summary
OpenLdapSchemaParser()
          Creates a reusable instance of an OpenLdapSchemaParser.
 
Method Summary
 void clear()
          Reset the parser
 java.util.List<AttributeType> 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.
 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.
 void setResolveObjectIdentifierMacros(boolean isResolveObjectIdentifierMacros)
          Sets if object identifier macros should be resolved.
 
Methods inherited from class org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaParser
isQuirksMode, reset, setParserMonitor, setQuirksMode, setSchemaName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenLdapSchemaParser

public OpenLdapSchemaParser()
                     throws java.io.IOException
Creates a reusable instance of an OpenLdapSchemaParser.

Throws:
java.io.IOException - if the pipe cannot be formed
Method Detail

clear

public void clear()
Reset the parser


getAttributeTypes

public java.util.List<AttributeType> getAttributeTypes()
Gets the attribute types.

Returns:
the attribute types

getObjectClassTypes

public java.util.List<ObjectClass> getObjectClassTypes()
Gets the object class types.

Returns:
the object class types

getObjectIdentifierMacros

public java.util.Map<java.lang.String,OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
Gets the object identifier macros.

Returns:
the object identifier macros

parse

public SchemaObject parse(java.lang.String schemaObject)
                   throws java.text.ParseException
Parses an OpenLDAP schemaObject element/object.

Specified by:
parse in class AbstractSchemaParser
Parameters:
schemaObject - the String image of a complete schema object
Returns:
A SchemaObject instance
Throws:
java.io.IOException - If the schemaObject can't be transformed to a byteArrayInputStream
java.text.ParseException - If the schemaObject can't be parsed

parse

public void parse(java.io.InputStream schemaIn)
           throws java.io.IOException,
                  java.text.ParseException
Parses a stream of OpenLDAP schemaObject elements/objects.

Parameters:
schemaIn - a stream of schema objects
Throws:
java.io.IOException - If the schemaObject can't be transformed to a byteArrayInputStream
java.text.ParseException - If the schemaObject can't be parsed

parse

public void parse(java.io.File schemaFile)
           throws java.io.IOException,
                  java.text.ParseException
Parses a file of OpenLDAP schemaObject elements/objects.

Parameters:
schemaFile - a file of schema objects
Throws:
java.io.IOException - If the schemaObject can't be transformed to a byteArrayInputStream
java.text.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 isResolveObjectIdentifierMacros)
Sets if object identifier macros should be resolved.

Parameters:
isResolveObjectIdentifierMacros - true if object identifier macros should be resolved


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.