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
LSInput s. |
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 XMLGrammarLoader
getRecognizedFeatures
in interface XMLComponent
public boolean getFeature(String featureId) throws XMLConfigurationException
getFeature
in interface XMLGrammarLoader
featureId
- The feature identifier.XMLConfigurationException
- Thrown on configuration error.public void setFeature(String featureId, boolean state) throws XMLConfigurationException
setFeature
in interface XMLGrammarLoader
setFeature
in interface XMLComponent
featureId
- 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 XMLGrammarLoader
getRecognizedProperties
in interface XMLComponent
public Object getProperty(String propertyId) throws XMLConfigurationException
getProperty
in interface XMLGrammarLoader
propertyId
- The property identifier.XMLConfigurationException
- Thrown on configuration error.public void setProperty(String propertyId, Object state) throws XMLConfigurationException
setProperty
in interface XMLGrammarLoader
setProperty
in interface XMLComponent
propertyId
- 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 XMLGrammarLoader
locale
- 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 XMLGrammarLoader
public void setErrorHandler(XMLErrorHandler errorHandler)
setErrorHandler
in interface XMLGrammarLoader
errorHandler
- The error handler.public XMLErrorHandler getErrorHandler()
getErrorHandler
in interface XMLGrammarLoader
public void setEntityResolver(XMLEntityResolver entityResolver)
setEntityResolver
in interface XMLGrammarLoader
entityResolver
- The new entity resolver.public XMLEntityResolver getEntityResolver()
getEntityResolver
in interface XMLGrammarLoader
public 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 XMLGrammarLoader
source
- 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.XNIException
public static XMLInputSource resolveDocument(XSDDescription desc, Hashtable locationPairs, XMLEntityResolver entityResolver) throws IOException
desc
- locationPairs
- entityResolver
- IOException
public 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)
XMLComponent
getFeatureDefault
in interface XMLComponent
featureId
- The feature identifier.public Object getPropertyDefault(String propertyId)
XMLComponent
getPropertyDefault
in interface XMLComponent
propertyId
- The property identifier.public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
XMLComponent
reset
in interface XMLComponent
componentManager
- The component manager.XMLConfigurationException
public DOMConfiguration getConfig()
XSLoader
DOMConfiguration
interface:
error-handler
(DOMErrorHandler
) and
resource-resolver
(LSResourceResolver
).
"validate"
true
false
public XSModel load(LSInput is)
XSLoader
LSInput
.public XSModel loadInputList(LSInputList is)
XSLoader
LSInput
s.loadInputList
in interface XSLoader
is
- The list of LSInput
s from which the XML
Schema documents are to be read.public XSModel loadURI(String uri)
XSLoader
public XSModel loadURIList(StringList uriList)
XSLoader
loadURIList
in interface XSLoader
uriList
- The list of URI locations.public boolean canSetParameter(String name, Object value)
canSetParameter
in interface DOMConfiguration
public Object getParameter(String name) throws DOMException
getParameter
in interface DOMConfiguration
DOMException
public DOMStringList getParameterNames()
getParameterNames
in interface DOMConfiguration
public void setParameter(String name, Object value) throws DOMException
setParameter
in interface DOMConfiguration
DOMException
public XSElementDecl getGlobalElementDecl(QName element)
getGlobalElementDecl
in interface XSElementDeclHelper
Copyright © 2016 JBoss by Red Hat. All rights reserved.