public abstract class AbstractMappingLoader extends AbstractMappingLoader2
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractMappingLoader.TypeInfoReference
A class used to by the createFieldHandler method in order to
save the reference of the TypeInfo that was used.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.Class[] |
EMPTY_ARGS
Empty array of class types used for reflection.
|
protected static ClassDescriptor |
NO_DESCRIPTOR |
protected static java.lang.Class[] |
STRING_ARG
The string argument for the valueOf method, used for introspection when searching for
type-safe enumeration style classes.
|
protected static java.lang.String |
VALUE_OF
Factory method name for type-safe enumerations.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMappingLoader(java.lang.ClassLoader loader)
Constructs a new mapping helper.
|
| Modifier and Type | Method and Description |
|---|---|
protected ClassDescriptor |
createDescriptor(ClassMapping clsMap)
Creates a new descriptor.
|
protected FieldDescriptor |
createFieldDesc(java.lang.Class javaClass,
FieldMapping fieldMap)
Creates a single field descriptor.
|
protected FieldHandler |
createFieldHandler(java.lang.Class javaClass,
java.lang.Class fldType,
FieldMapping fldMap,
AbstractMappingLoader.TypeInfoReference typeInfoRef)
Creates the FieldHandler for the given FieldMapping.
|
protected static java.lang.reflect.Method |
findAccessor(java.lang.Class javaClass,
java.lang.String methodName,
java.lang.Class fieldType,
boolean getMethod)
Returns the named accessor.
|
static java.lang.String[] |
getIdentityColumnNames(java.lang.String[] ids,
ClassMapping clsMap)
Returns a list of column names that are part of the identity.
|
java.lang.String |
getSourceType() |
protected TypeInfo |
getTypeInfo(java.lang.Class fieldType,
CollectionHandler colHandler,
FieldMapping fieldMap) |
protected static boolean |
isPrimitive(java.lang.Class type)
Returns true if the given class should be treated as a primitive
type
|
protected void |
loadMappingInternal(MappingRoot mapping,
java.lang.Object param)
Loads the mapping from the specified mapping object.
|
protected void |
resolveRelations(ClassDescriptor clsDesc) |
protected java.lang.Class |
resolveType(java.lang.String typeName)
Returns the Java class for the named type.
|
addDescriptor, clear, descriptorIterator, getClassLoader, getDescriptor, isAllowRedefinition, loadMapping, setAllowRedefinitions, setClassLoaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBindingTypeprotected static final java.lang.Class[] EMPTY_ARGS
protected static final java.lang.Class[] STRING_ARG
protected static final java.lang.String VALUE_OF
protected static final ClassDescriptor NO_DESCRIPTOR
protected AbstractMappingLoader(java.lang.ClassLoader loader)
loader - The class loader to use, null for the defaultpublic final java.lang.String getSourceType()
protected final java.lang.Class resolveType(java.lang.String typeName)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionprotected void loadMappingInternal(MappingRoot mapping, java.lang.Object param) throws MappingException
#createDescriptor to
create each descriptor and AbstractMappingLoader2.addDescriptor(org.exolab.castor.mapping.ClassDescriptor) to store it. Also loads all the included
mapping files.loadMappingInternal in class AbstractMappingLoader2mapping - The mapping information.param - Arbitrary parameter that can be used by subclasses.MappingException - The mapping file is invalid.protected void resolveRelations(ClassDescriptor clsDesc)
protected ClassDescriptor createDescriptor(ClassMapping clsMap) throws MappingException
ClassDescriptor. Implementations may extend this class to create a
more suitable descriptor.clsMap - The class mapping information.MappingException - An exception indicating why mapping for the class cannot
be created.protected FieldDescriptor createFieldDesc(java.lang.Class javaClass, FieldMapping fieldMap) throws MappingException
FieldDescriptor. Implementations may extend this class to create a more
suitable descriptor.javaClass - The class to which the field belongs.fieldMap - The field mapping information.MappingException - The field or its accessor methods are not
found, not accessible, not of the specified type, etc.protected final FieldHandler createFieldHandler(java.lang.Class javaClass, java.lang.Class fldType, FieldMapping fldMap, AbstractMappingLoader.TypeInfoReference typeInfoRef) throws MappingException
javaClass - the class type of the parent of the field.fldType - the Java class type for the field.fldMap - the field mapping.MappingExceptionprotected TypeInfo getTypeInfo(java.lang.Class fieldType, CollectionHandler colHandler, FieldMapping fieldMap) throws MappingException
MappingExceptionprotected static final java.lang.reflect.Method findAccessor(java.lang.Class javaClass,
java.lang.String methodName,
java.lang.Class fieldType,
boolean getMethod)
throws MappingException
javaClass - The class to which the field belongs.methodName - The name of the accessor method.fieldType - The type of the field if known, or null.getMethod - True if get method, false if set method.MappingException - The method is not accessible or is not of the
specified type.public static final java.lang.String[] getIdentityColumnNames(java.lang.String[] ids,
ClassMapping clsMap)
ids - Known identity names.clsMap - Class mapping.protected static final boolean isPrimitive(java.lang.Class type)
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com