org.exolab.castor.xml.util
Class ClassDescriptorResolverImpl

java.lang.Object
  extended by org.exolab.castor.xml.util.ClassDescriptorResolverImpl
All Implemented Interfaces:
ClassDescriptorResolver

public class ClassDescriptorResolverImpl
extends java.lang.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
(package private)  class ClassDescriptorResolverImpl.XCDEnumerator
          A locally used implementation of ClassDescriptorEnumeration
 
Constructor Summary
ClassDescriptorResolverImpl()
          Creates a new ClassDescriptorResolverImpl
ClassDescriptorResolverImpl(java.lang.ClassLoader loader)
          Creates a new ClassDescriptorResolverImpl with the given ClassLoader
 
Method Summary
 void associate(java.lang.Class type, XMLClassDescriptor classDesc)
          Associates (or binds) a class type with a given ClassDescriptor
 Introspector getIntrospector()
          Returns the Introspector being used by this ClassDescriptorResolver.
 XMLMappingLoader getMappingLoader()
          
Note: This method will be removed soon (kv).
 XMLClassDescriptor resolve(java.lang.Class type)
          Returns the XMLClassDescriptor for the given class
 XMLClassDescriptor resolve(java.lang.String className)
          Returns the XMLClassDescriptor for the given class name
 XMLClassDescriptor resolve(java.lang.String className, java.lang.ClassLoader loader)
          Returns the XMLClassDescriptor for the given class name
 ClassDescriptorEnumeration resolveAllByXMLName(java.lang.String xmlName, java.lang.String namespaceURI, java.lang.ClassLoader loader)
          Returns an enumeration of XMLClassDescriptor objects that match the given xml name
 XMLClassDescriptor resolveByXMLName(java.lang.String xmlName, java.lang.String namespaceURI, java.lang.ClassLoader loader)
          Returns the first XMLClassDescriptor that matches the given XML name and namespaceURI.
 void setClassLoader(java.lang.ClassLoader loader)
          Sets the ClassLoader to use when loading class descriptors
 void setIntrospection(boolean enable)
          Enables or disables introspection.
 void setLoadPackageMappings(boolean loadPackageMappings)
          Sets whether or not to look for and load package specific mapping files (".castor.xml" files).
 void setMappingLoader(XMLMappingLoader mappingLoader)
          Sets the mapping loader for this ClassDescriptorResolver
Note: This method will be removed soon (kv).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassDescriptorResolverImpl

public ClassDescriptorResolverImpl()
Creates a new ClassDescriptorResolverImpl


ClassDescriptorResolverImpl

public ClassDescriptorResolverImpl(java.lang.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(java.lang.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()
Description copied from interface: ClassDescriptorResolver

Note: This method will be removed soon (kv).

Specified by:
getMappingLoader in interface ClassDescriptorResolver

resolve

public XMLClassDescriptor resolve(java.lang.Class type)
                           throws ResolverException
Returns the XMLClassDescriptor for the given class

Specified by:
resolve in interface ClassDescriptorResolver
Parameters:
type - the Class to find the XMLClassDescriptor for
Returns:
the XMLClassDescriptor for the given class
Throws:
ResolverException

resolve

public XMLClassDescriptor resolve(java.lang.String className)
                           throws ResolverException
Returns the XMLClassDescriptor for the given class name

Specified by:
resolve in interface ClassDescriptorResolver
Parameters:
className - the class name to find the XMLClassDescriptor for
Returns:
the XMLClassDescriptor for the given class name
Throws:
ResolverException

resolve

public XMLClassDescriptor resolve(java.lang.String className,
                                  java.lang.ClassLoader loader)
                           throws ResolverException
Returns the XMLClassDescriptor for the given class name

Specified by:
resolve in interface ClassDescriptorResolver
Parameters:
className - the class name to find the XMLClassDescriptor for
loader - the ClassLoader to use
Returns:
the XMLClassDescriptor for the given class name
Throws:
ResolverException

resolveByXMLName

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

Specified by:
resolveByXMLName in interface ClassDescriptorResolver
Parameters:
className - the class name to find the XMLClassDescriptor for
loader - the ClassLoader to use
Returns:
the XMLClassDescriptor for the given XML name

resolveAllByXMLName

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

Specified by:
resolveAllByXMLName in interface ClassDescriptorResolver
Parameters:
className - the class name to find the XMLClassDescriptor for
loader - the ClassLoader to use
Returns:
an enumeration of XMLClassDescriptor objects.

setClassLoader

public void setClassLoader(java.lang.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)
Description copied from interface: ClassDescriptorResolver
Sets the mapping loader for this ClassDescriptorResolver
Note: This method will be removed soon (kv).

Specified by:
setMappingLoader in interface ClassDescriptorResolver


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com