| java.lang.Object org.apache.xerces.impl.xs.XMLSchemaLoader
XMLSchemaLoader | public class XMLSchemaLoader implements XMLGrammarLoader,XMLComponent,XSLoader,DOMConfiguration(Code) | | 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 version: $Id: XMLSchemaLoader.java 521495 2007-03-22 22:12:05Z mrglavas $ |
Inner Class :static class LocationArray | |
Method Summary | |
public boolean | canSetParameter(String name, Object value) | XMLInputSource | dom2xmlInputSource(LSInput is) | public DOMConfiguration | getConfig() | public XMLEntityResolver | getEntityResolver() Returns the registered entity resolver. | public XMLErrorHandler | getErrorHandler() Returns the registered error handler. | public boolean | getFeature(String featureId) Returns the state of a feature. | public Boolean | getFeatureDefault(String featureId) | public Locale | getLocale() Return the Locale the XMLGrammarLoader is using. | public Object | getParameter(String name) | public DOMStringList | getParameterNames() | public Object | getProperty(String propertyId) Returns the state of a property. | public Object | getPropertyDefault(String propertyId) | 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 XSModel | load(LSInput is) | public void | loadGrammar(XMLInputSource source) Returns a Grammar object by parsing the contents of the
entities pointed to by sources. | public Grammar | loadGrammar(XMLInputSource source) Returns a Grammar object by parsing the contents of the
entity pointed to by source. | public XSModel | loadInputList(LSInputList is) | SchemaGrammar | loadSchema(XSDDescription desc, XMLInputSource source, Hashtable locationPairs) This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator. | public XSModel | loadURI(String uri) | public XSModel | loadURIList(StringList uriList) | public static void | processExternalHints(String sl, String nsl, Hashtable locations, XMLErrorReporter er) | void | reportDOMFatalError(Exception e) | public void | reset(XMLComponentManager componentManager) | public static XMLInputSource | resolveDocument(XSDDescription desc, Hashtable locationPairs, XMLEntityResolver entityResolver) This method tries to resolve location of the given schema.
The loader stores the namespace/location pairs in a hashtable (use "" as the
namespace of absent namespace). | public void | setEntityResolver(XMLEntityResolver entityResolver) Sets the entity resolver. | public void | setErrorHandler(XMLErrorHandler errorHandler) Sets the error handler. | public void | setFeature(String featureId, boolean state) Sets the state of a feature. | public void | setLocale(Locale locale) Set the locale to use for messages. | public void | setParameter(String name, Object value) | public void | setProperty(String propertyId, Object state) Sets the state of a property. | public static boolean | tokenizeSchemaLocationStr(String schemaStr, Hashtable locations) |
ALLOW_JAVA_ENCODINGS | final protected static String ALLOW_JAVA_ENCODINGS(Code) | | Feature identifier: allow java encodings to be recognized when parsing schema docs.
|
AUGMENT_PSVI | final protected static String AUGMENT_PSVI(Code) | | |
CONTINUE_AFTER_FATAL_ERROR | final protected static String CONTINUE_AFTER_FATAL_ERROR(Code) | | Feature identifier: continue after fatal error.
|
DISALLOW_DOCTYPE | final protected static String DISALLOW_DOCTYPE(Code) | | Feature: disallow doctype
|
ENTITY_MANAGER | final protected static String ENTITY_MANAGER(Code) | | |
ENTITY_RESOLVER | final public static String ENTITY_RESOLVER(Code) | | Property identifier: entity resolver.
|
ERROR_HANDLER | final protected static String ERROR_HANDLER(Code) | | Property identifier: error handler.
|
ERROR_REPORTER | final public static String ERROR_REPORTER(Code) | | Property identifier: error reporter.
|
GENERATE_SYNTHETIC_ANNOTATIONS | final protected static String GENERATE_SYNTHETIC_ANNOTATIONS(Code) | | Feature: generate synthetic annotations
|
HONOUR_ALL_SCHEMALOCATIONS | final protected static String HONOUR_ALL_SCHEMALOCATIONS(Code) | | Feature identifier: honour all schemaLocations
|
JAXP_SCHEMA_SOURCE | final protected static String JAXP_SCHEMA_SOURCE(Code) | | Property identifier: JAXP schema source.
|
PARSER_SETTINGS | final protected static String PARSER_SETTINGS(Code) | | |
SCHEMA_FULL_CHECKING | final protected static String SCHEMA_FULL_CHECKING(Code) | | Feature identifier: schema full checking
|
SCHEMA_LOCATION | final protected static String SCHEMA_LOCATION(Code) | | Property identifier: schema location.
|
SCHEMA_NONS_LOCATION | final protected static String SCHEMA_NONS_LOCATION(Code) | | Property identifier: no namespace schema location.
|
SECURITY_MANAGER | final protected static String SECURITY_MANAGER(Code) | | |
STANDARD_URI_CONFORMANT_FEATURE | final protected static String STANDARD_URI_CONFORMANT_FEATURE(Code) | | Feature identifier: standard uri conformant feature.
|
SYMBOL_TABLE | final public static String SYMBOL_TABLE(Code) | | Property identifier: symbol table.
|
VALIDATE_ANNOTATIONS | final protected static String VALIDATE_ANNOTATIONS(Code) | | Feature identifier: validate annotations.
|
XMLGRAMMAR_POOL | final public static String XMLGRAMMAR_POOL(Code) | | Property identifier: grammar pool.
|
XMLSchemaLoader | public XMLSchemaLoader()(Code) | | |
XMLSchemaLoader | XMLSchemaLoader(XMLErrorReporter errorReporter, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder)(Code) | | This constractor is used by the XMLSchemaValidator. Additional properties, i.e. XMLEntityManager,
will be passed during reset(XMLComponentManager).
Parameters: errorReporter - Parameters: grammarBucket - Parameters: sHandler - Parameters: builder - |
getLocale | public Locale getLocale()(Code) | | Return the Locale the XMLGrammarLoader is using.
|
getRecognizedFeatures | public String[] getRecognizedFeatures()(Code) | | Returns a list of feature identifiers that are recognized by
this XMLGrammarLoader. This method may return null if no features
are recognized.
|
getRecognizedProperties | public String[] getRecognizedProperties()(Code) | | Returns a list of property identifiers that are recognized by
this XMLGrammarLoader. This method may return null if no properties
are recognized.
|
loadGrammar | public void loadGrammar(XMLInputSource source) throws IOException, XNIException(Code) | | Returns a Grammar object by parsing the contents of the
entities pointed to by sources.
Parameters: source - the locations of the entity which forms the staring point of the grammars to be constructed throws: IOException - when a problem is encounted reading the entity throws: XNIException - when a condition arises (such as a FatalError) that requires parsingof the entity be terminated |
loadGrammar | public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException(Code) | | Returns a Grammar object by parsing the contents of the
entity pointed to by source.
Parameters: source - the location of the entity which formsthe starting point of the grammar to be constructed. throws: IOException - When a problem is encountered reading the entityXNIException When a condition arises (such as a FatalError) that requires parsingof the entity be terminated. |
loadSchema | SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source, Hashtable locationPairs) throws IOException, XNIException(Code) | | 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
Parameters: desc - Parameters: source - Parameters: locationPairs - An XML Schema grammar throws: IOException - throws: XNIException - |
resolveDocument | public static XMLInputSource resolveDocument(XSDDescription desc, Hashtable locationPairs, XMLEntityResolver entityResolver) throws IOException(Code) | | This method tries to resolve location of the given schema.
The loader stores the namespace/location pairs in a hashtable (use "" as the
namespace of absent namespace). When resolving an entity, loader first tries
to find in the hashtable whether there is a value for that namespace,
if so, pass that location value to the user-defined entity resolver.
Parameters: desc - Parameters: locationPairs - Parameters: entityResolver - the XMLInputSource throws: IOException - |
setEntityResolver | public void setEntityResolver(XMLEntityResolver entityResolver)(Code) | | Sets the entity resolver.
Parameters: entityResolver - The new entity resolver. |
setErrorHandler | public void setErrorHandler(XMLErrorHandler errorHandler)(Code) | | Sets the error handler.
Parameters: errorHandler - The error handler. |
setFeature | public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code) | | Sets the state of a feature.
Parameters: featureId - The feature identifier. Parameters: state - The state of the feature. throws: XMLConfigurationException - Thrown when a feature is notrecognized or cannot be set. |
setLocale | public void setLocale(Locale locale)(Code) | | Set the locale to use for messages.
Parameters: locale - The locale object to use for localization of messages. exception: XNIException - Thrown if the parser does not support thespecified locale. |
tokenizeSchemaLocationStr | public static boolean tokenizeSchemaLocationStr(String schemaStr, Hashtable locations)(Code) | | |
|
|