APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs

public Class XMLSchemaLoader

extends Object
implements XMLGrammarLoader, XMLComponent, XSElementDeclHelper, XSLoader, DOMConfiguration
Class Inheritance
All Implemented Interfaces
org.w3c.dom.DOMConfiguration, com.sun.org.apache.xerces.internal.xs.XSLoader, com.sun.org.apache.xerces.internal.impl.xs.XSElementDeclHelper, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent, com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader
Imports
com.sun.org.apache.xerces.internal.dom.DOMErrorImpl, .DOMMessageFormatter, .DOMStringListImpl, com.sun.org.apache.xerces.internal.impl.Constants, .XMLEntityManager, .XMLErrorReporter, com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException, .SchemaDVFactory, com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl, com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder, .CMNodeFactory, com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler, com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper, .DOMErrorHandlerWrapper, .DefaultErrorHandler, .MessageFormatter, .ParserConfigurationSettings, .Status, .SymbolTable, .URI.MalformedURIException, .XMLSymbols, com.sun.org.apache.xerces.internal.xni.QName, .XNIException, com.sun.org.apache.xerces.internal.xni.grammars.Grammar, .XMLGrammarDescription, .XMLGrammarLoader, .XMLGrammarPool, .XSGrammar, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent, .XMLComponentManager, .XMLConfigurationException, .XMLEntityResolver, .XMLErrorHandler, .XMLInputSource, com.sun.org.apache.xerces.internal.xs.LSInputList, .StringList, .XSLoader, .XSModel, java.io.BufferedInputStream, .File, .FileInputStream, .FileNotFoundException, .IOException, .InputStream, .Reader, .StringReader, java.util.ArrayList, .HashMap, .Locale, .Map, .StringTokenizer, .WeakHashMap, javax.xml.XMLConstants, jdk.xml.internal.JdkConstants, .JdkXmlConfig, .JdkXmlUtils, .XMLSecurityManager, .XMLSecurityPropertyManager, .SecuritySupport, org.w3c.dom.DOMConfiguration, .DOMError, .DOMErrorHandler, .DOMException, .DOMStringList, org.w3c.dom.ls.LSInput, .LSResourceResolver, org.xml.sax.InputSource

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.

Author
Neil Graham, IBM

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final String
ACCESS_EXTERNAL_DTD

Property identifier: access to external dtd

public static final String
ACCESS_EXTERNAL_SCHEMA

Property identifier: access to external schema

protected static final String
ALLOW_JAVA_ENCODINGS

Feature identifier: allow java encodings to be recognized when parsing schema docs.

protected static final String
protected static final String
CONTINUE_AFTER_FATAL_ERROR

Feature identifier: continue after fatal error.

protected static final String
DISALLOW_DOCTYPE

Feature: disallow doctype

protected static final String
public static final String
ENTITY_RESOLVER

Property identifier: entity resolver.

public static final String
ERROR_HANDLER

Property identifier: error handler.

public static final String
ERROR_REPORTER

Property identifier: error reporter.

private String
private CMBuilder
private XSDeclarationPool
private XMLEntityManager
private DOMErrorHandlerWrapper
fErrorHandler

DOM L3 error handler

private XMLErrorReporter
private String
private String
private XSGrammarBucket
private XMLGrammarPool
private boolean
private WeakHashMap<Object, SchemaGrammar>
private boolean
private Object
private final ParserConfigurationSettings
private Locale
private final CMNodeFactory
private DOMStringList
private DOMEntityResolverWrapper
fResourceResolver

DOM L3 resource resolver

private XSDHandler
private boolean
private SubstitutionGroupHandler
private XMLEntityResolver
private XSDDescription
protected static final String
GENERATE_SYNTHETIC_ANNOTATIONS

Feature: generate synthetic annotations

protected static final String
HONOUR_ALL_SCHEMALOCATIONS

Feature identifier: honour all schemaLocations

protected static final String
JAXP_SCHEMA_SOURCE

Property identifier: JAXP schema source.

protected static final String
LOCALE

Property identifier: locale.

protected static final String
NAMESPACE_GROWTH

Feature identifier: namespace growth

protected static final String
protected static final String
private static final String[]
private static final String[]
protected static final String
SCHEMA_DV_FACTORY

Property identifier: Schema DV Factory

protected static final String
SCHEMA_FULL_CHECKING

Feature identifier: schema full checking

protected static final String
SCHEMA_LOCATION

Property identifier: schema location.

protected static final String
SCHEMA_NONS_LOCATION

Property identifier: no namespace schema location.

protected static final String
protected static final String
STANDARD_URI_CONFORMANT_FEATURE

Feature identifier: standard uri conformant feature.

public static final String
SYMBOL_TABLE

Property identifier: symbol table.

protected static final String
TOLERATE_DUPLICATES

Feature identifier: tolerate duplicates

protected static final String
VALIDATE_ANNOTATIONS

Feature identifier: validate annotations.

private static final String
XML_SECURITY_PROPERTY_MANAGER

Property identifier: Security property manager.

public static final String
XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constructor Summary

AccessConstructor and Description
public
public
pack-priv
XMLSchemaLoader(XMLErrorReporter errorReporter, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder)

This constractor is used by the XMLSchemaValidator.

pack-priv
XMLSchemaLoader(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityResolver, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder)

Method Summary

Modifier and TypeMethod and Description
public boolean
canSetParameter(String name, Object value)

Implements org.w3c.dom.DOMConfiguration.canSetParameter.

Check if setting a parameter to a specific value is supported.

pack-priv XMLInputSource
public DOMConfiguration
getConfig()

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.getConfig.

The configuration of a document.

public XMLEntityResolver
public XMLErrorHandler
public boolean
getFeature(String
The feature identifier.
featureId
)

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getFeature.

Returns the state of a feature.

public Boolean
getFeatureDefault(String featureId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getFeatureDefault.

Returns the default state for a feature, or null if this component does not want to report a default value for this feature.

public XSElementDecl
public Locale
getLocale()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getLocale.

Return the Locale the XMLGrammarLoader is using.

public Object
getParameter(String name)

Implements org.w3c.dom.DOMConfiguration.getParameter.

Return the value of a parameter if known.

public DOMStringList
getParameterNames()

Implements org.w3c.dom.DOMConfiguration.getParameterNames.

The list of the parameters supported by this DOMConfiguration object and for which at least one value can be set by the application.

public Object
getProperty(String
The property identifier.
propertyId
)

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getProperty.

Returns the state of a property.

public Object
getPropertyDefault(String propertyId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getPropertyDefault.

Returns the default state for a property, or null if this component does not want to report a default value for this property.

public String[]
public String[]
private void
public XSModel
load(LSInput is)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.load.

Parse an XML Schema document from a resource identified by a LSInput .

public void
loadGrammar(XMLInputSource[]
the locations of the entity which forms the staring point of the grammars to be constructed
source
)

Returns a Grammar object by parsing the contents of the entities pointed to by sources.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.loadGrammar.

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

public XSModel
loadInputList(LSInputList is)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadInputList.

Parses the content of XML Schema documents specified as a list of LSInputs.

pack-priv SchemaGrammar

Returns:

An XML Schema grammar
loadSchema
(XSDDescription desc, XMLInputSource source, Map<String, XMLSchemaLoader.LocationArray> locationPairs)

This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.

public XSModel
loadURI(String uri)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadURI.

Parse an XML Schema document from a location identified by a URI reference.

public XSModel
loadURIList(StringList uriList)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadURIList.

Parses the content of XML Schema documents specified as the list of URI references.

public static void
private void
processJAXPSchemaSource(Map<String, XMLSchemaLoader.LocationArray> locationPairs)

Translate the various JAXP SchemaSource property types to XNI XMLInputSource.

pack-priv void
public void
public static XMLInputSource

Returns:

the XMLInputSource
resolveDocument
(XSDDescription desc, Map<String, XMLSchemaLoader.LocationArray> locationPairs, XMLEntityResolver entityResolver)

This method tries to resolve location of the given schema.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setEntityResolver.

Sets the entity resolver.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setFeature, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setFeature.

Sets the state of a feature.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setLocale.

Set the locale to use for messages.

public void
setParameter(String name, Object value)

Implements org.w3c.dom.DOMConfiguration.setParameter.

Set the value of a parameter.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setProperty, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setProperty.

Sets the state of a property.

public static boolean
private XMLInputSource
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACCESS_EXTERNAL_DTDback to summary
public static final String ACCESS_EXTERNAL_DTD

Property identifier: access to external dtd

ACCESS_EXTERNAL_SCHEMAback to summary
public static final String ACCESS_EXTERNAL_SCHEMA

Property identifier: access to external schema

ALLOW_JAVA_ENCODINGSback to summary
protected static final String ALLOW_JAVA_ENCODINGS

Feature identifier: allow java encodings to be recognized when parsing schema docs.

AUGMENT_PSVIback to summary
protected static final String AUGMENT_PSVI
CONTINUE_AFTER_FATAL_ERRORback to summary
protected static final String CONTINUE_AFTER_FATAL_ERROR

Feature identifier: continue after fatal error.

DISALLOW_DOCTYPEback to summary
protected static final String DISALLOW_DOCTYPE

Feature: disallow doctype

ENTITY_MANAGERback to summary
protected static final String ENTITY_MANAGER
ENTITY_RESOLVERback to summary
public static final String ENTITY_RESOLVER

Property identifier: entity resolver.

ERROR_HANDLERback to summary
public static final String ERROR_HANDLER

Property identifier: error handler.

ERROR_REPORTERback to summary
public static final String ERROR_REPORTER

Property identifier: error reporter.

faccessExternalSchemaback to summary
private String faccessExternalSchema
fCMBuilderback to summary
private CMBuilder fCMBuilder
fDeclPoolback to summary
private XSDeclarationPool fDeclPool
fEntityManagerback to summary
private XMLEntityManager fEntityManager
fErrorHandlerback to summary
private DOMErrorHandlerWrapper fErrorHandler

DOM L3 error handler

fErrorReporterback to summary
private XMLErrorReporter fErrorReporter
fExternalNoNSSchemaback to summary
private String fExternalNoNSSchema
fExternalSchemasback to summary
private String fExternalSchemas
fGrammarBucketback to summary
private XSGrammarBucket fGrammarBucket
fGrammarPoolback to summary
private XMLGrammarPool fGrammarPool
fIsCheckedFullyback to summary
private boolean fIsCheckedFully
fJAXPCacheback to summary
private WeakHashMap<Object, SchemaGrammar> fJAXPCache
fJAXPProcessedback to summary
private boolean fJAXPProcessed
fJAXPSourceback to summary
private Object fJAXPSource
fLoaderConfigback to summary
private final ParserConfigurationSettings fLoaderConfig
fLocaleback to summary
private Locale fLocale
fNodeFactoryback to summary
private final CMNodeFactory fNodeFactory
fRecognizedParametersback to summary
private DOMStringList fRecognizedParameters
fResourceResolverback to summary
private DOMEntityResolverWrapper fResourceResolver

DOM L3 resource resolver

fSchemaHandlerback to summary
private XSDHandler fSchemaHandler
fSettingsChangedback to summary
private boolean fSettingsChanged
fSubGroupHandlerback to summary
private SubstitutionGroupHandler fSubGroupHandler
fUserEntityResolverback to summary
private XMLEntityResolver fUserEntityResolver
fXSDDescriptionback to summary
private XSDDescription fXSDDescription
GENERATE_SYNTHETIC_ANNOTATIONSback to summary
protected static final String GENERATE_SYNTHETIC_ANNOTATIONS

Feature: generate synthetic annotations

HONOUR_ALL_SCHEMALOCATIONSback to summary
protected static final String HONOUR_ALL_SCHEMALOCATIONS

Feature identifier: honour all schemaLocations

JAXP_SCHEMA_SOURCEback to summary
protected static final String JAXP_SCHEMA_SOURCE

Property identifier: JAXP schema source.

LOCALEback to summary
protected static final String LOCALE

Property identifier: locale.

NAMESPACE_GROWTHback to summary
protected static final String NAMESPACE_GROWTH

Feature identifier: namespace growth

OVERRIDE_PARSERback to summary
protected static final String OVERRIDE_PARSER
PARSER_SETTINGSback to summary
protected static final String PARSER_SETTINGS
RECOGNIZED_FEATURESback to summary
private static final String[] RECOGNIZED_FEATURES
RECOGNIZED_PROPERTIESback to summary
private static final String[] RECOGNIZED_PROPERTIES
SCHEMA_DV_FACTORYback to summary
protected static final String SCHEMA_DV_FACTORY

Property identifier: Schema DV Factory

SCHEMA_FULL_CHECKINGback to summary
protected static final String SCHEMA_FULL_CHECKING

Feature identifier: schema full checking

SCHEMA_LOCATIONback to summary
protected static final String SCHEMA_LOCATION

Property identifier: schema location.

SCHEMA_NONS_LOCATIONback to summary
protected static final String SCHEMA_NONS_LOCATION

Property identifier: no namespace schema location.

SECURITY_MANAGERback to summary
protected static final String SECURITY_MANAGER
STANDARD_URI_CONFORMANT_FEATUREback to summary
protected static final String STANDARD_URI_CONFORMANT_FEATURE

Feature identifier: standard uri conformant feature.

SYMBOL_TABLEback to summary
public static final String SYMBOL_TABLE

Property identifier: symbol table.

TOLERATE_DUPLICATESback to summary
protected static final String TOLERATE_DUPLICATES

Feature identifier: tolerate duplicates

VALIDATE_ANNOTATIONSback to summary
protected static final String VALIDATE_ANNOTATIONS

Feature identifier: validate annotations.

XML_SECURITY_PROPERTY_MANAGERback to summary
private static final String XML_SECURITY_PROPERTY_MANAGER

Property identifier: Security property manager.

XMLGRAMMAR_POOLback to summary
public static final String XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constructor Detail

XMLSchemaLoaderback to summary
public XMLSchemaLoader()
XMLSchemaLoaderback to summary
public XMLSchemaLoader(SymbolTable symbolTable)
XMLSchemaLoaderback to summary
pack-priv XMLSchemaLoader(XMLErrorReporter errorReporter, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder)

This constractor is used by the XMLSchemaValidator. Additional properties, i.e. XMLEntityManager, will be passed during reset(XMLComponentManager).

XMLSchemaLoaderback to summary
pack-priv XMLSchemaLoader(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityResolver, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder)

Method Detail

canSetParameterback to summary
public boolean canSetParameter(String name, Object value)

Implements org.w3c.dom.DOMConfiguration.canSetParameter.

Doc from org.w3c.dom.DOMConfiguration.canSetParameter.

Check if setting a parameter to a specific value is supported.

dom2xmlInputSourceback to summary
pack-priv XMLInputSource dom2xmlInputSource(LSInput is)
getConfigback to summary
public DOMConfiguration getConfig()

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.getConfig.

Doc from com.sun.org.apache.xerces.internal.xs.XSLoader.getConfig.

The configuration of a document. It maintains a table of recognized parameters. Using the configuration, it is possible to change the behavior of the load methods. The configuration may support the setting of and the retrieval of the following non-boolean parameters defined on the DOMConfiguration interface: error-handler (DOMErrorHandler) and resource-resolver (LSResourceResolver).
The following list of boolean parameters is defined:

"validate"
true
[required] (default) Validate an XML Schema during loading. If validation errors are found, the error handler is notified.
false
[optional] Do not report errors during the loading of an XML Schema document.
getEntityResolverback to summary
public XMLEntityResolver getEntityResolver()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getEntityResolver.

Returns the registered entity resolver.

getErrorHandlerback to summary
public XMLErrorHandler getErrorHandler()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getErrorHandler.

Returns the registered error handler.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getFeature.

Returns the state of a feature.

Parameters
featureId:String

The feature identifier.

Exceptions
XMLConfigurationException:
Thrown on configuration error.
getFeatureDefaultback to summary
public Boolean getFeatureDefault(String featureId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getFeatureDefault.

Doc from com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getFeatureDefault.

Returns the default state for a feature, or null if this component does not want to report a default value for this feature.

getGlobalElementDeclback to summary
public XSElementDecl getGlobalElementDecl(QName element)

Implements com.sun.org.apache.xerces.internal.impl.xs.XSElementDeclHelper.getGlobalElementDecl.

getLocaleback to summary
public Locale getLocale()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getLocale.

Return the Locale the XMLGrammarLoader is using.

getParameterback to summary
public Object getParameter(String name) throws DOMException

Implements org.w3c.dom.DOMConfiguration.getParameter.

Doc from org.w3c.dom.DOMConfiguration.getParameter.

Return the value of a parameter if known.

Exceptions
DOMException:
NOT_FOUND_ERR: Raised when the parameter name is not recognized.
getParameterNamesback to summary
public DOMStringList getParameterNames()

Implements org.w3c.dom.DOMConfiguration.getParameterNames.

Doc from org.w3c.dom.DOMConfiguration.getParameterNames.

The list of the parameters supported by this DOMConfiguration 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.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getProperty.

Returns the state of a property.

Parameters
propertyId:String

The property identifier.

Exceptions
XMLConfigurationException:
Thrown on configuration error.
getPropertyDefaultback to summary
public Object getPropertyDefault(String propertyId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getPropertyDefault.

Doc from com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getPropertyDefault.

Returns the default state for a property, or null if this component does not want to report a default value for this property.

getRecognizedFeaturesback to summary
public String[] getRecognizedFeatures()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getRecognizedFeatures, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.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()

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.getRecognizedProperties, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getRecognizedProperties.

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

initGrammarBucketback to summary
private void initGrammarBucket()
loadback to summary
public XSModel load(LSInput is)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.load.

Doc from com.sun.org.apache.xerces.internal.xs.XSLoader.load.

Parse an XML Schema document from a resource identified by a LSInput .

loadGrammarback to summary
public void loadGrammar(XMLInputSource[] source) throws IOException, XNIException

Returns a Grammar object by parsing the contents of the entities pointed to by sources.

Parameters
source:XMLInputSource[]

the locations of the entity which forms the staring point of the grammars to be constructed

Exceptions
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
loadGrammarback to summary
public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.loadGrammar.

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.
loadInputListback to summary
public XSModel loadInputList(LSInputList is)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadInputList.

Doc from com.sun.org.apache.xerces.internal.xs.XSLoader.loadInputList.

Parses the content of XML Schema documents specified as a list of LSInputs.

loadSchemaback to summary
pack-priv SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source, Map<String, XMLSchemaLoader.LocationArray> locationPairs) throws IOException, XNIException

This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.

Note

in either case, the EntityManager (or EntityResolvers) are not going to be invoked to resolve the location of the schema in XSDDescription

Returns:SchemaGrammar

An XML Schema grammar

loadURIback to summary
public XSModel loadURI(String uri)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadURI.

Doc from com.sun.org.apache.xerces.internal.xs.XSLoader.loadURI.

Parse an XML Schema document from a location identified by a URI reference. If the URI contains a fragment identifier, the behavior is not defined by this specification.

loadURIListback to summary
public XSModel loadURIList(StringList uriList)

Implements com.sun.org.apache.xerces.internal.xs.XSLoader.loadURIList.

Doc from com.sun.org.apache.xerces.internal.xs.XSLoader.loadURIList.

Parses the content of XML Schema documents specified as the list of URI references. If the URI contains a fragment identifier, the behavior is not defined by this specification.

processExternalHintsback to summary
public static void processExternalHints(String sl, String nsl, Map<String, XMLSchemaLoader.LocationArray> locations, XMLErrorReporter er)
processJAXPSchemaSourceback to summary
private void processJAXPSchemaSource(Map<String, XMLSchemaLoader.LocationArray> locationPairs) throws IOException

Translate the various JAXP SchemaSource property types to XNI XMLInputSource. Valid types are: String, org.xml.sax.InputSource, InputStream, File, or Object[] of any of previous types.

Revisit

the JAXP 1.2 spec is less than clear as to whether this property should be available to imported schemas. I have assumed that it should. - NG Note: all JAXP schema files will be checked for full-schema validity if the feature was set up

reportDOMFatalErrorback to summary
pack-priv void reportDOMFatalError(Exception e)
resetback to summary
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.reset.

Doc from com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.reset.

Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.

resolveDocumentback to summary
public static XMLInputSource resolveDocument(XSDDescription desc, Map<String, XMLSchemaLoader.LocationArray> locationPairs, XMLEntityResolver entityResolver) throws IOException

This method tries to resolve location of the given schema. The loader stores the namespace/location pairs in a map (use "" as the namespace of absent namespace). When resolving an entity, loader first tries to find in the map whether there is a value for that namespace, if so, pass that location value to the user-defined entity resolver.

Returns:XMLInputSource

the XMLInputSource

saxToXMLInputSourceback to summary
private static XMLInputSource saxToXMLInputSource(InputSource sis)
setEntityResolverback to summary
public void setEntityResolver(XMLEntityResolver entityResolver)

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setEntityResolver.

Sets the entity resolver.

Parameters
entityResolver:XMLEntityResolver

The new entity resolver.

setErrorHandlerback to summary
public void setErrorHandler(XMLErrorHandler errorHandler)

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setErrorHandler.

Sets the error handler.

Parameters
errorHandler:XMLErrorHandler

The error handler.

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

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setFeature, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setFeature.

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)

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setLocale.

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.
setParameterback to summary
public void setParameter(String name, Object value) throws DOMException

Implements org.w3c.dom.DOMConfiguration.setParameter.

Doc from org.w3c.dom.DOMConfiguration.setParameter.

Set the value of a parameter.

Exceptions
DOMException:
NOT_FOUND_ERR: Raised when the parameter name is not recognized.
NOT_SUPPORTED_ERR: Raised when the parameter name is recognized but the requested value cannot be set.
TYPE_MISMATCH_ERR: Raised if the value type for this parameter name is incompatible with the expected value type.
setPropertyback to summary
public void setProperty(String propertyId, Object state) throws XMLConfigurationException

Implements com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader.setProperty, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setProperty.

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.
tokenizeSchemaLocationStrback to summary
public static boolean tokenizeSchemaLocationStr(String schemaStr, Map<String, XMLSchemaLoader.LocationArray> locations, String base)
xsdToXMLInputSourceback to summary
private XMLInputSource xsdToXMLInputSource(Object val)
com.sun.org.apache.xerces.internal.impl.xs back to summary

public Class XMLSchemaLoader.LocationArray

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.LocationArray

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv String[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addLocation(String location)

public String
public int
public String[]
public void
resize(int oldLength, int newLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lengthback to summary
pack-priv int length
locationsback to summary
pack-priv String[] locations

Constructor Detail

LocationArrayback to summary
public LocationArray()

Method Detail

addLocationback to summary
public void addLocation(String location)
getFirstLocationback to summary
public String getFirstLocation()
getLengthback to summary
public int getLength()
getLocationArrayback to summary
public String[] getLocationArray()
resizeback to summary
public void resize(int oldLength, int newLength)