org.apache.xerces.impl.dtd

Class XMLDTDLoader

public class XMLDTDLoader extends XMLDTDProcessor implements XMLGrammarLoader

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

Version: $Id: XMLDTDLoader.java,v 1.11 2004/10/04 21:57:30 mrglavas Exp $

Author: Neil Graham, IBM

UNKNOWN:

Field Summary
static StringENTITY_RESOLVER
Property identifier: entity resolver.
protected static StringERROR_HANDLER
Property identifier: error handler.
protected XMLDTDScannerImplfDTDScanner
protected XMLEntityManagerfEntityManager
protected XMLEntityResolverfEntityResolver
Entity resolver .
protected LocalefLocale
protected static StringSTANDARD_URI_CONFORMANT_FEATURE
Feature identifier: standard uri conformant feature.
Constructor Summary
XMLDTDLoader()
Deny default construction; we need a SymtolTable!
XMLDTDLoader(SymbolTable symbolTable)
XMLDTDLoader(SymbolTable symbolTable, XMLGrammarPool grammarPool)
Method Summary
XMLEntityResolvergetEntityResolver()
Returns the registered entity resolver.
XMLErrorHandlergetErrorHandler()
Returns the registered error handler.
booleangetFeature(String featureId)
Returns the state of a feature.
LocalegetLocale()
Return the Locale the XMLGrammarLoader is using.
ObjectgetProperty(String propertyId)
Returns the state of a property.
String[]getRecognizedProperties()
Returns a list of property identifiers that are recognized by this component.
GrammarloadGrammar(XMLInputSource source)
Returns a Grammar object by parsing the contents of the entity pointed to by source.
protected voidreset()
voidsetEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver.
voidsetErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler.
voidsetFeature(String featureId, boolean state)
Sets the state of a feature.
voidsetLocale(Locale locale)
Set the locale to use for messages.
voidsetProperty(String propertyId, Object value)
Sets the value of a property.

Field Detail

ENTITY_RESOLVER

public static final String ENTITY_RESOLVER
Property identifier: entity resolver.

ERROR_HANDLER

protected static final String ERROR_HANDLER
Property identifier: error handler.

fDTDScanner

protected XMLDTDScannerImpl fDTDScanner

fEntityManager

protected XMLEntityManager fEntityManager

fEntityResolver

protected XMLEntityResolver fEntityResolver
Entity resolver .

fLocale

protected Locale fLocale

STANDARD_URI_CONFORMANT_FEATURE

protected static final String STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: standard uri conformant feature.

Constructor Detail

XMLDTDLoader

public XMLDTDLoader()
Deny default construction; we need a SymtolTable!

XMLDTDLoader

public XMLDTDLoader(SymbolTable symbolTable)

XMLDTDLoader

public XMLDTDLoader(SymbolTable symbolTable, XMLGrammarPool grammarPool)

Method Detail

getEntityResolver

public XMLEntityResolver getEntityResolver()
Returns the registered entity resolver.

getErrorHandler

public XMLErrorHandler getErrorHandler()
Returns the registered error handler.

getFeature

public boolean getFeature(String featureId)
Returns the state of a feature.

Parameters: featureId The feature identifier.

Throws: XMLConfigurationException Thrown on configuration error.

getLocale

public Locale getLocale()
Return the Locale the XMLGrammarLoader is using.

getProperty

public Object getProperty(String propertyId)
Returns the state of a property.

Parameters: propertyId The property identifier.

Throws: XMLConfigurationException Thrown on configuration error.

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.

loadGrammar

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.

reset

protected void reset()

setEntityResolver

public void setEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver.

Parameters: entityResolver The new entity resolver.

setErrorHandler

public void setErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler.

Parameters: errorHandler The error handler.

setFeature

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: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.

setLocale

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.

setProperty

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: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.

Copyright © 1999-2005 Apache XML Project. All Rights Reserved.