public class SchemaParser extends 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 PipedOutputStream |
parserIn
A pipe into the parser
|
private Thread |
producerThread
The thread used to read the schema
|
private 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 List<SchemaElement> |
invokeParser(String schemaName)
Invoke the parser
|
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.
|
private antlrSchemaConverterParser parser
private PipedOutputStream parserIn
private byte[] buf
private InputStream schemaIn
private Thread producerThread
public SchemaParser()
throws IOException
IOException - if the pipe cannot be formedpublic void init()
throws IOException
IOException - if a pipe cannot be formed.public void clear()
public List<SchemaElement> parse(String schemaObject) throws IOException, ParseException
schemaObject - the String image of a complete schema objectIOException - If the schema file can't be processedParseException - If we weren't able to parse the schemaprivate List<SchemaElement> invokeParser(String schemaName) throws IOException, ParseException
schemaName - The schema to be parsedIOException - If the schema file can't be processedParseException - If we weren't able to parse the schemapublic List<SchemaElement> parse(InputStream schemaIn) throws IOException, ParseException
schemaIn - a stream of schema objectsIOException - If the schema file can't be processedParseException - If we weren't able to parse the schemapublic void parse(File schemaFile) throws IOException, ParseException
schemaFile - a file of schema objectsIOException - If the schema file can't be processedParseException - If we weren't able to parse the schemaCopyright © 2003–2019 The Apache Software Foundation. All rights reserved.