JBoss XML Binding 2.0.3.GA

org.jboss.xb.binding.resolver
Class MultiClassSchemaResolver

java.lang.Object
  extended by org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver
      extended by org.jboss.xb.binding.resolver.MultiClassSchemaResolver
All Implemented Interfaces:
MutableSchemaResolver, MutableSchemaResolverWithQNameMapping, SchemaBindingResolver

public class MultiClassSchemaResolver
extends AbstractMutableSchemaResolver

A default SchemaBindingResolver that uses a JBossEntityResolver to locate the schema xsd.

Version:
$Revision: 2913 $
Author:
Scott.Stark@jboss.org, alex@jboss.org

Constructor Summary
MultiClassSchemaResolver()
           
MultiClassSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver)
           
 
Method Summary
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<?>... classes)
          Maps a namespace URI to an array of classes that will be used as the base for the SchemaBinding.
 Class<?>[] removeLocationToClassMapping(String schemaLocation)
          Removes schema location to class mapping.
 Class<?>[] removeQNameToClassMapping(QName elementName)
          Removes element name to class mapping.
 Class<?>[] removeURIToClassMapping(String nsUri)
          Removes namespace URI to class mapping
 
Methods inherited from class org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver
getBaseURI, getBindingValidator, isCacheResolvedSchemas, isValidateBinding, loadReference, mapLocationToClass, mapLocationToClasses, mapSchemaInitializer, mapSchemaInitializer, mapSchemaLocation, mapURIToClass, mapURIToClasses, removeSchemaInitializer, removeSchemaLocation, resolve, resolveAsLSInput, resolveClassFromSchemaLocation, setBaseURI, setBindingValidator, setCacheResolvedSchemas, setParseXSDAnnotations, setValidateBinding, unsetParseXSDAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiClassSchemaResolver

public MultiClassSchemaResolver()

MultiClassSchemaResolver

public MultiClassSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver)
Method Detail

getClassesForSchemaLocation

protected Class<?>[] getClassesForSchemaLocation(String uri)
Specified by:
getClassesForSchemaLocation in class AbstractMutableSchemaResolver

getClassesForURI

protected Class<?>[] getClassesForURI(String uri)
Specified by:
getClassesForURI in class AbstractMutableSchemaResolver

mapLocationToClass

public void mapLocationToClass(String schemaLocation,
                               Class<?> clazz)
Description copied from interface: MutableSchemaResolver
Maps schema location to a class which should be used as the base for the SchemaBinding.

Parameters:
schemaLocation - the location of the schema
clazz - the class to build the SchemaBinding from

mapLocationToClasses

public void mapLocationToClasses(String schemaLocation,
                                 Class<?>... classes)
Description copied from interface: MutableSchemaResolver
Maps schema location to an array of classes that should be used as the base for the SchemaBinding.

Parameters:
schemaLocation - the location of the schema
classes - the array of classes to build the SchemaBinding from

mapURIToClass

public void mapURIToClass(String nsUri,
                          Class<?> clazz)
Description copied from interface: MutableSchemaResolver
Maps a namespace URI to a class which will be used as the base for the SchemaBinding.

Parameters:
nsUri - the namespace URI
clazz - class to build the SchemaBinding from

mapURIToClasses

public void mapURIToClasses(String nsUri,
                            Class<?>... classes)
Description copied from interface: MutableSchemaResolver
Maps a namespace URI to an array of classes that will be used as the base for the SchemaBinding.

Parameters:
nsUri - the namespace URI

removeLocationToClassMapping

public Class<?>[] removeLocationToClassMapping(String schemaLocation)
Description copied from interface: MutableSchemaResolver
Removes schema location to class mapping.

Parameters:
schemaLocation - the schema location
Returns:
the array of classes used to build the SchemaBinding or null, if the schema location wasn't mapped.

removeURIToClassMapping

public Class<?>[] removeURIToClassMapping(String nsUri)
Description copied from interface: MutableSchemaResolver
Removes namespace URI to class mapping

Parameters:
nsUri - the namespace URI to unmap
Returns:
classes mapped to the namespace URI or null if the URI was not mapped.

getClassesForQName

protected Class<?>[] getClassesForQName(QName elementName)
Specified by:
getClassesForQName in class AbstractMutableSchemaResolver

mapQNameToClasses

public void mapQNameToClasses(QName elementName,
                              Class<?>... classes)
Description copied from interface: MutableSchemaResolverWithQNameMapping
Maps element name to an array of classes that should be used as the base for the SchemaBinding.

Parameters:
elementName - the name of the root element
classes - the array of classes to build the SchemaBinding from

removeQNameToClassMapping

public Class<?>[] removeQNameToClassMapping(QName elementName)
Description copied from interface: MutableSchemaResolverWithQNameMapping
Removes element name to class mapping.

Parameters:
elementName - the root element name
Returns:
the array of classes used to build the SchemaBinding or null, if the schema location wasn't mapped.

JBoss XML Binding 2.0.3.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.