org.exolab.castor.mapping.loader

Class AbstractMappingLoader2

Implemented Interfaces:
MappingLoader
Known Direct Subclasses:
AbstractMappingLoader

public abstract class AbstractMappingLoader2
extends java.lang.Object
implements MappingLoader

Constructor Summary

AbstractMappingLoader2(ClassLoader loader)

Method Summary

protected void
addDescriptor(ClassDescriptor descriptor)
Adds a class descriptor.
void
clear()
Iterator
descriptorIterator()
ClassLoader
getClassLoader()
ClassDescriptor
getDescriptor(String classname)
boolean
isAllowRedefinition()
Is the ability to allow redefinitions enabled or disabled?
protected boolean
loadMapping()
Return if mapping should be loaded with this MappingLoader instance or if another mapping have been loaded previously.
void
setAllowRedefinitions(boolean allow)
Enables or disables the ability to allow the redefinition of class mappings.
void
setClassLoader(ClassLoader loader)

Constructor Details

AbstractMappingLoader2

public AbstractMappingLoader2(ClassLoader loader)

Method Details

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.

clear

public final void clear()
Specified by:
clear in interface MappingLoader

descriptorIterator

public final Iterator descriptorIterator()
Specified by:
descriptorIterator in interface MappingLoader
See Also:
{@inheritDoc}

getClassLoader

public final ClassLoader getClassLoader()
Specified by:
getClassLoader in interface MappingLoader
See Also:
{@inheritDoc}

getDescriptor

public final ClassDescriptor getDescriptor(String classname)
Specified by:
getDescriptor in interface MappingLoader
See Also:
{@inheritDoc}

isAllowRedefinition

public final boolean isAllowRedefinition()
Is the ability to allow redefinitions enabled or disabled?
Returns:
A boolean that when true enables redefinitions.

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.

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.

setClassLoader

public final void setClassLoader(ClassLoader loader)
Specified by:
setClassLoader in interface MappingLoader
See Also:
{@inheritDoc}

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