|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xerces.impl.xs.XMLSchemaLoader
public class XMLSchemaLoader
This class implements xni.grammars.XMLGrammarLoader. It also serves as implementation of xs.XSLoader interface and DOMConfiguration interface. This class is designed to interact either with a proxy for a user application which wants to preparse schemas, or with our own Schema validator. It is hoped that none of these "external" classes will therefore need to communicate directly with XSDHandler in future.
This class only knows how to make XSDHandler do its thing. The caller must ensure that all its properties (schemaLocation, JAXPSchemaSource etc.) have been properly set.
| Field Summary | |
|---|---|
static java.lang.String |
ENTITY_RESOLVER
Property identifier: entity resolver. |
static java.lang.String |
ERROR_REPORTER
Property identifier: error reporter. |
static java.lang.String |
SYMBOL_TABLE
Property identifier: symbol table. |
static java.lang.String |
XMLGRAMMAR_POOL
Property identifier: grammar pool. |
| Constructor Summary | |
|---|---|
XMLSchemaLoader()
|
|
XMLSchemaLoader(SymbolTable symbolTable)
|
|
| Method Summary | |
|---|---|
boolean |
canSetParameter(java.lang.String name,
java.lang.Object value)
Check if setting a parameter to a specific value is supported. |
DOMConfiguration |
getConfig()
The configuration of a document. |
XMLEntityResolver |
getEntityResolver()
Returns the registered entity resolver. |
XMLErrorHandler |
getErrorHandler()
Returns the registered error handler. |
boolean |
getFeature(java.lang.String featureId)
Returns the state of a feature. |
java.lang.Boolean |
getFeatureDefault(java.lang.String featureId)
Returns the default state for a feature, or null if this component does not want to report a default value for this feature. |
java.util.Locale |
getLocale()
Return the Locale the XMLGrammarLoader is using. |
java.lang.Object |
getParameter(java.lang.String name)
Return the value of a parameter if known. |
DOMStringList |
getParameterNames()
The list of the parameters supported by this DOMConfiguration object and for which at least one value
can be set by the application. |
java.lang.Object |
getProperty(java.lang.String propertyId)
Returns the state of a property. |
java.lang.Object |
getPropertyDefault(java.lang.String propertyId)
Returns the default state for a property, or null if this component does not want to report a default value for this property. |
java.lang.String[] |
getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this XMLGrammarLoader. |
java.lang.String[] |
getRecognizedProperties()
Returns a list of property identifiers that are recognized by this XMLGrammarLoader. |
XSModel |
load(LSInput is)
Parse an XML Schema document from a resource identified by a LSInput . |
Grammar |
loadGrammar(XMLInputSource source)
Returns a Grammar object by parsing the contents of the entity pointed to by source. |
void |
loadGrammar(XMLInputSource[] source)
Returns a Grammar object by parsing the contents of the entities pointed to by sources. |
XSModel |
loadInputList(LSInputList is)
Parses the content of XML Schema documents specified as a list of LSInputs. |
XSModel |
loadURI(java.lang.String uri)
Parse an XML Schema document from a location identified by a URI reference. |
XSModel |
loadURIList(StringList uriList)
Parses the content of XML Schema documents specified as the list of URI references. |
static void |
processExternalHints(java.lang.String sl,
java.lang.String nsl,
java.util.Hashtable locations,
XMLErrorReporter er)
|
void |
reset(XMLComponentManager componentManager)
Resets the component. |
static XMLInputSource |
resolveDocument(XSDDescription desc,
java.util.Hashtable locationPairs,
XMLEntityResolver entityResolver)
This method tries to resolve location of the given schema. |
void |
setEntityResolver(XMLEntityResolver entityResolver)
Sets the entity resolver. |
void |
setErrorHandler(XMLErrorHandler errorHandler)
Sets the error handler. |
void |
setFeature(java.lang.String featureId,
boolean state)
Sets the state of a feature. |
void |
setLocale(java.util.Locale locale)
Set the locale to use for messages. |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Set the value of a parameter. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object state)
Sets the state of a property. |
static boolean |
tokenizeSchemaLocationStr(java.lang.String schemaStr,
java.util.Hashtable locations)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SYMBOL_TABLE
public static final java.lang.String ERROR_REPORTER
public static final java.lang.String ENTITY_RESOLVER
public static final java.lang.String XMLGRAMMAR_POOL
| Constructor Detail |
|---|
public XMLSchemaLoader()
public XMLSchemaLoader(SymbolTable symbolTable)
| Method Detail |
|---|
public java.lang.String[] getRecognizedFeatures()
getRecognizedFeatures in interface XMLGrammarLoadergetRecognizedFeatures in interface XMLComponent
public boolean getFeature(java.lang.String featureId)
throws XMLConfigurationException
getFeature in interface XMLGrammarLoaderfeatureId - The feature identifier.
XMLConfigurationException - Thrown on configuration error.
public void setFeature(java.lang.String featureId,
boolean state)
throws XMLConfigurationException
setFeature in interface XMLGrammarLoadersetFeature in interface XMLComponentfeatureId - The feature identifier.state - The state of the feature.
XMLConfigurationException - Thrown when a feature is not
recognized or cannot be set.public java.lang.String[] getRecognizedProperties()
getRecognizedProperties in interface XMLGrammarLoadergetRecognizedProperties in interface XMLComponent
public java.lang.Object getProperty(java.lang.String propertyId)
throws XMLConfigurationException
getProperty in interface XMLGrammarLoaderpropertyId - The property identifier.
XMLConfigurationException - Thrown on configuration error.
public void setProperty(java.lang.String propertyId,
java.lang.Object state)
throws XMLConfigurationException
setProperty in interface XMLGrammarLoadersetProperty in interface XMLComponentpropertyId - The property identifier.state - The state of the property.
XMLConfigurationException - Thrown when a property is not
recognized or cannot be set.public void setLocale(java.util.Locale locale)
setLocale in interface XMLGrammarLoaderlocale - The locale object to use for localization of messages.
XNIException - Thrown if the parser does not support the
specified locale.public java.util.Locale getLocale()
getLocale in interface XMLGrammarLoaderpublic void setErrorHandler(XMLErrorHandler errorHandler)
setErrorHandler in interface XMLGrammarLoadererrorHandler - The error handler.public XMLErrorHandler getErrorHandler()
getErrorHandler in interface XMLGrammarLoaderpublic void setEntityResolver(XMLEntityResolver entityResolver)
setEntityResolver in interface XMLGrammarLoaderentityResolver - The new entity resolver.public XMLEntityResolver getEntityResolver()
getEntityResolver in interface XMLGrammarLoader
public void loadGrammar(XMLInputSource[] source)
throws java.io.IOException,
XNIException
source - the locations of the entity which forms
the staring point of the grammars to be constructed
java.io.IOException - when a problem is encounted reading the entity
XNIException - when a condition arises (such as a FatalError) that requires parsing
of the entity be terminated
public Grammar loadGrammar(XMLInputSource source)
throws java.io.IOException,
XNIException
loadGrammar in interface XMLGrammarLoadersource - the location of the entity which forms
the starting point of the grammar to be constructed.
java.io.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 static XMLInputSource resolveDocument(XSDDescription desc,
java.util.Hashtable locationPairs,
XMLEntityResolver entityResolver)
throws java.io.IOException
desc - locationPairs - entityResolver -
java.io.IOException
public static void processExternalHints(java.lang.String sl,
java.lang.String nsl,
java.util.Hashtable locations,
XMLErrorReporter er)
public static boolean tokenizeSchemaLocationStr(java.lang.String schemaStr,
java.util.Hashtable locations)
public java.lang.Boolean getFeatureDefault(java.lang.String featureId)
XMLComponent
getFeatureDefault in interface XMLComponentfeatureId - The feature identifier.public java.lang.Object getPropertyDefault(java.lang.String propertyId)
XMLComponent
getPropertyDefault in interface XMLComponentpropertyId - The property identifier.
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException
XMLComponent
reset in interface XMLComponentcomponentManager - The component manager.
XMLConfigurationExceptionpublic DOMConfiguration getConfig()
XSLoaderDOMConfiguration interface:
error-handler (DOMErrorHandler) and
resource-resolver (LSResourceResolver).
"validate"truefalse
getConfig in interface XSLoaderpublic XSModel load(LSInput is)
XSLoaderLSInput .
load in interface XSLoaderis - The LSInput from which the source
document is to be read.
public XSModel loadInputList(LSInputList is)
XSLoaderLSInputs.
loadInputList in interface XSLoaderis - The list of LSInputs from which the XML
Schema documents are to be read.
public XSModel loadURI(java.lang.String uri)
XSLoader
loadURI in interface XSLoaderuri - The location of the XML Schema document to be read.
public XSModel loadURIList(StringList uriList)
XSLoader
loadURIList in interface XSLoaderuriList - The list of URI locations.
public boolean canSetParameter(java.lang.String name,
java.lang.Object value)
DOMConfiguration
canSetParameter in interface DOMConfigurationname - The name of the parameter to check.value - An object. if null, the returned value is
true.
true if the parameter could be successfully set
to the specified value, or false if the parameter is
not recognized or the requested value is not supported. This does
not change the current value of the parameter itself.
public java.lang.Object getParameter(java.lang.String name)
throws DOMException
DOMConfiguration
getParameter in interface DOMConfigurationname - The name of the parameter.
null if no object has been associated or if the
parameter is not supported.
DOMException - NOT_FOUND_ERR: Raised when the parameter name is not recognized.public DOMStringList getParameterNames()
DOMConfigurationDOMConfiguration object and for which at least one value
can be set by the application. Note that this list can also contain
parameter names defined outside this specification.
getParameterNames in interface DOMConfiguration
public void setParameter(java.lang.String name,
java.lang.Object value)
throws DOMException
DOMConfiguration
setParameter in interface DOMConfigurationname - The name of the parameter to set.value - The new value or null if the user wishes to
unset the parameter. While the type of the value parameter is
defined as DOMUserData, the object type must match the
type defined by the definition of the parameter. For example, if
the parameter is "error-handler", the value must be of type
DOMErrorHandler.
DOMException - NOT_FOUND_ERR: Raised when the parameter name is not recognized.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||