Top Description Methods
org.apache.xerces.xni.grammars

public Interface XMLGrammarLoader

Known Direct Implementers
org.apache.xerces.impl.dtd.XMLDTDLoader, org.apache.xerces.impl.xs.XMLSchemaLoader
Imports
java.io.IOException, java.util.Locale, org.apache.xerces.xni.XNIException, org.apache.xerces.xni.parser.XMLConfigurationException, .XMLEntityResolver, .XMLErrorHandler, .XMLInputSource

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.
Author
Neil Graham, IBM
Version
$Id: XMLGrammarLoader.java 699892 2008-09-28 21:08:27Z mrglavas $

Method Summary

Modifier and TypeMethod and Description
public XMLEntityResolver
getEntityResolver()

Returns the registered entity resolver.

public XMLErrorHandler
getErrorHandler()

Returns the registered error handler.

public boolean
getFeature(String
The feature identifier.
featureId
)

Returns the state of a feature.

public Locale
getLocale()

Return the Locale the XMLGrammarLoader is using.

public Object
getProperty(String
The property identifier.
propertyId
)

Returns the state of a property.

public String[]
getRecognizedFeatures()

Returns a list of feature identifiers that are recognized by this XMLGrammarLoader.

public String[]
getRecognizedProperties()

Returns a list of property identifiers that are recognized by this XMLGrammarLoader.

public Grammar
loadGrammar(XMLInputSource
the location of the entity which forms the starting point of the grammar to be constructed.
source
)

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

public void
setEntityResolver(XMLEntityResolver
The new entity resolver.
entityResolver
)

Sets the entity resolver.

public void
setErrorHandler(XMLErrorHandler
The error handler.
errorHandler
)

Sets the error handler.

public void
setFeature(String
The feature identifier.
featureId
,
boolean
The state of the feature.
state
)

Sets the state of a feature.

public void
setLocale(Locale
The locale object to use for localization of messages.
locale
)

Set the locale to use for messages.

public void
setProperty(String
The property identifier.
propertyId
,
Object
The state of the property.
state
)

Sets the state of a property.

Method Detail

getEntityResolverback to summary
public XMLEntityResolver getEntityResolver()

Returns the registered entity resolver.

getErrorHandlerback to summary
public XMLErrorHandler getErrorHandler()

Returns the registered error handler.

getFeatureback to summary
public boolean getFeature(String featureId) throws XMLConfigurationException

Returns the state of a feature.

Parameters
featureId:String

The feature identifier.

Exceptions
XMLConfigurationException:
Thrown on configuration error.
getLocaleback to summary
public Locale getLocale()

Return the Locale the XMLGrammarLoader is using.

getPropertyback to summary
public Object getProperty(String propertyId) throws XMLConfigurationException

Returns the state of a property.

Parameters
propertyId:String

The property identifier.

Exceptions
XMLConfigurationException:
Thrown on configuration error.
getRecognizedFeaturesback to summary
public String[] getRecognizedFeatures()

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

getRecognizedPropertiesback to summary
public String[] getRecognizedProperties()

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

loadGrammarback to summary
public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException

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

Parameters
source:XMLInputSource

the location of the entity which forms the starting point of the grammar to be constructed.

Exceptions
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.
setEntityResolverback to summary
public void setEntityResolver(XMLEntityResolver entityResolver)

Sets the entity resolver.

Parameters
entityResolver:XMLEntityResolver

The new entity resolver.

setErrorHandlerback to summary
public void setErrorHandler(XMLErrorHandler errorHandler)

Sets the error handler.

Parameters
errorHandler:XMLErrorHandler

The error handler.

setFeatureback to summary
public void setFeature(String featureId, boolean state) throws XMLConfigurationException

Sets the state of a feature.

Parameters
featureId:String

The feature identifier.

state:boolean

The state of the feature.

Exceptions
XMLConfigurationException:
Thrown when a feature is not recognized or cannot be set.
setLocaleback to summary
public void setLocale(Locale locale)

Set the locale to use for messages.

Parameters
locale:Locale

The locale object to use for localization of messages.

Exceptions
XNIException:
Thrown if the parser does not support the specified locale.
setPropertyback to summary
public void setProperty(String propertyId, Object state) throws XMLConfigurationException

Sets the state of a property.

Parameters
propertyId:String

The property identifier.

state:Object

The state of the property.

Exceptions
XMLConfigurationException:
Thrown when a property is not recognized or cannot be set.