org.jboss.xb.binding.resolver
Interface MutableSchemaResolver

All Superinterfaces:
SchemaBindingResolver
All Known Implementing Classes:
AbstractMutableSchemaResolver, DefaultSchemaResolver, MultiClassSchemaResolver

public interface MutableSchemaResolver
extends SchemaBindingResolver

A MutableSchemaResolver.

Version:
$Revision: 1.1 $
Author:
Alexey Loubyansky

Method Summary
 boolean isCacheResolvedSchemas()
           
 void mapLocationToClass(String schemaLocation, Class<?> clazz)
          Maps schema location to a class which should be used as the base for the SchemaBinding.
 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, Class<?>... classes)
          Maps schema location to an array of classes that 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, Class<?> clazz)
          Maps a namespace URI to a class which will be used as the base for the SchemaBinding.
 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, 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<?>[] removeLocationToClassMapping(String schemaLocation)
          Removes schema location to class mapping.
 SchemaBindingInitializer removeSchemaInitializer(String nsUri)
          Unregisters and returns the SchemaBindingInitializer for the namespace URI.
 void removeSchemaLocation(String nsUri)
          Removes a location for the namespace URI.
 Class<?>[] removeURIToClassMapping(String nsUri)
          Removes namespace URI to class mapping
 void setCacheResolvedSchemas(boolean cacheResolvedSchemas)
          If the implementation supports caching of the resolved schema bindings then passing in true will enable caching.
 void setParseXSDAnnotations(String nsUri, boolean value)
          Whether to parse XSD annotations for this namespace.
 Boolean unsetParseXSDAnnotations(String nsURI)
          Clears the flag to parse XSD annotations for the namespace URI.
 
Methods inherited from interface org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver
getBaseURI, resolve, resolveAsLSInput, setBaseURI
 

Method Detail

isCacheResolvedSchemas

boolean isCacheResolvedSchemas()
Returns:
true if resolved SchemaBinding's are cached, false otherwise

setCacheResolvedSchemas

void setCacheResolvedSchemas(boolean cacheResolvedSchemas)
If the implementation supports caching of the resolved schema bindings then passing in true will enable caching. False will (possibly) flush the cache and make the schema resolver resolve schemas on each request.

Parameters:
cacheResolvedSchemas -

mapSchemaLocation

void mapSchemaLocation(String nsUri,
                       String location)
Registers a location for the namespace URI.

The location may be a classpath location if the implementation supports searching in the classpath (e.g. using JBossEntityResolver)

Parameters:
nsUri - the namespace URI
location - the schema location

removeSchemaLocation

void removeSchemaLocation(String nsUri)
Removes a location for the namespace URI.

Parameters:
nsUri - the namespace location

setParseXSDAnnotations

void setParseXSDAnnotations(String nsUri,
                            boolean value)
Whether to parse XSD annotations for this namespace.

Parameters:
nsUri - the namespace
value - the value of the option

unsetParseXSDAnnotations

Boolean unsetParseXSDAnnotations(String nsURI)
Clears the flag to parse XSD annotations for the namespace URI. The default setting for parsing XSD annotations will be applied to this namespace URI after this method is called.

Parameters:
nsURI - the namespace URI
Returns:
the value previously set or null, if no value was set for this namespace URI

mapSchemaInitializer

void mapSchemaInitializer(String nsUri,
                          String sbiClassName)
                          throws Exception
Registers a SchemaBindingInitializer for the namespace URI. When the schema binding that corresponds to the namespace URI is resolved, the init(SchemaBinding schema) method will be invoked on the instance of SchemaBindingInitializer with the SchemaBinding returned from the XsdBinder.bind() method.

Parameters:
nsUri - the namespace URI to register the schema initializer for
sbiClassName - the class name SchemaBindingInitializer
Throws:
Exception - for any error

mapSchemaInitializer

void mapSchemaInitializer(String nsUri,
                          SchemaBindingInitializer sbi)
Registers an instance of SchemaBindingInitializer for the namespace URI. When the schema binding that corresponds to the namespace URI is resolved, the init(SchemaBinding schema) method will be invoked on the instance of SchemaBindingInitializer with the SchemaBinding returned from the XsdBinder.bind() method.

Parameters:
nsUri - the namespace URI to register the schema initializer for
sbi - an instance of SchemaBindingInitializer

removeSchemaInitializer

SchemaBindingInitializer removeSchemaInitializer(String nsUri)
Unregisters and returns the SchemaBindingInitializer for the namespace URI.

Parameters:
nsUri - the namespace URI to unregister SchemaBindingInitializer for
Returns:
unregistered SchemaBindingInitializer for the namespace URI or null if there was no SchemaBindingInitialzer registered for the namespace URI

mapURIToClass

void mapURIToClass(String nsUri,
                   String reference)
                   throws ClassNotFoundException
Maps a namespace URI to a class which will be used as the base for the SchemaBinding.

Parameters:
nsUri - the namespace URI
reference - fully qualified class name to build the SchemaBinding from
Throws:
ClassNotFoundException - if the reference cannot be loaded

mapURIToClass

void mapURIToClass(String nsUri,
                   Class<?> clazz)
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

void mapURIToClasses(String nsUri,
                     String... reference)
                     throws ClassNotFoundException
Maps a namespace URI to an array of classes that will be used as the base for the SchemaBinding.

Parameters:
nsUri - the namespace URI
reference - array of fully qualified class names to build the SchemaBinding from
Throws:
ClassNotFoundException - if at least one of the references cannot be loaded

mapURIToClasses

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.

Parameters:
nsUri - the namespace URI
reference - array of classes to build the SchemaBinding from

removeURIToClassMapping

Class<?>[] removeURIToClassMapping(String nsUri)
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.

mapLocationToClass

void mapLocationToClass(String schemaLocation,
                        String reference)
                        throws ClassNotFoundException
Maps schema location to a class which should be used as the base for the SchemaBinding.

Parameters:
schemaLocation - the location of the schema
reference - the fully qualified class name to build the SchemaBinding from
Throws:
ClassNotFoundException - if the reference cannot be loaded

mapLocationToClass

void mapLocationToClass(String schemaLocation,
                        Class<?> clazz)
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

void mapLocationToClasses(String schemaLocation,
                          String... reference)
                          throws ClassNotFoundException
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
reference - the array of fully qualified class names to build the SchemaBinding from
Throws:
ClassNotFoundException - if at least one of the references cannot be loaded

mapLocationToClasses

void mapLocationToClasses(String schemaLocation,
                          Class<?>... classes)
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

removeLocationToClassMapping

Class<?>[] removeLocationToClassMapping(String schemaLocation)
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.


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