public class

XMLDTDLoader

extends XMLDTDProcessor
implements XMLGrammarLoader
java.lang.Object
   ↳ org.apache.xerces.impl.dtd.XMLDTDProcessor
     ↳ org.apache.xerces.impl.dtd.XMLDTDLoader
Known Direct Subclasses

Class Overview

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
@xerces.internal

Summary

Constants
String BALANCE_SYNTAX_TREES Feature identifier: balance syntax trees.
String ENTITY_RESOLVER Property identifier: entity resolver.
String ERROR_HANDLER Property identifier: error handler.
String STANDARD_URI_CONFORMANT_FEATURE Feature identifier: standard uri conformant feature.
[Expand]
Inherited Constants
From class org.apache.xerces.impl.dtd.XMLDTDProcessor
From interface org.apache.xerces.xni.XMLDTDContentModelHandler
From interface org.apache.xerces.xni.XMLDTDHandler
Fields
protected XMLDTDScannerImpl fDTDScanner
protected XMLEntityManager fEntityManager
protected XMLEntityResolver fEntityResolver Entity resolver .
protected Locale fLocale
[Expand]
Inherited Fields
From class org.apache.xerces.impl.dtd.XMLDTDProcessor
Public Constructors
XMLDTDLoader()
Deny default construction; we need a SymtolTable!
XMLDTDLoader(SymbolTable symbolTable)
XMLDTDLoader(SymbolTable symbolTable, XMLGrammarPool grammarPool)
Public Methods
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.
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.
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.
Protected Methods
XMLDTDScannerImpl createDTDScanner(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager)
short getScannerVersion()
void reset()
[Expand]
Inherited Methods
From class org.apache.xerces.impl.dtd.XMLDTDProcessor
From class java.lang.Object
From interface org.apache.xerces.xni.XMLDTDContentModelHandler
From interface org.apache.xerces.xni.XMLDTDHandler
From interface org.apache.xerces.xni.grammars.XMLGrammarLoader
From interface org.apache.xerces.xni.parser.XMLComponent
From interface org.apache.xerces.xni.parser.XMLDTDContentModelSource
From interface org.apache.xerces.xni.parser.XMLDTDSource

Constants

protected static final String BALANCE_SYNTAX_TREES

Feature identifier: balance syntax trees.

Constant Value: "http://apache.org/xml/features/validation/balance-syntax-trees"

public static final String ENTITY_RESOLVER

Property identifier: entity resolver.

Constant Value: "http://apache.org/xml/properties/internal/entity-resolver"

protected static final String ERROR_HANDLER

Property identifier: error handler.

Constant Value: "http://apache.org/xml/properties/internal/error-handler"

protected static final String STANDARD_URI_CONFORMANT_FEATURE

Feature identifier: standard uri conformant feature.

Constant Value: "http://apache.org/xml/features/standard-uri-conformant"

Fields

protected XMLDTDScannerImpl fDTDScanner

protected XMLEntityManager fEntityManager

protected XMLEntityResolver fEntityResolver

Entity resolver .

protected Locale fLocale

Public Constructors

public XMLDTDLoader ()

Deny default construction; we need a SymtolTable!

public XMLDTDLoader (SymbolTable symbolTable)

public XMLDTDLoader (SymbolTable symbolTable, XMLGrammarPool grammarPool)

Public Methods

public XMLEntityResolver getEntityResolver ()

Returns the registered entity resolver.

public XMLErrorHandler getErrorHandler ()

Returns the registered error handler.

public boolean getFeature (String featureId)

Returns the state of a feature.

Parameters
featureId The feature identifier.
Throws
XMLConfigurationException Thrown on configuration error.

public Locale getLocale ()

Return the Locale the XMLGrammarLoader is using.

public Object getProperty (String propertyId)

Returns the state of a property.

Parameters
propertyId The property identifier.
Throws
XMLConfigurationException Thrown on configuration error.

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.

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.

public Grammar loadGrammar (XMLInputSource source)

Returns a Grammar object by parsing the contents of the entity pointed to by source.

Parameters
source the location of the entity which forms the starting point of the grammar to be constructed.
Throws
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)

Parse a DTD internal and/or external subset and insert the content into the existing DTD grammar owned by the given DTDValidator.

public void setEntityResolver (XMLEntityResolver entityResolver)

Sets the entity resolver.

Parameters
entityResolver The new entity resolver.

public void setErrorHandler (XMLErrorHandler errorHandler)

Sets the error handler.

Parameters
errorHandler The error handler.

public void setFeature (String featureId, boolean state)

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.

Parameters
featureId The feature identifier.
state The state of the feature.
Throws
The component should not throw this exception.
The component should not throw this exception.
XMLConfigurationException

public void setLocale (Locale locale)

Set the locale to use for messages.

Parameters
locale The locale object to use for localization of messages.
Throws
XNIException Thrown if the parser does not support the specified locale.

public void setProperty (String propertyId, Object value)

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.

Parameters
propertyId The property identifier.
value The value of the property.
Throws
The component should not throw this exception.
The component should not throw this exception.
XMLConfigurationException

Protected Methods

protected XMLDTDScannerImpl createDTDScanner (SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager)

protected short getScannerVersion ()

protected void reset ()