org.exolab.castor.xml.util

Class ClassDescriptorResolverImpl

public class ClassDescriptorResolverImpl extends Object implements ClassDescriptorResolver

The default implementation of the ClassDescriptorResolver interface

Version: $Revision: 1.9 $ $Date: 2005/03/30 10:10:25 $

Author: Keith Visco

Nested Class Summary
classClassDescriptorResolverImpl.XCDEnumerator
A locally used implementation of ClassDescriptorEnumeration
Constructor Summary
ClassDescriptorResolverImpl()
Creates a new ClassDescriptorResolverImpl
ClassDescriptorResolverImpl(ClassLoader loader)
Creates a new ClassDescriptorResolverImpl with the given ClassLoader
Method Summary
voidassociate(Class type, XMLClassDescriptor classDesc)
Associates (or binds) a class type with a given ClassDescriptor
IntrospectorgetIntrospector()
Returns the Introspector being used by this ClassDescriptorResolver.
XMLMappingLoadergetMappingLoader()
XMLClassDescriptorresolve(Class type)
Returns the XMLClassDescriptor for the given class
XMLClassDescriptorresolve(String className)
Returns the XMLClassDescriptor for the given class name
XMLClassDescriptorresolve(String className, ClassLoader loader)
Returns the XMLClassDescriptor for the given class name
ClassDescriptorEnumerationresolveAllByXMLName(String xmlName, String namespaceURI, ClassLoader loader)
Returns an enumeration of XMLClassDescriptor objects that match the given xml name
XMLClassDescriptorresolveByXMLName(String xmlName, String namespaceURI, ClassLoader loader)
Returns the first XMLClassDescriptor that matches the given XML name and namespaceURI.
voidsetClassLoader(ClassLoader loader)
Sets the ClassLoader to use when loading class descriptors
voidsetIntrospection(boolean enable)
Enables or disables introspection.
voidsetLoadPackageMappings(boolean loadPackageMappings)
Sets whether or not to look for and load package specific mapping files (".castor.xml" files).
voidsetMappingLoader(XMLMappingLoader mappingLoader)

Constructor Detail

ClassDescriptorResolverImpl

public ClassDescriptorResolverImpl()
Creates a new ClassDescriptorResolverImpl

ClassDescriptorResolverImpl

public ClassDescriptorResolverImpl(ClassLoader loader)
Creates a new ClassDescriptorResolverImpl with the given ClassLoader

Parameters: loader the ClassLoader to use when loading ClassDescriptors

Method Detail

associate

public void associate(Class type, XMLClassDescriptor classDesc)
Associates (or binds) a class type with a given ClassDescriptor

Parameters: type the Class to associate with the given descriptor classDesc the ClassDescriptor to associate the given class with

getIntrospector

public Introspector getIntrospector()
Returns the Introspector being used by this ClassDescriptorResolver. This allows for configuration of the Introspector.

Returns: the Introspector being used by this ClassDescriptorResolver

getMappingLoader

public XMLMappingLoader getMappingLoader()

resolve

public XMLClassDescriptor resolve(Class type)
Returns the XMLClassDescriptor for the given class

Parameters: type the Class to find the XMLClassDescriptor for

Returns: the XMLClassDescriptor for the given class

resolve

public XMLClassDescriptor resolve(String className)
Returns the XMLClassDescriptor for the given class name

Parameters: className the class name to find the XMLClassDescriptor for

Returns: the XMLClassDescriptor for the given class name

resolve

public XMLClassDescriptor resolve(String className, ClassLoader loader)
Returns the XMLClassDescriptor for the given class name

Parameters: className the class name to find the XMLClassDescriptor for loader the ClassLoader to use

Returns: the XMLClassDescriptor for the given class name

resolveAllByXMLName

public ClassDescriptorEnumeration resolveAllByXMLName(String xmlName, String namespaceURI, ClassLoader loader)
Returns an enumeration of XMLClassDescriptor objects that match the given xml name

Parameters: className the class name to find the XMLClassDescriptor for loader the ClassLoader to use

Returns: an enumeration of XMLClassDescriptor objects.

resolveByXMLName

public XMLClassDescriptor resolveByXMLName(String xmlName, String namespaceURI, ClassLoader loader)
Returns the first XMLClassDescriptor that matches the given XML name and namespaceURI. Null is returned if no descriptor can be found.

Parameters: className the class name to find the XMLClassDescriptor for loader the ClassLoader to use

Returns: the XMLClassDescriptor for the given XML name

setClassLoader

public void setClassLoader(ClassLoader loader)
Sets the ClassLoader to use when loading class descriptors

Parameters: loader the ClassLoader to use

setIntrospection

public void setIntrospection(boolean enable)
Enables or disables introspection. Introspection is enabled by default.

Parameters: enable a flag to indicate whether or not introspection is allowed.

setLoadPackageMappings

public void setLoadPackageMappings(boolean loadPackageMappings)
Sets whether or not to look for and load package specific mapping files (".castor.xml" files).

Parameters: loadPackageMappings a boolean that enables or disables the loading of package specific mapping files

setMappingLoader

public void setMappingLoader(XMLMappingLoader mappingLoader)
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com