public abstract class AbstractMutableSchemaResolver extends Object implements MutableSchemaResolverWithQNameMapping
Modifier | Constructor and Description |
---|---|
protected |
AbstractMutableSchemaResolver(org.jboss.logging.Logger log) |
protected |
AbstractMutableSchemaResolver(org.jboss.logging.Logger log,
org.jboss.util.xml.JBossEntityResolver resolver) |
Modifier and Type | Method and Description |
---|---|
String |
getBaseURI() |
SchemaBindingValidator |
getBindingValidator()
Returns the validator which is used to validate SchemaBinding instances if validation is enabled.
|
protected abstract Class<?>[] |
getClassesForQName(QName elementName) |
protected abstract Class<?>[] |
getClassesForSchemaLocation(String uri) |
protected abstract Class<?>[] |
getClassesForURI(String uri) |
boolean |
isCacheResolvedSchemas() |
boolean |
isValidateBinding()
Checks whether SchemaBinding instances built from JAXB/JBossXB annotations should be validated
for structural consistency with the corresponding XSD.
|
protected Class<?> |
loadReference(String sbiClassName) |
void |
mapLocationToClass(String schemaLocation,
String reference)
Maps schema location to a class which should be used as the base for the SchemaBinding.
|
void |
mapLocationToClasses(String schemaLocation,
String... reference)
Maps schema location to an array of classes that should be used as the base for the SchemaBinding.
|
void |
mapSchemaInitializer(String nsUri,
SchemaBindingInitializer sbi)
Registers an instance of SchemaBindingInitializer for the namespace URI.
|
void |
mapSchemaInitializer(String nsUri,
String sbiClassName)
Registers a SchemaBindingInitializer for the namespace URI.
|
void |
mapSchemaLocation(String nsUri,
String location)
Registers a location for the namespace URI.
|
void |
mapURIToClass(String nsUri,
String reference)
Maps a namespace URI to a class which will be used as the base for the SchemaBinding.
|
void |
mapURIToClasses(String nsUri,
String... reference)
Maps a namespace URI to an array of classes that will be used as the base for the SchemaBinding.
|
SchemaBindingInitializer |
removeSchemaInitializer(String nsUri)
Unregisters and returns the SchemaBindingInitializer for the namespace URI.
|
void |
removeSchemaLocation(String nsUri)
Removes a location for the namespace URI.
|
SchemaBinding |
resolve(String nsURI,
String localName,
String schemaLocation)
Uses the JBossEntityResolver.resolveEntity by:
1.
|
LSInput |
resolveAsLSInput(String nsURI,
String baseURI,
String schemaLocation)
This one is used to resolve imported schemas with
|
protected Class<?>[] |
resolveClassFromSchemaLocation(String schemaLocation,
boolean trace)
Lookup a binding class by schemaLocation.
|
void |
setBaseURI(String baseURI) |
void |
setBindingValidator(SchemaBindingValidator validator)
Sets the validator which should be used to validate SchemaBinding instances built from JAXB/JBossXB annotations
if validation is enabled.
|
void |
setCacheResolvedSchemas(boolean cacheResolvedSchemas)
Passing in true will make the schema resolver to cache successfully resolved
schemas (which is the default) with namespace URI being the identifier of a schema.
|
void |
setParseXSDAnnotations(String nsUri,
boolean value)
Whether to parse annotations for this namespace.
|
void |
setValidateBinding(boolean validateBinding)
Enables/disables validation of SchemaBinding instances built from JAXB/JBossXB annotations
against the corresponding XSD schemas.
|
Boolean |
unsetParseXSDAnnotations(String nsURI)
Clears the flag to parse XSD annotations for the namespace URI.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mapQNameToClasses, removeQNameToClassMapping
mapLocationToClass, mapLocationToClasses, mapURIToClass, mapURIToClasses, removeLocationToClassMapping, removeURIToClassMapping
protected AbstractMutableSchemaResolver(org.jboss.logging.Logger log)
protected AbstractMutableSchemaResolver(org.jboss.logging.Logger log, org.jboss.util.xml.JBossEntityResolver resolver)
public boolean isValidateBinding()
public void setValidateBinding(boolean validateBinding)
validateBinding
- validate binding flagpublic SchemaBindingValidator getBindingValidator()
public void setBindingValidator(SchemaBindingValidator validator)
validator
- the schema binding validatorpublic boolean isCacheResolvedSchemas()
isCacheResolvedSchemas
in interface MutableSchemaResolver
public void setCacheResolvedSchemas(boolean cacheResolvedSchemas)
setCacheResolvedSchemas
in interface MutableSchemaResolver
cacheResolvedSchemas
- do we cache resolved schemaspublic void mapSchemaLocation(String nsUri, String location)
This location is looked using the JBossEntityResolver, i.e. it is a classpath location
mapSchemaLocation
in interface MutableSchemaResolver
nsUri
- the namespace locationlocation
- the classpath locationpublic void removeSchemaLocation(String nsUri)
removeSchemaLocation
in interface MutableSchemaResolver
nsUri
- the namespace locationpublic void setParseXSDAnnotations(String nsUri, boolean value)
setParseXSDAnnotations
in interface MutableSchemaResolver
nsUri
- the namespacevalue
- the value of the optionpublic Boolean unsetParseXSDAnnotations(String nsURI)
MutableSchemaResolver
unsetParseXSDAnnotations
in interface MutableSchemaResolver
nsURI
- the namespace URIpublic void mapSchemaInitializer(String nsUri, String sbiClassName) throws Exception
mapSchemaInitializer
in interface MutableSchemaResolver
nsUri
- the namespace URI to register the schema initializer forsbiClassName
- the class name SchemaBindingInitializerException
- for any errorpublic void mapSchemaInitializer(String nsUri, SchemaBindingInitializer sbi)
mapSchemaInitializer
in interface MutableSchemaResolver
nsUri
- the namespace URI to register the schema initializer forsbi
- an instance of SchemaBindingInitializerpublic SchemaBindingInitializer removeSchemaInitializer(String nsUri)
removeSchemaInitializer
in interface MutableSchemaResolver
nsUri
- the namespace URI to unregister SchemaBindingInitializer forpublic String getBaseURI()
getBaseURI
in interface SchemaBindingResolver
public void setBaseURI(String baseURI)
setBaseURI
in interface SchemaBindingResolver
public SchemaBinding resolve(String nsURI, String localName, String schemaLocation)
resolve
in interface SchemaBindingResolver
nsURI
- - namespace URI of the element with the schema referencelocalName
- - optional root element nameschemaLocation
- - the option schema location uri that matches
nsUri if one existspublic void mapURIToClass(String nsUri, String reference) throws ClassNotFoundException
MutableSchemaResolver
mapURIToClass
in interface MutableSchemaResolver
nsUri
- the namespace URIreference
- fully qualified class name to build the SchemaBinding fromClassNotFoundException
- if the reference cannot be loadedpublic void mapURIToClasses(String nsUri, String... reference) throws ClassNotFoundException
MutableSchemaResolver
mapURIToClasses
in interface MutableSchemaResolver
nsUri
- the namespace URIreference
- array of fully qualified class names to build the SchemaBinding fromClassNotFoundException
- if at least one of the references cannot be loadedpublic void mapLocationToClass(String schemaLocation, String reference) throws ClassNotFoundException
MutableSchemaResolver
mapLocationToClass
in interface MutableSchemaResolver
schemaLocation
- the location of the schemareference
- the fully qualified class name to build the SchemaBinding fromClassNotFoundException
- if the reference cannot be loadedpublic void mapLocationToClasses(String schemaLocation, String... reference) throws ClassNotFoundException
MutableSchemaResolver
mapLocationToClasses
in interface MutableSchemaResolver
schemaLocation
- the location of the schemareference
- the array of fully qualified class names to build the SchemaBinding fromClassNotFoundException
- if at least one of the references cannot be loadedprotected Class<?> loadReference(String sbiClassName) throws ClassNotFoundException
ClassNotFoundException
protected Class<?>[] resolveClassFromSchemaLocation(String schemaLocation, boolean trace)
schemaLocation
- the schema location from the parsertrace
- - logging trace flagpublic LSInput resolveAsLSInput(String nsURI, String baseURI, String schemaLocation)
SchemaBindingResolver
resolveAsLSInput
in interface SchemaBindingResolver
Copyright © 2016 JBoss by Red Hat. All rights reserved.