org.exolab.castor.persist

Class ClassMolderHelper

public final class ClassMolderHelper extends Object

Method Summary
static ArrayListextractIdentityList(TransactionContext tx, ClassMolder molder, Object col)
Return all the object identity of a Collection of object of the same type.
static CollectiongetAddedValuesList(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 IteratorgetIterator(Object object)
Return the iterator on values of the specified Collection Or, return the iterator on values of the specified Map
static CollectiongetRemovedIdsList(TransactionContext tx, ArrayList orgIds, Object collection, ClassMolder ch)
It is assumed the returned collection will not be modified.
static booleanisEquals(Object o1, Object o2)
A utility method which compare object.
static booleanisEquals(Collection c1, Collection c2)
Utility method to compare collections for equality
static Vectorresolve(MappingLoader loader, LockEngine lock, PersistenceFactory factory)
Resolve and construct all the ClassMolders given a MappingLoader.

Method Detail

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)
Get all the field mapping, including all the field in extended class, but id fields

Parameters: clsMap ClassMapping instance

Returns: An array

Throws: MappingException

getIdFields

public 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. 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(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

isEquals

public static boolean isEquals(Collection c1, Collection c2)
Utility method to compare collections for equality

Parameters: c1 collection one. c2collection two.

Returns: True if the collections are equal.

resolve

public static Vector resolve(MappingLoader loader, LockEngine lock, PersistenceFactory factory)
Resolve and construct all the ClassMolders given a MappingLoader.

Parameters: loader MappingLoader for the LockEngine 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-2004. All rights reserved http://www.intalio.com