org.exolab.castor.persist

Class ClassMolderHelper


public final class ClassMolderHelper
extends java.lang.Object

Field Summary

static Log
LOG

Method Summary

static ArrayList
extractIdentityList(TransactionContext tx, ClassMolder molder, Object col)
Return all the object identity of a Collection of object of the same type.
static Collection
getAddedValuesList(TransactionContext tx, ArrayList orgIds, Object collection, ClassMolder ch)
It is assumed the returned collection will not be modified.
static FieldMapping[]
getFullFields(ClassMapping clsMap)
Get all the field mapping, including all the field in extended class, but id fields.
static FieldMapping[]
getIdFields(ClassMapping clsMap)
Get the all the id fields of a class If the class, C, is a dependent class, then the depended class', D, id fields will be appended at the back and returned.
static Iterator
getIterator(Object object)
Return the iterator on values of the specified Collection or, return the iterator on values of the specified Map.
static Collection
getRemovedIdsList(TransactionContext tx, ArrayList orgIds, Object collection, ClassMolder ch)
It is assumed the returned collection will not be modified.
static boolean
isEquals(Collection c1, Collection c2)
Utility method to compare collections for equality.
static boolean
isEquals(Object o1, Object o2)
A utility method which compare object.
static Vector
resolve(ClassDescriptorResolver cdResolver, LockEngine lock, PersistenceFactory factory)
Resolve and construct all the ClassMolders given a MappingLoader.

Field Details

LOG

public static final Log LOG

Method Details

extractIdentityList

public static ArrayList extractIdentityList(TransactionContext tx,
                                            ClassMolder molder,
                                            Object col)
Return all the object identity of a Collection of object of the same type.
Parameters:
tx - the transaction context
molder - class molder of the type of the objects
col - a Collection or Vector containing
Returns:
an ArrayLists which contains list of object identity

getAddedValuesList

public static Collection getAddedValuesList(TransactionContext tx,
                                            ArrayList orgIds,
                                            Object collection,
                                            ClassMolder ch)
It is assumed the returned collection will not be modified. Any modification to the returned collection may or may not affect the original collection or map.

getFullFields

public static FieldMapping[] getFullFields(ClassMapping clsMap)
            throws MappingException
Get all the field mapping, including all the field in extended class, but id fields.
Parameters:
clsMap - ClassMapping instance.
Returns:
An array.

getIdFields

public static FieldMapping[] getIdFields(ClassMapping clsMap)
            throws MappingException
Get the all the id fields of a class If the class, C, is a dependent class, then the depended class', D, id fields will be appended at the back and returned. If the class is an extended class, the id fields of the extended class will be returned.

getIterator

public static Iterator getIterator(Object object)
Return the iterator on values of the specified Collection or, return the iterator on values of the specified Map.
Parameters:
object - - a Collection instance.

getRemovedIdsList

public static Collection getRemovedIdsList(TransactionContext tx,
                                           ArrayList orgIds,
                                           Object collection,
                                           ClassMolder ch)
It is assumed the returned collection will not be modified. Any modification to the returned collection may or may not affect the original collection or map.

isEquals

public static boolean isEquals(Collection c1,
                               Collection c2)
Utility method to compare collections for equality.
Parameters:
c1 - collection one.
c2 - collection two.
Returns:
True if the collections are equal.

isEquals

public static boolean isEquals(Object o1,
                               Object o2)
A utility method which compare object.
Parameters:
o1 - First object instance
o2 - Second object instance
Returns:
True if the objects compared are equal

resolve

public static Vector resolve(ClassDescriptorResolver cdResolver,
                             LockEngine lock,
                             PersistenceFactory factory)
            throws MappingException,
                   ClassNotFoundException
Resolve and construct all the ClassMolders given a MappingLoader.
Parameters:
lock - LockEngine for all the ClassMolder
factory - factory class for getting Persistent of the ClassMolder
Returns:
Vector of all of the ClassMolders from a MappingLoader

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