public class GrammarLoader extends Object
The static version of loadVGM/loadSchema methods provides simple ways to load a grammar.
Another way to use GrammarLoader is
Constructor and Description |
---|
GrammarLoader() |
Modifier and Type | Method and Description |
---|---|
Controller |
getController() |
ExpressionPool |
getPool() |
SAXParserFactory |
getSAXParserFactory() |
boolean |
getStrictCheck() |
static Grammar |
loadSchema(InputSource source) |
static Grammar |
loadSchema(InputSource source,
GrammarReaderController controller)
returns a thread-safe AGM object, depending on the language used.
|
static Grammar |
loadSchema(InputSource source,
GrammarReaderController controller,
SAXParserFactory factory) |
static Grammar |
loadSchema(String url)
parses the specified schema and returns the result as a Grammar object.
|
static Grammar |
loadSchema(String source,
GrammarReaderController controller)
returns a thread-safe AGM object, depending on the language used.
|
static Grammar |
loadSchema(String url,
GrammarReaderController controller,
SAXParserFactory factory)
parses the specified schema and returns the result as a Grammar object.
|
static REDocumentDeclaration |
loadVGM(InputSource source) |
static REDocumentDeclaration |
loadVGM(InputSource source,
GrammarReaderController controller,
SAXParserFactory factory) |
static REDocumentDeclaration |
loadVGM(String url)
parses the specified schema and returns the result as a VGM.
|
static REDocumentDeclaration |
loadVGM(String url,
GrammarReaderController controller,
SAXParserFactory factory)
parses the specified schema and returns the result as a VGM.
|
Grammar |
parse(InputSource source) |
Grammar |
parse(String url) |
REDocumentDeclaration |
parseVGM(InputSource source) |
REDocumentDeclaration |
parseVGM(String url) |
void |
setController(GrammarReaderController controller)
sets the GrammarReaderController object that will control
various aspects of the parsing.
|
void |
setPool(ExpressionPool pool)
Sets the ExpressionPool object that will be used during the loading process.
|
void |
setSAXParserFactory(SAXParserFactory factory)
sets the factory object which is used to create XML parsers
to parse schema files.
|
void |
setStrictCheck(boolean value)
Sets the strict check flag.
|
public static REDocumentDeclaration loadVGM(String url, GrammarReaderController controller, SAXParserFactory factory) throws SAXException, ParserConfigurationException, IOException
SAXException
ParserConfigurationException
IOException
public static REDocumentDeclaration loadVGM(InputSource source, GrammarReaderController controller, SAXParserFactory factory) throws SAXException, ParserConfigurationException, IOException
public static REDocumentDeclaration loadVGM(String url) throws SAXException, ParserConfigurationException, IOException
SAXException
ParserConfigurationException
IOException
public static REDocumentDeclaration loadVGM(InputSource source) throws SAXException, ParserConfigurationException, IOException
public static Grammar loadSchema(String url, GrammarReaderController controller, SAXParserFactory factory) throws SAXException, ParserConfigurationException, IOException
SAXException
ParserConfigurationException
IOException
public static Grammar loadSchema(InputSource source, GrammarReaderController controller, SAXParserFactory factory) throws SAXException, ParserConfigurationException, IOException
public static Grammar loadSchema(String source, GrammarReaderController controller) throws SAXException, ParserConfigurationException, IOException
public static Grammar loadSchema(InputSource source, GrammarReaderController controller) throws SAXException, ParserConfigurationException, IOException
public static Grammar loadSchema(String url) throws SAXException, ParserConfigurationException, IOException
SAXException
ParserConfigurationException
IOException
public static Grammar loadSchema(InputSource source) throws SAXException, ParserConfigurationException, IOException
public void setSAXParserFactory(SAXParserFactory factory)
If no SAXParserFactory is set, then the default parser is used. (The parser that can be obtained by SAXParserFactory.newInstance()).
public SAXParserFactory getSAXParserFactory()
public void setController(GrammarReaderController controller)
public Controller getController()
public void setPool(ExpressionPool pool)
public ExpressionPool getPool()
public void setStrictCheck(boolean value)
When this flag is set to false, which is the default, the reader may accept incorrect schemas.
public boolean getStrictCheck()
public Grammar parse(InputSource source) throws SAXException, ParserConfigurationException, IOException
public Grammar parse(String url) throws SAXException, ParserConfigurationException, IOException
public REDocumentDeclaration parseVGM(String url) throws SAXException, ParserConfigurationException, IOException
public REDocumentDeclaration parseVGM(InputSource source) throws SAXException, ParserConfigurationException, IOException
Copyright © 2016 Oracle Corporation. All rights reserved.