org.exolab.castor.xml
Class XMLMappingLoader

java.lang.Object
  extended byorg.exolab.castor.mapping.loader.MappingLoader
      extended byorg.exolab.castor.xml.XMLMappingLoader
All Implemented Interfaces:
MappingResolver

public class XMLMappingLoader
extends MappingLoader

An XML implementation of mapping helper. Creates XML class descriptors from the mapping file.

Version:
$Revision: 1.31 $ $Date: 2002/01/18 23:24:32 $
Author:
Assaf Arkin

Field Summary
 
Fields inherited from class org.exolab.castor.mapping.loader.MappingLoader
NoDescriptor
 
Constructor Summary
XMLMappingLoader(java.lang.ClassLoader loader, java.io.PrintWriter logWriter)
          Creates a new XMLMappingLoader
 
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  TypeInfo getTypeInfo(java.lang.Class fieldType, CollectionHandler colHandler, FieldMapping fieldMap)
           
protected  void resolveRelations(ClassDescriptor clsDesc)
           
 
Methods inherited from class org.exolab.castor.mapping.loader.MappingLoader
addDescriptor, createFieldDescs, getClassLoader, getDescriptor, getLogWriter, listDescriptors, listJavaClasses, loadClassDescriptor, loadMapping, resolveType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMappingLoader

public XMLMappingLoader(java.lang.ClassLoader loader,
                        java.io.PrintWriter logWriter)
                 throws MappingException
Creates a new XMLMappingLoader

Method Detail

resolveRelations

protected void resolveRelations(ClassDescriptor clsDesc)
                         throws MappingException
Overrides:
resolveRelations in class MappingLoader
Throws:
MappingException

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

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

getTypeInfo

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


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