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
public abstract class AbstractMappingLoader2 extends java.lang.Object implements MappingLoader
-
-
Constructor Summary
Constructors Constructor Description AbstractMappingLoader2(java.lang.ClassLoader loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDescriptor(ClassDescriptor descriptor)Adds a class descriptor.voidclear()java.lang.ClassLoadergetClassLoader()Returns the class loader associated with this mapping loader if one was specified.ClassDescriptorgetDescriptor(java.lang.String classname)Returns the ClassDescriptor for the class with the given name.java.util.List<ClassDescriptor>getDescriptors()Returns a List ofClassDescriptors of all known descriptors.booleanisAllowRedefinition()Is the ability to allow redefinitions enabled or disabled?protected booleanloadMapping()Return if mapping should be loaded with this MappingLoader instance or if another mapping have been loaded previously.voidsetAllowRedefinitions(boolean allow)Enables or disables the ability to allow the redefinition of class mappings.voidsetClassLoader(java.lang.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
-
-
-
-
Method Detail
-
clear
public final void clear()
- Specified by:
clearin interfaceMappingLoader
-
setClassLoader
public final void setClassLoader(java.lang.ClassLoader loader)
- Specified by:
setClassLoaderin interfaceMappingLoader- See Also:
MappingLoader.setClassLoader(java.lang.ClassLoader)
-
getClassLoader
public final java.lang.ClassLoader getClassLoader()
Description copied from interface:MappingLoaderReturns 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:
getClassLoaderin interfaceMappingLoader- See Also:
MappingLoader.getClassLoader()
-
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
protected final void addDescriptor(ClassDescriptor descriptor) throws MappingException
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
public final ClassDescriptor getDescriptor(java.lang.String classname)
Description copied from interface:MappingLoaderReturns 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:
getDescriptorin interfaceMappingLoader- Parameters:
classname- The className for which to return the associated ClassDescriptor.- Returns:
- The ClassDescriptor or null if not found.
- See Also:
MappingLoader.getDescriptor(java.lang.String)
-
getDescriptors
public final java.util.List<ClassDescriptor> getDescriptors()
Description copied from interface:MappingLoaderReturns a List ofClassDescriptors of all known descriptors.- Specified by:
getDescriptorsin 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:
trueif mapping should be loaded,falseotherwise.
-
-