public class XMLSchemaLoader extends Object implements XMLGrammarLoader, XMLComponent, XSElementDeclHelper, XSLoader, DOMConfiguration
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.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALLOW_JAVA_ENCODINGS
Feature identifier: allow java encodings to be recognized when parsing schema docs.
|
protected static String |
AUGMENT_PSVI |
protected static String |
CONTINUE_AFTER_FATAL_ERROR
Feature identifier: continue after fatal error.
|
protected static String |
DISALLOW_DOCTYPE
Feature: disallow doctype
|
protected static String |
ENTITY_MANAGER |
static String |
ENTITY_RESOLVER
Property identifier: entity resolver.
|
protected static String |
ERROR_HANDLER
Property identifier: error handler.
|
static String |
ERROR_REPORTER
Property identifier: error reporter.
|
protected static String |
GENERATE_SYNTHETIC_ANNOTATIONS
Feature: generate synthetic annotations
|
protected static String |
HONOUR_ALL_SCHEMALOCATIONS
Feature identifier: honour all schemaLocations
|
protected static String |
JAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source.
|
protected static String |
LOCALE
Property identifier: locale.
|
protected static String |
NAMESPACE_GROWTH
Feature identifier: namespace growth
|
protected static String |
PARSER_SETTINGS |
protected static String |
SCHEMA_DV_FACTORY
Property identifier: Schema DV Factory
|
protected static String |
SCHEMA_FULL_CHECKING
Feature identifier: schema full checking
|
protected static String |
SCHEMA_LOCATION
Property identifier: schema location.
|
protected static String |
SCHEMA_NONS_LOCATION
Property identifier: no namespace schema location.
|
protected static String |
SECURITY_MANAGER |
protected static String |
STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: standard uri conformant feature.
|
static String |
SYMBOL_TABLE
Property identifier: symbol table.
|
protected static String |
TOLERATE_DUPLICATES
Feature identifier: tolerate duplicates
|
protected static String |
VALIDATE_ANNOTATIONS
Feature identifier: validate annotations.
|
static String |
XMLGRAMMAR_POOL
Property identifier: grammar pool.
|
| Constructor and Description |
|---|
XMLSchemaLoader() |
XMLSchemaLoader(SymbolTable symbolTable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSetParameter(String name,
Object value) |
DOMConfiguration |
getConfig()
The configuration of a document.
|
XMLEntityResolver |
getEntityResolver()
Returns the registered entity resolver.
|
XMLErrorHandler |
getErrorHandler()
Returns the registered error handler.
|
boolean |
getFeature(String featureId)
Returns the state of a feature.
|
Boolean |
getFeatureDefault(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.
|
XSElementDecl |
getGlobalElementDecl(QName element) |
Locale |
getLocale()
Return the Locale the XMLGrammarLoader is using.
|
Object |
getParameter(String name) |
DOMStringList |
getParameterNames() |
Object |
getProperty(String propertyId)
Returns the state of a property.
|
Object |
getPropertyDefault(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.
|
String[] |
getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this XMLGrammarLoader.
|
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(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(String sl,
String nsl,
Hashtable locations,
XMLErrorReporter er) |
void |
reset(XMLComponentManager componentManager)
Resets the component.
|
static XMLInputSource |
resolveDocument(XSDDescription desc,
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(String featureId,
boolean state)
Sets the state of a feature.
|
void |
setLocale(Locale locale)
Set the locale to use for messages.
|
void |
setParameter(String name,
Object value) |
void |
setProperty(String propertyId,
Object state)
Sets the state of a property.
|
static boolean |
tokenizeSchemaLocationStr(String schemaStr,
Hashtable locations,
String base) |
protected static final String SCHEMA_FULL_CHECKING
protected static final String CONTINUE_AFTER_FATAL_ERROR
protected static final String ALLOW_JAVA_ENCODINGS
protected static final String STANDARD_URI_CONFORMANT_FEATURE
protected static final String VALIDATE_ANNOTATIONS
protected static final String DISALLOW_DOCTYPE
protected static final String GENERATE_SYNTHETIC_ANNOTATIONS
protected static final String HONOUR_ALL_SCHEMALOCATIONS
protected static final String AUGMENT_PSVI
protected static final String PARSER_SETTINGS
protected static final String NAMESPACE_GROWTH
protected static final String TOLERATE_DUPLICATES
protected static final String SCHEMA_DV_FACTORY
public static final String SYMBOL_TABLE
public static final String ERROR_REPORTER
protected static final String ERROR_HANDLER
public static final String ENTITY_RESOLVER
public static final String XMLGRAMMAR_POOL
protected static final String SCHEMA_LOCATION
protected static final String SCHEMA_NONS_LOCATION
protected static final String JAXP_SCHEMA_SOURCE
protected static final String SECURITY_MANAGER
protected static final String LOCALE
protected static final String ENTITY_MANAGER
public XMLSchemaLoader()
public XMLSchemaLoader(SymbolTable symbolTable)
public String[] getRecognizedFeatures()
getRecognizedFeatures in interface XMLGrammarLoadergetRecognizedFeatures in interface XMLComponentpublic boolean getFeature(String featureId) throws XMLConfigurationException
getFeature in interface XMLGrammarLoaderfeatureId - The feature identifier.XMLConfigurationException - Thrown on configuration error.public void setFeature(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 String[] getRecognizedProperties()
getRecognizedProperties in interface XMLGrammarLoadergetRecognizedProperties in interface XMLComponentpublic Object getProperty(String propertyId) throws XMLConfigurationException
getProperty in interface XMLGrammarLoaderpropertyId - The property identifier.XMLConfigurationException - Thrown on configuration error.public void setProperty(String propertyId, 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(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 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 XMLGrammarLoaderpublic void loadGrammar(XMLInputSource[] source) throws IOException, XNIException
source - the locations of the entity which forms
the staring point of the grammars to be constructedIOException - when a problem is encounted reading the entityXNIException - when a condition arises (such as a FatalError) that requires parsing
of the entity be terminatedpublic Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException
loadGrammar in interface XMLGrammarLoadersource - the location of the entity which forms
the starting point of the grammar to be constructed.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.XNIExceptionpublic static XMLInputSource resolveDocument(XSDDescription desc, Hashtable locationPairs, XMLEntityResolver entityResolver) throws IOException
desc - locationPairs - entityResolver - IOExceptionpublic static void processExternalHints(String sl, String nsl, Hashtable locations, XMLErrorReporter er)
public static boolean tokenizeSchemaLocationStr(String schemaStr, Hashtable locations, String base)
public Boolean getFeatureDefault(String featureId)
XMLComponentgetFeatureDefault in interface XMLComponentfeatureId - The feature identifier.public Object getPropertyDefault(String propertyId)
XMLComponentgetPropertyDefault in interface XMLComponentpropertyId - The property identifier.public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
XMLComponentreset in interface XMLComponentcomponentManager - The component manager.XMLConfigurationExceptionpublic DOMConfiguration getConfig()
XSLoaderDOMConfiguration interface:
error-handler (DOMErrorHandler) and
resource-resolver (LSResourceResolver).
"validate"truefalsepublic XSModel load(LSInput is)
XSLoaderLSInput .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(String uri)
XSLoaderpublic XSModel loadURIList(StringList uriList)
XSLoaderloadURIList in interface XSLoaderuriList - The list of URI locations.public boolean canSetParameter(String name, Object value)
canSetParameter in interface DOMConfigurationpublic Object getParameter(String name) throws DOMException
getParameter in interface DOMConfigurationDOMExceptionpublic DOMStringList getParameterNames()
getParameterNames in interface DOMConfigurationpublic void setParameter(String name, Object value) throws DOMException
setParameter in interface DOMConfigurationDOMExceptionpublic XSElementDecl getGlobalElementDecl(QName element)
getGlobalElementDecl in interface XSElementDeclHelperCopyright © 2016 JBoss by Red Hat. All rights reserved.