org.apache.directory.api.converter.schema
Class SchemaParser

java.lang.Object
  extended by org.apache.directory.api.converter.schema.SchemaParser

public class SchemaParser
extends Object

A reusable wrapper for antlr generated schema parsers.

Author:
Apache Directory Project

Constructor Summary
SchemaParser()
          Creates a reusable instance of an SchemaParser.
 
Method Summary
 void clear()
          Clear the parser.
 void init()
          Initializes a parser and its plumbing.
 void parse(File schemaFile)
          Thread safe method parses a file of OpenLDAP schemaObject elements/objects.
 List<SchemaElement> parse(InputStream schemaIn)
          Thread safe method parses a stream of OpenLDAP schemaObject elements/objects.
 List<SchemaElement> parse(String schemaObject)
          Thread safe method parses an OpenLDAP schemaObject element/object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaParser

public SchemaParser()
             throws IOException
Creates a reusable instance of an SchemaParser.

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

init

public void init()
          throws IOException
Initializes a parser and its plumbing.

Throws:
IOException - if a pipe cannot be formed.

clear

public void clear()
Clear the parser.


parse

public List<SchemaElement> parse(String schemaObject)
                          throws IOException,
                                 ParseException
Thread safe method parses an OpenLDAP schemaObject element/object.

Parameters:
schemaObject - the String image of a complete schema object
Returns:
The list of parsed schema elements
Throws:
IOException - If the schema file can't be processed
ParseException - If we weren't able to parse the schema

parse

public List<SchemaElement> parse(InputStream schemaIn)
                          throws IOException,
                                 ParseException
Thread safe method parses a stream of OpenLDAP schemaObject elements/objects.

Parameters:
schemaIn - a stream of schema objects
Returns:
A list of schema elements
Throws:
IOException - If the schema file can't be processed
ParseException - If we weren't able to parse the schema

parse

public void parse(File schemaFile)
           throws IOException,
                  ParseException
Thread safe method parses a file of OpenLDAP schemaObject elements/objects.

Parameters:
schemaFile - a file of schema objects
Throws:
IOException - If the schema file can't be processed
ParseException - If we weren't able to parse the schema


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.