tyrex.resource.castor
Class ResourceMappingLoader

java.lang.Object
  |
  +--org.exolab.castor.mapping.loader.MappingLoader
        |
        +--org.exolab.castor.xml.XMLMappingLoader
              |
              +--tyrex.resource.castor.ResourceMappingLoader
All Implemented Interfaces:
org.exolab.castor.mapping.MappingResolver

public final class ResourceMappingLoader
extends org.exolab.castor.xml.XMLMappingLoader

Implementation of org.exolab.castor.xml.XMLMappingLoader that overrides the class descriptor for non tyrex and java classes.

This class is not thread-safe.

Author:
Riad Mohammed

Inner classes inherited from class org.exolab.castor.xml.XMLMappingLoader
org.exolab.castor.xml.XMLMappingLoader.ContainerElementFieldDescriptor, org.exolab.castor.xml.XMLMappingLoader.IdentityConvertor
 
Inner classes inherited from class org.exolab.castor.mapping.loader.MappingLoader
org.exolab.castor.mapping.loader.MappingLoader.TypeInfoReference
 
Field Summary
(package private) static org.apache.log4j.Category CATEGORY
          Logging category
 
Fields inherited from class org.exolab.castor.mapping.loader.MappingLoader
NoDescriptor
 
Constructor Summary
ResourceMappingLoader()
          Creates the ResourceMappingLoader
 
Method Summary
protected  org.exolab.castor.mapping.FieldDescriptor createFieldDesc(java.lang.Class javaClass, org.exolab.castor.mapping.xml.FieldMapping fieldMap)
          Creates a single field descriptor.
 org.exolab.castor.mapping.ClassDescriptor getDescriptor(java.lang.Class type)
          Returns the class descriptor for the specified Java class.
 
Methods inherited from class org.exolab.castor.xml.XMLMappingLoader
, createDescriptor, getTypeInfo, resolveRelations
 
Methods inherited from class org.exolab.castor.mapping.loader.MappingLoader
addDescriptor, createFieldDescs, createFieldHandler, findAccessor, getClassLoader, getLogWriter, listDescriptors, listJavaClasses, loadClassDescriptor, loadMapping, resolveType, setAllowRedefinitions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CATEGORY

static final org.apache.log4j.Category CATEGORY
Logging category
Constructor Detail

ResourceMappingLoader

public ResourceMappingLoader()
                      throws org.exolab.castor.mapping.MappingException
Creates the ResourceMappingLoader
Method Detail

getDescriptor

public org.exolab.castor.mapping.ClassDescriptor getDescriptor(java.lang.Class type)
Returns the class descriptor for the specified Java class. In no such descriptor exists, returns null.

If the type comes from an object created by a field whose type is ResourceConfig then a special class descriptor is created and returned.

Overrides:
getDescriptor in class org.exolab.castor.mapping.loader.MappingLoader
Parameters:
type - The Java class
Returns:
A suitable class descriptor or null

createFieldDesc

protected org.exolab.castor.mapping.FieldDescriptor createFieldDesc(java.lang.Class javaClass,
                                                                    org.exolab.castor.mapping.xml.FieldMapping fieldMap)
                                                             throws org.exolab.castor.mapping.MappingException
Creates a single field descriptor. The field mapping is used to create a new stock FieldDescriptor.

If the java class is a subclass of ResourceConfig then the field handler of the default field descriptor is overridden with #SpyFieldHandlerImpl.

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


Intalio Inc. (C) 1999-2001. All rights reserved.