public interface

XMLGrammarLoader

org.apache.xerces.xni.grammars.XMLGrammarLoader
Known Indirect Subclasses

Class Overview

The intention of this interface is to provide a generic means by which Grammar objects may be created without parsing instance documents. Implementations of this interface will know how to load specific types of grammars (e.g., DTD's or schemas); a wrapper will be provided for user applications to interact with these implementations.

Summary

Public Methods
abstract XMLEntityResolver getEntityResolver()
Returns the registered entity resolver.
abstract XMLErrorHandler getErrorHandler()
Returns the registered error handler.
abstract boolean getFeature(String featureId)
Returns the state of a feature.
abstract Locale getLocale()
Return the Locale the XMLGrammarLoader is using.
abstract Object getProperty(String propertyId)
Returns the state of a property.
abstract String[] getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this XMLGrammarLoader.
abstract String[] getRecognizedProperties()
Returns a list of property identifiers that are recognized by this XMLGrammarLoader.
abstract Grammar loadGrammar(XMLInputSource source)
Returns a Grammar object by parsing the contents of the entity pointed to by source.
abstract void setEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver.
abstract void setErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler.
abstract void setFeature(String featureId, boolean state)
Sets the state of a feature.
abstract void setLocale(Locale locale)
Set the locale to use for messages.
abstract void setProperty(String propertyId, Object state)
Sets the state of a property.

Public Methods

public abstract XMLEntityResolver getEntityResolver ()

Returns the registered entity resolver.

public abstract XMLErrorHandler getErrorHandler ()

Returns the registered error handler.

public abstract boolean getFeature (String featureId)

Returns the state of a feature.

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

public abstract Locale getLocale ()

Return the Locale the XMLGrammarLoader is using.

public abstract Object getProperty (String propertyId)

Returns the state of a property.

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

public abstract String[] getRecognizedFeatures ()

Returns a list of feature identifiers that are recognized by this XMLGrammarLoader. This method may return null if no features are recognized.

public abstract String[] getRecognizedProperties ()

Returns a list of property identifiers that are recognized by this XMLGrammarLoader. This method may return null if no properties are recognized.

public abstract 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 abstract void setEntityResolver (XMLEntityResolver entityResolver)

Sets the entity resolver.

Parameters
entityResolver The new entity resolver.

public abstract void setErrorHandler (XMLErrorHandler errorHandler)

Sets the error handler.

Parameters
errorHandler The error handler.

public abstract void setFeature (String featureId, boolean state)

Sets the state of a feature.

Parameters
featureId The feature identifier.
state The state of the feature.
Throws
XMLConfigurationException Thrown when a feature is not recognized or cannot be set.

public abstract 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 abstract void setProperty (String propertyId, Object state)

Sets the state of a property.

Parameters
propertyId The property identifier.
state The state of the property.
Throws
XMLConfigurationException Thrown when a property is not recognized or cannot be set.