|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xerces.parsers.XMLGrammarPreparser
public class XMLGrammarPreparser
This class provides an easy way for a user to preparse grammars of various types. By default, it knows how to preparse external DTD's and schemas; it provides an easy way for user applications to register classes that know how to parse additional grammar types. By default, it does no grammar caching; but it provides ways for user applications to do so.
Constructor Summary | |
---|---|
XMLGrammarPreparser()
Default constructor. |
|
XMLGrammarPreparser(SymbolTable symbolTable)
Constructs a preparser using the specified symbol table. |
Method Summary | |
---|---|
XMLEntityResolver |
getEntityResolver()
Returns the registered entity resolver. |
XMLErrorHandler |
getErrorHandler()
Returns the registered error handler. |
boolean |
getFeature(java.lang.String type,
java.lang.String featureId)
|
XMLGrammarPool |
getGrammarPool()
Returns the registered grammar pool. |
XMLGrammarLoader |
getLoader(java.lang.String type)
|
java.util.Locale |
getLocale()
Return the Locale the XMLGrammarLoader is using. |
java.lang.Object |
getProperty(java.lang.String type,
java.lang.String propertyId)
|
Grammar |
preparseGrammar(java.lang.String type,
XMLInputSource is)
Parse a grammar from a location identified by an XMLInputSource. |
boolean |
registerPreparser(java.lang.String grammarType,
XMLGrammarLoader loader)
|
void |
setEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver. |
void |
setErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler. |
void |
setFeature(java.lang.String featureId,
boolean value)
|
void |
setGrammarPool(XMLGrammarPool grammarPool)
Sets the grammar pool. |
void |
setLocale(java.util.Locale locale)
Set the locale to use for messages. |
void |
setProperty(java.lang.String propId,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLGrammarPreparser()
public XMLGrammarPreparser(SymbolTable symbolTable)
symbolTable
- The symbol table to use.Method Detail |
---|
public boolean registerPreparser(java.lang.String grammarType, XMLGrammarLoader loader)
public Grammar preparseGrammar(java.lang.String type, XMLInputSource is) throws XNIException, java.io.IOException
type
- The type of the grammar to be constructedis
- The XMLInputSource containing this grammar's
information
If a URI is included in the systemId field, the parser will not expand this URI or make it
available to the EntityResolver
Grammar
.
XNIException
- thrown on an error in grammar
construction
java.io.IOException
- thrown if an error is encountered
in reading the filepublic void setLocale(java.util.Locale locale)
locale
- The locale object to use for localization of messages.
XNIException
- Thrown if the parser does not support the
specified locale.public java.util.Locale getLocale()
public void setErrorHandler(XMLErrorHandler errorHandler)
errorHandler
- The error handler.public XMLErrorHandler getErrorHandler()
public void setEntityResolver(XMLEntityResolver entityResolver)
entityResolver
- The new entity resolver.public XMLEntityResolver getEntityResolver()
public void setGrammarPool(XMLGrammarPool grammarPool)
grammarPool
- The new grammar pool.public XMLGrammarPool getGrammarPool()
public XMLGrammarLoader getLoader(java.lang.String type)
public void setFeature(java.lang.String featureId, boolean value)
public void setProperty(java.lang.String propId, java.lang.Object value)
public boolean getFeature(java.lang.String type, java.lang.String featureId)
public java.lang.Object getProperty(java.lang.String type, java.lang.String propertyId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |