public class XMLDTDLoader extends XMLDTDProcessor implements XMLGrammarLoader
This component requires the following features and properties. It know ho to set them if no one else does:from the
Modifier and Type | Field and Description |
---|---|
protected static String |
BALANCE_SYNTAX_TREES
Feature identifier: balance syntax trees.
|
static String |
ENTITY_RESOLVER
Property identifier: entity resolver.
|
protected static String |
ERROR_HANDLER
Property identifier: error handler.
|
protected XMLDTDScannerImpl |
fDTDScanner |
protected XMLEntityManager |
fEntityManager |
protected XMLEntityResolver |
fEntityResolver
Entity resolver .
|
protected Locale |
fLocale |
protected static String |
STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: standard uri conformant feature.
|
DTD_VALIDATOR, ERROR_REPORTER, fDTDContentModelHandler, fDTDContentModelSource, fDTDGrammar, fDTDHandler, fDTDSource, fDTDValidation, fErrorReporter, fGrammarBucket, fGrammarPool, fInDTDIgnore, fSymbolTable, fValidation, fValidator, fWarnDuplicateAttdef, fWarnOnUndeclaredElemdef, GRAMMAR_POOL, NOTIFY_CHAR_REFS, PARSER_SETTINGS, SYMBOL_TABLE, VALIDATION, WARN_ON_DUPLICATE_ATTDEF, WARN_ON_UNDECLARED_ELEMDEF
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
Constructor and Description |
---|
XMLDTDLoader()
Deny default construction; we need a SymtolTable!
|
XMLDTDLoader(SymbolTable symbolTable) |
XMLDTDLoader(SymbolTable symbolTable,
XMLGrammarPool grammarPool) |
Modifier and Type | Method and Description |
---|---|
protected XMLDTDScannerImpl |
createDTDScanner(SymbolTable symbolTable,
XMLErrorReporter errorReporter,
XMLEntityManager entityManager) |
XMLEntityResolver |
getEntityResolver()
Returns the registered entity resolver.
|
XMLErrorHandler |
getErrorHandler()
Returns the registered error handler.
|
boolean |
getFeature(String featureId)
Returns the state of a feature.
|
Locale |
getLocale()
Return the Locale the XMLGrammarLoader is using.
|
Object |
getProperty(String propertyId)
Returns the state of a property.
|
String[] |
getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this component.
|
String[] |
getRecognizedProperties()
Returns a list of property identifiers that are recognized by
this component.
|
protected short |
getScannerVersion() |
Grammar |
loadGrammar(XMLInputSource source)
Returns a Grammar object by parsing the contents of the
entity pointed to by source.
|
void |
loadGrammarWithContext(XMLDTDValidator validator,
String rootName,
String publicId,
String systemId,
String baseSystemId,
String internalSubset)
Parse a DTD internal and/or external subset and insert the content
into the existing DTD grammar owned by the given DTDValidator.
|
protected void |
reset() |
void |
setEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver.
|
void |
setErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler.
|
void |
setFeature(String featureId,
boolean state)
Sets the state of a feature.
|
void |
setLocale(Locale locale)
Set the locale to use for messages.
|
void |
setProperty(String propertyId,
Object value)
Sets the value of a property.
|
any, attributeDecl, checkStandaloneEntityRef, comment, element, elementDecl, empty, endAttlist, endConditional, endContentModel, endDTD, endExternalSubset, endGroup, endParameterEntity, externalEntityDecl, getDTDContentModelHandler, getDTDContentModelSource, getDTDHandler, getDTDSource, getFeatureDefault, getPropertyDefault, ignoredCharacters, internalEntityDecl, isValidName, isValidNmtoken, notationDecl, occurrence, pcdata, processingInstruction, reset, separator, setDTDContentModelHandler, setDTDContentModelSource, setDTDHandler, setDTDSource, startAttlist, startConditional, startContentModel, startDTD, startExternalSubset, startGroup, startParameterEntity, textDecl, unparsedEntityDecl
protected static final String STANDARD_URI_CONFORMANT_FEATURE
protected static final String BALANCE_SYNTAX_TREES
protected static final String ERROR_HANDLER
public static final String ENTITY_RESOLVER
protected XMLEntityResolver fEntityResolver
protected XMLDTDScannerImpl fDTDScanner
protected XMLEntityManager fEntityManager
protected Locale fLocale
public XMLDTDLoader()
public XMLDTDLoader(SymbolTable symbolTable)
public XMLDTDLoader(SymbolTable symbolTable, XMLGrammarPool grammarPool)
public String[] getRecognizedFeatures()
getRecognizedFeatures
in interface XMLGrammarLoader
getRecognizedFeatures
in interface XMLComponent
getRecognizedFeatures
in class XMLDTDProcessor
public void setFeature(String featureId, boolean state) throws XMLConfigurationException
Note: Components should silently ignore features that do not affect the operation of the component.
setFeature
in interface XMLGrammarLoader
setFeature
in interface XMLComponent
setFeature
in class XMLDTDProcessor
featureId
- The feature identifier.state
- The state of the feature.SAXNotRecognizedException
- The component should not throw
this exception.SAXNotSupportedException
- The component should not throw
this exception.XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.public String[] getRecognizedProperties()
getRecognizedProperties
in interface XMLGrammarLoader
getRecognizedProperties
in interface XMLComponent
getRecognizedProperties
in class XMLDTDProcessor
public Object getProperty(String propertyId) throws XMLConfigurationException
getProperty
in interface XMLGrammarLoader
propertyId
- The property identifier.XMLConfigurationException
- Thrown on configuration error.public void setProperty(String propertyId, Object value) throws XMLConfigurationException
Note: Components should silently ignore properties that do not affect the operation of the component.
setProperty
in interface XMLGrammarLoader
setProperty
in interface XMLComponent
setProperty
in class XMLDTDProcessor
propertyId
- The property identifier.value
- The value of the property.SAXNotRecognizedException
- The component should not throw
this exception.SAXNotSupportedException
- The component should not throw
this exception.XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.public boolean getFeature(String featureId) throws XMLConfigurationException
getFeature
in interface XMLGrammarLoader
featureId
- The feature identifier.XMLConfigurationException
- Thrown on configuration error.public void setLocale(Locale locale)
setLocale
in interface XMLGrammarLoader
locale
- The locale object to use for localization of messages.XNIException
- Thrown if the parser does not support the
specified locale.public Locale getLocale()
getLocale
in interface XMLGrammarLoader
public void setErrorHandler(XMLErrorHandler errorHandler)
setErrorHandler
in interface XMLGrammarLoader
errorHandler
- The error handler.public XMLErrorHandler getErrorHandler()
getErrorHandler
in interface XMLGrammarLoader
public void setEntityResolver(XMLEntityResolver entityResolver)
setEntityResolver
in interface XMLGrammarLoader
entityResolver
- The new entity resolver.public XMLEntityResolver getEntityResolver()
getEntityResolver
in interface XMLGrammarLoader
public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException
loadGrammar
in interface XMLGrammarLoader
source
- the location of the entity which forms
the starting point of the grammar to be constructed.IOException
- When a problem is encountered reading the entity
XNIException When a condition arises (such as a FatalError) that requires parsing
of the entity be terminated.XNIException
public void loadGrammarWithContext(XMLDTDValidator validator, String rootName, String publicId, String systemId, String baseSystemId, String internalSubset) throws IOException, XNIException
IOException
XNIException
protected void reset()
reset
in class XMLDTDProcessor
protected XMLDTDScannerImpl createDTDScanner(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager)
protected short getScannerVersion()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.