org.exolab.castor.jdo.engine
Class JDOMappingLoader

java.lang.Object
  extended by org.exolab.castor.mapping.loader.MappingLoader
      extended by org.exolab.castor.jdo.engine.JDOMappingLoader
All Implemented Interfaces:
MappingResolver

public class JDOMappingLoader
extends MappingLoader

A JDO implementation of mapping helper. Creates JDO class descriptors from the mapping file.

Version:
$Revision: 1.8 $ $Date: 2005/08/03 21:11:51 $
Author:
Assaf Arkin

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exolab.castor.mapping.loader.MappingLoader
MappingLoader.TypeInfoReference
 
Field Summary
 
Fields inherited from class org.exolab.castor.mapping.loader.MappingLoader
EMPTY_ARGS, NoDescriptor, STRING_ARG, VALUE_OF
 
Constructor Summary
JDOMappingLoader(java.lang.ClassLoader loader, java.io.PrintWriter logWriter)
           
 
Method Summary
protected  ClassDescriptor createDescriptor(ClassMapping clsMap)
          Creates a new descriptor.
protected  FieldDescriptor createFieldDesc(java.lang.Class javaClass, FieldMapping fieldMap)
          Creates a single field descriptor.
protected  java.lang.String[] getSqlTypes(FieldMapping fieldMap)
          Parse the sql type attribute to build an array of types, needed to support whitespace inside parameterized types (see Bug 1045)
protected  TypeInfo getTypeInfo(java.lang.Class fieldType, CollectionHandler colHandler, FieldMapping fieldMap)
           
 void loadMapping(MappingRoot mapping, java.lang.Object param)
          Loads the mapping from the specified mapping object.
 
Methods inherited from class org.exolab.castor.mapping.loader.MappingLoader
addDescriptor, createFieldDescs, createFieldHandler, findAccessor, getClassLoader, getDescriptor, getDescriptor, getLogWriter, isPrimitive, listDescriptors, listJavaClasses, loadClassDescriptor, resolveRelations, resolveType, setAllowRedefinitions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOMappingLoader

public JDOMappingLoader(java.lang.ClassLoader loader,
                        java.io.PrintWriter logWriter)
Method Detail

createDescriptor

protected ClassDescriptor createDescriptor(ClassMapping clsMap)
                                    throws MappingException
Description copied from class: MappingLoader
Creates a new descriptor. The class mapping information is used to create a new stock ClassDescriptor. Implementations may extend this class to create a more suitable descriptor.

Overrides:
createDescriptor in class MappingLoader
Parameters:
clsMap - The class mapping information
Throws:
MappingException - An exception indicating why mapping for the class cannot be created

getSqlTypes

protected java.lang.String[] getSqlTypes(FieldMapping fieldMap)
Parse the sql type attribute to build an array of types, needed to support whitespace inside parameterized types (see Bug 1045)


getTypeInfo

protected TypeInfo getTypeInfo(java.lang.Class fieldType,
                               CollectionHandler colHandler,
                               FieldMapping fieldMap)
                        throws MappingException
Overrides:
getTypeInfo in class MappingLoader
Throws:
MappingException

createFieldDesc

protected FieldDescriptor createFieldDesc(java.lang.Class javaClass,
                                          FieldMapping fieldMap)
                                   throws MappingException
Description copied from class: MappingLoader
Creates a single field descriptor. The field mapping is used to create a new stock FieldDescriptor. Implementations may extend this class to create a more suitable descriptor.

Overrides:
createFieldDesc in class MappingLoader
Parameters:
javaClass - The class to which the field belongs
fieldMap - The field mapping information
Returns:
The field descriptor
Throws:
MappingException - The field or its accessor methods are not found, not accessible, not of the specified type, etc

loadMapping

public void loadMapping(MappingRoot mapping,
                        java.lang.Object param)
                 throws MappingException
Description copied from class: MappingLoader
Loads the mapping from the specified mapping object. Calls MappingLoader.createDescriptor(org.exolab.castor.mapping.xml.ClassMapping) to create each descriptor and MappingLoader.addDescriptor(org.exolab.castor.mapping.ClassDescriptor) to store it. Also loads all the included mapping files.

Overrides:
loadMapping in class MappingLoader
Parameters:
mapping - The mapping information
param - Arbitrary parameter that can be used by subclasses
Throws:
MappingException - The mapping file is invalid


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