Class SchemaParser
- java.lang.Object
-
- org.apache.directory.api.ldap.schema.converter.SchemaParser
-
public class SchemaParser extends Object
A reusable wrapper for antlr generated schema parsers.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description SchemaParser()
Creates a reusable instance of an SchemaParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 processedParseException
- 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 processedParseException
- 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 processedParseException
- If we weren't able to parse the schema
-
-