public class SchemaParser
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
SchemaParser.DataProducer
The thread which read the schema files and fill the
temporary buffer used by the lexical analyzer.
|
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
buf
A temporary buffer storing the read schema bytes
|
private antlrSchemaConverterParser |
parser
The antlr generated parser
|
private java.io.PipedOutputStream |
parserIn
A pipe into the parser
|
private java.lang.Thread |
producerThread
The thread used to read the schema
|
private java.io.InputStream |
schemaIn
The inputStream mapped over the schema file to parse
|
| Constructor and Description |
|---|
SchemaParser()
Creates a reusable instance of an SchemaParser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the parser.
|
void |
init()
Initializes a parser and its plumbing.
|
private java.util.List<SchemaElement> |
invokeParser(java.lang.String schemaName)
Invoke the parser
|
void |
parse(java.io.File schemaFile)
Thread safe method parses a file of OpenLDAP schemaObject elements/objects.
|
java.util.List<SchemaElement> |
parse(java.io.InputStream schemaIn)
Thread safe method parses a stream of OpenLDAP schemaObject elements/objects.
|
java.util.List<SchemaElement> |
parse(java.lang.String schemaObject)
Thread safe method parses an OpenLDAP schemaObject element/object.
|
private antlrSchemaConverterParser parser
private java.io.PipedOutputStream parserIn
private byte[] buf
private java.io.InputStream schemaIn
private java.lang.Thread producerThread
public SchemaParser()
throws java.io.IOException
java.io.IOException - if the pipe cannot be formedpublic void init()
throws java.io.IOException
java.io.IOException - if a pipe cannot be formed.public void clear()
public java.util.List<SchemaElement> parse(java.lang.String schemaObject) throws java.io.IOException, java.text.ParseException
schemaObject - the String image of a complete schema objectjava.io.IOException - If the schema file can't be processedjava.text.ParseException - If we weren't able to parse the schemaprivate java.util.List<SchemaElement> invokeParser(java.lang.String schemaName) throws java.io.IOException, java.text.ParseException
schemaName - The schema to be parsedjava.io.IOException - If the schema file can't be processedjava.text.ParseException - If we weren't able to parse the schemapublic java.util.List<SchemaElement> parse(java.io.InputStream schemaIn) throws java.io.IOException, java.text.ParseException
schemaIn - a stream of schema objectsjava.io.IOException - If the schema file can't be processedjava.text.ParseException - If we weren't able to parse the schemapublic void parse(java.io.File schemaFile)
throws java.io.IOException,
java.text.ParseException
schemaFile - a file of schema objectsjava.io.IOException - If the schema file can't be processedjava.text.ParseException - If we weren't able to parse the schema