org.exolab.castor.xml
Interface XMLClassDescriptorResolver
- ClassDescriptorResolver
- XMLClassDescriptorResolverImpl
public interface XMLClassDescriptorResolver
An interface for finding or "resolving" XMLClassDescriptor classes.
Note: This interface is used by the marshalling Framework for
resolving XMLClassDescriptors for non-primitive types. There are no
guarantees that this class will be called for java native classes.
$Revision: 5951 $ $Date: 2005-02-28 17:41:38 -0700 (Mon, 28 Feb
2005) $ void | addClass(Class clazz) - Loads the class descriptor for the class instance specified.
|
void | addClass(String className) - Loads the class descriptor for the class instance specified.
|
void | addClasses(Class[] clazzes) - Loads the class descriptors for the class instances specified.
|
void | addClasses(String[] classNames) - Loads the class descriptors for the class instances specified.
|
void | addPackage(String packageName) - Loads class descriptors from the package specified.
|
void | addPackages(String[] packageNames) - Loads class descriptors from the packages specified.
|
void | cleanDescriptorCache() - To clear the descriptor cache.
|
void | loadClassDescriptors(String packageName) - Please use e.g.
|
XMLClassDescriptor | resolve(String className) - Returns the XMLClassDescriptor for the given class name.
|
XMLClassDescriptor | resolve(String className, ClassLoader loader) - Returns the XMLClassDescriptor for the given class name.
|
Iterator | resolveAllByXMLName(String xmlName, String namespaceURI, ClassLoader loader) - Returns an enumeration of XMLClassDescriptor objects that match the given
xml name.
|
XMLClassDescriptor | resolveByXMLName(String xmlName, String namespaceURI, ClassLoader loader) - Returns the first XMLClassDescriptor that matches the given XML name and
namespaceURI.
|
void | setClassLoader(ClassLoader loader) - Sets the ClassLoader to use when loading class descriptors.
|
void | setInternalContext(InternalContext xmlContext) - To set the XMLContext to be used.
|
void | setIntrospector(Introspector introspector) - To set the Introspector to be used.
|
void | setLoadPackageMappings(boolean loadPackageMappings) - Sets whether or not to look for and load package specific mapping files
(".castor.xml").
|
void | setResolverStrategy(ResolverStrategy resolverStrategy) - The resolver strategy to use for class and package resolving.
|
void | setUseIntrospection(boolean enable) - Enables or disables introspection.
|
addClass
public void addClass(Class clazz)
throws ResolverException
Loads the class descriptor for the class instance specified. The use of
this method is useful when no mapping is used, as happens when the domain
classes have been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
clazz
- Class for which the associated descriptor should be loaded.
ResolverException
- If there's an unrecoverable problem with resolving a certain
class.
addClass
public void addClass(String className)
throws ResolverException
Loads the class descriptor for the class instance specified. The use of
this method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
className
- Name of the class for which the associated descriptor should
be loaded.
ResolverException
- If there's an unrecoverable problem with resolving a certain
class.
addClasses
public void addClasses(Class[] clazzes)
throws ResolverException
Loads the class descriptors for the class instances specified. The use of
this method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
clazzes
- Classes for which the associated descriptors should be loaded.
ResolverException
- If there's an unrecoverable problem with resolving a certain
class.
addClasses
public void addClasses(String[] classNames)
throws ResolverException
Loads the class descriptors for the class instances specified. The use of
this method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
classNames
- Names of the classes for which the associated descriptors
should be loaded.
ResolverException
- If there's an unrecoverable problem with resolving a certain
class.
addPackage
public void addPackage(String packageName)
throws ResolverException
Loads class descriptors from the package specified. The use of this
method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
Please note that this functionality will work only if you provide the
.castor.cdr file with your generated classes (as generated by
the XML code generator).
packageName
- The package name for the (descriptor) classes
ResolverException
- If there's a problem loading class descriptors for the given
package.
addPackages
public void addPackages(String[] packageNames)
throws ResolverException
Loads class descriptors from the packages specified. The use of this
method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
Please note that this functionality will work only if you provide the
.castor.cdr files with your generated classes (as generated by
the XML code generator).
packageNames
- The package names for the (descriptor) classes
ResolverException
- If there's a problem loading class descriptors for the given
package.
cleanDescriptorCache
public void cleanDescriptorCache()
To clear the descriptor cache.
loadClassDescriptors
public void loadClassDescriptors(String packageName)
throws ResolverException
Please use e.g. #addPackage(String) instead.
Loads class descriptors from the package specified. The use of this
method is useful when no mapping is used, as happens when the domain
classes hase been generated using the XML code generator (in which case
instead of a mapping file class descriptor files will be generated).
Please note that this functionality will work only if you provide the
.castor.cdr file with your generated classes (as generated by
the XML code generator).
packageName
- The package name for the (descriptor) classes
ResolverException
- If there's a problem loading class descriptors for the given
package.
resolve
public XMLClassDescriptor resolve(String className)
throws ResolverException
Returns the XMLClassDescriptor for the given class name.
className
- the class name to find the XMLClassDescriptor for
- the XMLClassDescriptor for the given class name
resolve
public XMLClassDescriptor resolve(String className,
ClassLoader loader)
throws ResolverException
Returns the XMLClassDescriptor for the given class name.
className
- the class name to find the XMLClassDescriptor forloader
- the ClassLoader to use
- the XMLClassDescriptor for the given class name
resolveAllByXMLName
public Iterator resolveAllByXMLName(String xmlName,
String namespaceURI,
ClassLoader loader)
throws ResolverException
Returns an enumeration of XMLClassDescriptor objects that match the given
xml name.
xmlName
- The class name to find the XMLClassDescriptor for.namespaceURI
- The namespace URI to identify the XMLClassDescriptor.loader
- The ClassLoader to use.
- An Iterator of XMLClassDescriptor objects.
resolveByXMLName
public XMLClassDescriptor resolveByXMLName(String xmlName,
String namespaceURI,
ClassLoader loader)
throws ResolverException
Returns the first XMLClassDescriptor that matches the given XML name and
namespaceURI. Null is returned if no descriptor can be found.
xmlName
- The class name to find the XMLClassDescriptor for.namespaceURI
- The namespace URI to identify the XMLClassDescriptor.loader
- The ClassLoader to use.
- The XMLClassDescriptor for the given XML name.
setClassLoader
public void setClassLoader(ClassLoader loader)
Sets the ClassLoader to use when loading class descriptors.
loader
- the ClassLoader to use
setInternalContext
public void setInternalContext(InternalContext xmlContext)
To set the XMLContext to be used.
xmlContext
- the XMLContext to be used
setIntrospector
public void setIntrospector(Introspector introspector)
To set the Introspector to be used. It is stored as attribute of resolver
and set as property into the current strategy.
introspector
- the Introspector to use
setLoadPackageMappings
public void setLoadPackageMappings(boolean loadPackageMappings)
Sets whether or not to look for and load package specific mapping files
(".castor.xml").
loadPackageMappings
- a boolean that enables or disables the loading of package
specific mapping files
setResolverStrategy
public void setResolverStrategy(ResolverStrategy resolverStrategy)
The resolver strategy to use for class and package resolving. Will set
the current attributes into the new strategy.
resolverStrategy
- the ResolverStrategy to use for resolve calls
setUseIntrospection
public void setUseIntrospection(boolean enable)
Enables or disables introspection. Introspection is enabled by default.
enable
- a flag to indicate whether or not introspection is allowed.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com