The DTD loader. The loader knows how to build grammars from XMLInputSources.
It extends the DTD processor in order to do this; it's
a separate class because DTD processors don't need to know how
to talk to the outside world in their role as instance-document
helpers.
This component requires the following features and properties. It
know ho to set them if no one else does:from the
- http://xml.org/sax/features/namespaces
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/grammar-pool
- http://apache.org/xml/properties/internal/datatype-validator-factory
BALANCE_SYNTAX_TREES
protected static final String BALANCE_SYNTAX_TREES
Feature identifier: balance syntax trees.
ENTITY_RESOLVER
public static final String ENTITY_RESOLVER
Property identifier: entity resolver.
ERROR_HANDLER
protected static final String ERROR_HANDLER
Property identifier: error handler.
STANDARD_URI_CONFORMANT_FEATURE
protected static final String STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: standard uri conformant feature.
fEntityResolver
protected org.apache.xerces.xni.parser.XMLEntityResolver fEntityResolver
Entity resolver .
fLocale
protected Locale fLocale
getEntityResolver
public org.apache.xerces.xni.parser.XMLEntityResolver getEntityResolver()
Returns the registered entity resolver.
- getEntityResolver in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
getErrorHandler
public org.apache.xerces.xni.parser.XMLErrorHandler getErrorHandler()
Returns the registered error handler.
- getErrorHandler in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
getFeature
public boolean getFeature(String featureId)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Returns the state of a feature.
- getFeature in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
featureId
- The feature identifier.
org.apache.xerces.xni.parser.XMLConfigurationException
- Thrown on configuration error.
getLocale
public Locale getLocale()
Return the Locale the XMLGrammarLoader is using.
- getLocale in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
getProperty
public Object getProperty(String propertyId)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Returns the state of a property.
- getProperty in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
propertyId
- The property identifier.
org.apache.xerces.xni.parser.XMLConfigurationException
- Thrown on configuration error.
getRecognizedFeatures
public String[] getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this component. This method may return null if no features
are recognized by this component.
- getRecognizedFeatures in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
- getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponent
- getRecognizedFeatures in interface XMLDTDProcessor
getRecognizedProperties
public String[] getRecognizedProperties()
Returns a list of property identifiers that are recognized by
this component. This method may return null if no properties
are recognized by this component.
- getRecognizedProperties in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
- getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponent
- getRecognizedProperties in interface XMLDTDProcessor
getScannerVersion
protected short getScannerVersion()
loadGrammar
public org.apache.xerces.xni.grammars.Grammar loadGrammar(org.apache.xerces.xni.parser.XMLInputSource source)
throws IOException,
org.apache.xerces.xni.XNIException
Returns a Grammar object by parsing the contents of the
entity pointed to by source.
- loadGrammar in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
source
- the location of the entity which forms
the starting point of the grammar to be constructed.
loadGrammarWithContext
public void loadGrammarWithContext(XMLDTDValidator validator,
String rootName,
String publicId,
String systemId,
String baseSystemId,
String internalSubset)
throws IOException,
org.apache.xerces.xni.XNIException
Parse a DTD internal and/or external subset and insert the content
into the existing DTD grammar owned by the given DTDValidator.
setEntityResolver
public void setEntityResolver(org.apache.xerces.xni.parser.XMLEntityResolver entityResolver)
Sets the entity resolver.
- setEntityResolver in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
entityResolver
- The new entity resolver.
setErrorHandler
public void setErrorHandler(org.apache.xerces.xni.parser.XMLErrorHandler errorHandler)
Sets the error handler.
- setErrorHandler in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
errorHandler
- The error handler.
setFeature
public void setFeature(String featureId,
boolean state)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the state of a feature. This method is called by the component
manager any time after reset when a feature changes state.
Note: Components should silently ignore features
that do not affect the operation of the component.
- setFeature in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
- setFeature in interface org.apache.xerces.xni.parser.XMLComponent
- setFeature in interface XMLDTDProcessor
featureId
- The feature identifier.state
- The state of the feature.
setLocale
public void setLocale(Locale locale)
Set the locale to use for messages.
- setLocale in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
locale
- The locale object to use for localization of messages.
setProperty
public void setProperty(String propertyId,
Object value)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the value of a property. This method is called by the component
manager any time after reset when a property changes value.
Note: Components should silently ignore properties
that do not affect the operation of the component.
- setProperty in interface org.apache.xerces.xni.grammars.XMLGrammarLoader
- setProperty in interface org.apache.xerces.xni.parser.XMLComponent
- setProperty in interface XMLDTDProcessor
propertyId
- The property identifier.value
- The value of the property.