Package org.exolab.castor.mapping.loader
Class AbstractMappingLoader2
java.lang.Object
org.exolab.castor.mapping.loader.AbstractMappingLoader2
- All Implemented Interfaces:
MappingLoader
- Direct Known Subclasses:
AbstractMappingLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addDescriptor
(ClassDescriptor descriptor) Adds a class descriptor.final void
clear()
final ClassLoader
Returns the class loader associated with this mapping loader if one was specified.final ClassDescriptor
getDescriptor
(String classname) Returns the ClassDescriptor for the class with the given name.final List<ClassDescriptor>
Returns a List ofClassDescriptor
s of all known descriptors.final boolean
Is the ability to allow redefinitions enabled or disabled?protected final boolean
Return if mapping should be loaded with this MappingLoader instance or if another mapping have been loaded previously.final void
setAllowRedefinitions
(boolean allow) Enables or disables the ability to allow the redefinition of class mappings.final void
setClassLoader
(ClassLoader loader) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.exolab.castor.mapping.MappingLoader
getBindingType, getSourceType
-
Constructor Details
-
AbstractMappingLoader2
-
-
Method Details
-
clear
public final void clear()- Specified by:
clear
in interfaceMappingLoader
-
setClassLoader
- Specified by:
setClassLoader
in interfaceMappingLoader
- See Also:
-
getClassLoader
Description copied from interface:MappingLoader
Returns the class loader associated with this mapping loader if one was specified. This is the class loader used to load all the classes mapped by this mapping loader. May be null if no class loader was specified or in certain JVMs.- Specified by:
getClassLoader
in interfaceMappingLoader
- See Also:
-
setAllowRedefinitions
public final void setAllowRedefinitions(boolean allow) Enables or disables the ability to allow the redefinition of class mappings.- Parameters:
allow
- A boolean that when true enables redefinitions.
-
isAllowRedefinition
public final boolean isAllowRedefinition()Is the ability to allow redefinitions enabled or disabled?- Returns:
- A boolean that when true enables redefinitions.
-
addDescriptor
Adds a class descriptor. Will throw a mapping exception if a descriptor for this class already exists.- Parameters:
descriptor
- The descriptor to add.- Throws:
MappingException
- A descriptor for this class already exists.
-
getDescriptor
Description copied from interface:MappingLoader
Returns the ClassDescriptor for the class with the given name. If no such ClassDescriptor exists, within the set of mappings for this MappingLoader, null will be returned.- Specified by:
getDescriptor
in interfaceMappingLoader
- Parameters:
classname
- The className for which to return the associated ClassDescriptor.- Returns:
- The ClassDescriptor or null if not found.
- See Also:
-
getDescriptors
Description copied from interface:MappingLoader
Returns a List ofClassDescriptor
s of all known descriptors.- Specified by:
getDescriptors
in interfaceMappingLoader
- Returns:
- List of
ClassDescriptor
-
loadMapping
protected final boolean loadMapping()Return if mapping should be loaded with this MappingLoader instance or if another mapping have been loaded previously. If no mapping have been loaded previously then prevent any other mapping to be loaded later on.- Returns:
true
if mapping should be loaded,false
otherwise.
-