public class DefaultSchemaResolver extends AbstractMutableSchemaResolver
Constructor and Description |
---|
DefaultSchemaResolver() |
DefaultSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver) |
Modifier and Type | Method and Description |
---|---|
void |
addClassBinding(String nsUri,
Class<?> clazz) |
void |
addClassBinding(String nsUri,
String reference)
Add an in-memory schema.
|
void |
addClassBindingForLocation(String schemaLocation,
Class<?> clazz) |
void |
addSchemaInitializer(String nsUri,
SchemaBindingInitializer sbi)
Registers an instance of SchemaBindingInitializer for the namespace URI.
|
void |
addSchemaInitializer(String nsUri,
String sbiClassName)
Registers a SchemaBindingInitializer for the namespace URI.
|
void |
addSchemaLocation(String nsUri,
String location)
Registers a location for the namespace URI.
|
void |
addSchemaParseAnnotations(String nsUri,
Boolean value)
Whether to parse annotations for this namespace.
|
protected Class<?>[] |
getClassesForQName(QName elementName) |
protected Class<?>[] |
getClassesForSchemaLocation(String uri) |
protected Class<?>[] |
getClassesForURI(String uri) |
void |
mapLocationToClass(String schemaLocation,
Class<?> clazz)
Maps schema location to a class which should be used as the base for the SchemaBinding.
|
void |
mapLocationToClasses(String schemaLocation,
Class<?>... classes)
Maps schema location to an array of classes that should be used as the base for the SchemaBinding.
|
void |
mapQNameToClasses(QName elementName,
Class<?>... classes)
Maps element name to an array of classes that should be used as the base for the SchemaBinding.
|
void |
mapURIToClass(String nsUri,
Class<?> clazz)
Maps a namespace URI to a class which will be used as the base for the SchemaBinding.
|
void |
mapURIToClasses(String nsUri,
Class<?>... clazz)
Maps a namespace URI to an array of classes that 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.
|
Class<?> |
removeClassBinding(String nsUri) |
Class<?> |
removeClassBindingForLocation(String schemaLocation) |
Class<?>[] |
removeLocationToClassMapping(String schemaLocation)
Removes schema location to class mapping.
|
Class<?>[] |
removeQNameToClassMapping(QName elementName)
Removes element name to class mapping.
|
Boolean |
removeSchemaParseAnnotations(String nsUri)
Removes the parse annotation configuration for this namespace.
|
Class<?>[] |
removeURIToClassMapping(String nsUri)
Removes namespace URI to class mapping
|
getBaseURI, getBindingValidator, isCacheResolvedSchemas, isValidateBinding, loadReference, mapLocationToClass, mapLocationToClasses, mapSchemaInitializer, mapSchemaInitializer, mapSchemaLocation, mapURIToClass, removeSchemaInitializer, removeSchemaLocation, resolve, resolveAsLSInput, resolveClassFromSchemaLocation, setBaseURI, setBindingValidator, setCacheResolvedSchemas, setParseXSDAnnotations, setValidateBinding, unsetParseXSDAnnotations
public DefaultSchemaResolver()
public DefaultSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver)
public void addSchemaLocation(String nsUri, String location)
This method delegates to mapSchemaLocation(nsUri, location). This location is looked using the JBossEntityResolver, i.e. it is a classpath location
nsUri
- the namespace locationlocation
- the classpath locationpublic void addSchemaParseAnnotations(String nsUri, Boolean value)
nsUri
- the namespacevalue
- the value of the optionpublic Boolean removeSchemaParseAnnotations(String nsUri)
nsUri
- the namespacepublic void addSchemaInitializer(String nsUri, String sbiClassName) throws Exception
nsUri
- the namespace URI to register the schema initializer forsbiClassName
- the class name SchemaBindingInitializerException
- for any errorpublic void addSchemaInitializer(String nsUri, SchemaBindingInitializer sbi)
nsUri
- the namespace URI to register the schema initializer forsbi
- an instance of SchemaBindingInitializerpublic void addClassBinding(String nsUri, String reference) throws ClassNotFoundException
nsUri
- schema namespacereference
- the schema reference class nameException
- for any errorClassNotFoundException
public void addClassBindingForLocation(String schemaLocation, Class<?> clazz)
protected Class<?>[] getClassesForSchemaLocation(String uri)
getClassesForSchemaLocation
in class AbstractMutableSchemaResolver
protected Class<?>[] getClassesForURI(String uri)
getClassesForURI
in class AbstractMutableSchemaResolver
public void mapLocationToClass(String schemaLocation, Class<?> clazz)
MutableSchemaResolver
schemaLocation
- the location of the schemaclazz
- the class to build the SchemaBinding frompublic void mapLocationToClasses(String schemaLocation, Class<?>... classes)
MutableSchemaResolver
schemaLocation
- the location of the schemaclasses
- the array of classes to build the SchemaBinding frompublic void mapURIToClass(String nsUri, Class<?> clazz)
MutableSchemaResolver
nsUri
- the namespace URIclazz
- class to build the SchemaBinding frompublic void mapURIToClasses(String nsUri, String... reference) throws ClassNotFoundException
MutableSchemaResolver
mapURIToClasses
in interface MutableSchemaResolver
mapURIToClasses
in class AbstractMutableSchemaResolver
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 mapURIToClasses(String nsUri, Class<?>... clazz)
MutableSchemaResolver
nsUri
- the namespace URIpublic Class<?>[] removeLocationToClassMapping(String schemaLocation)
MutableSchemaResolver
schemaLocation
- the schema locationpublic Class<?>[] removeURIToClassMapping(String nsUri)
MutableSchemaResolver
nsUri
- the namespace URI to unmapprotected Class<?>[] getClassesForQName(QName elementName)
getClassesForQName
in class AbstractMutableSchemaResolver
public void mapQNameToClasses(QName elementName, Class<?>... classes)
MutableSchemaResolverWithQNameMapping
elementName
- the name of the root elementclasses
- the array of classes to build the SchemaBinding frompublic Class<?>[] removeQNameToClassMapping(QName elementName)
MutableSchemaResolverWithQNameMapping
elementName
- the root element nameCopyright © 2014 JBoss by Red Hat. All rights reserved.