tyrex.resource.castor
Class ResourceMappingLoader

java.lang.Object
  extended byorg.exolab.castor.mapping.loader.MappingLoader
      extended byorg.exolab.castor.xml.XMLMappingLoader
          extended bytyrex.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

Field Summary
(package private) static 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, getClassLoader, getLogWriter, listDescriptors, listJavaClasses, loadClassDescriptor, loadMapping, resolveType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CATEGORY

static final 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.

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.

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


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.