|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.cpa.util.JDOClassDescriptorResolverImpl
public class JDOClassDescriptorResolverImpl
JDO-specific ClassDescriptorResolver
instance that provides
functionality to find or "resolve" ClassDescriptor
s from a given
class (name).
JDOClassDescriptorResolver
Field Summary | |
---|---|
protected java.util.List<java.lang.Class<?>> |
_classes
List of manually added domain Class es. |
protected java.util.List<java.lang.String> |
_packages
List of manually added package names. |
Constructor Summary | |
---|---|
JDOClassDescriptorResolverImpl()
Creates an instance of this class, with no classed manually added. |
Method Summary | |
---|---|
void |
addClass(java.lang.Class domainClass)
Adds a given Class instance manually, so that it can be loaded from
the file system. |
void |
addPackage(java.lang.String packageName)
Adds a given package name manually, so that class descriptors can be loaded from this package (from the file system). |
java.util.Iterator<ClassDescriptor> |
descriptorIterator()
Returns an iterator over all the known descriptors in the original order they have been added. |
java.lang.ClassLoader |
getClassLoader()
Returns the ClassLoader instance as used internally. |
MappingLoader |
getMappingLoader()
Note: This method will be removed soon (kv). |
void |
registerDescriptor(java.lang.Class type,
ClassDescriptor classDescriptor)
Registers a ClassDescriptor with the descriptor cache. |
ClassDescriptor |
resolve(java.lang.Class type)
Returns the ClassDescriptor for the given class using the following strategy. Lookup the class descriptor cache Call ClassResolutionByMappingLoader command
Call ClassResolutionByFile command
|
ClassDescriptor |
resolve(java.lang.String type)
Returns the ClassDescriptor for the given class. |
void |
setMappingLoader(MappingLoader 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 |
Field Detail |
---|
protected java.util.List<java.lang.Class<?>> _classes
Class
es.
protected java.util.List<java.lang.String> _packages
Constructor Detail |
---|
public JDOClassDescriptorResolverImpl()
Method Detail |
---|
public ClassDescriptor resolve(java.lang.String type) throws ResolverException
resolve
in interface JDOClassDescriptorResolver
type
- the class name to find the ClassDescriptor for
ResolverException
- Indicates that the given Class
cannot be resolved.public ClassDescriptor resolve(java.lang.Class type) throws ResolverException
ClassResolutionByMappingLoader
command
ClassResolutionByFile
command
resolve
in interface ClassDescriptorResolver
type
- the Class to find the ClassDescriptor for
ResolverException
- Indicates that the given Class
cannot be resolved.public void registerDescriptor(java.lang.Class type, ClassDescriptor classDescriptor)
ClassDescriptor
with the descriptor cache.
registerDescriptor
in interface JDOClassDescriptorResolver
type
- Type of the class described by the ClassDescriptor
to register.classDescriptor
- The ClassDescriptor
to register with the cache.public MappingLoader getMappingLoader()
getMappingLoader
in interface ClassDescriptorResolver
public void setMappingLoader(MappingLoader mappingLoader)
setMappingLoader
in interface ClassDescriptorResolver
public void addClass(java.lang.Class domainClass)
Class
instance manually, so that it can be loaded from
the file system.
addClass
in interface JDOClassDescriptorResolver
domainClass
- A given Class
instance.public void addPackage(java.lang.String packageName)
addPackage
in interface JDOClassDescriptorResolver
packageName
- A given package name.public java.util.Iterator<ClassDescriptor> descriptorIterator()
ClassDescriptor
.
descriptorIterator
in interface JDOClassDescriptorResolver
Iterator
over all the known JDO class descriptors.public java.lang.ClassLoader getClassLoader()
ClassLoader
instance as used internally.
getClassLoader
in interface JDOClassDescriptorResolver
ClassLoader
instance used internally.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |