org.exolab.castor.persist
Class ClassMolderHelper

java.lang.Object
  extended by org.exolab.castor.persist.ClassMolderHelper

public final class ClassMolderHelper
extends java.lang.Object

Utility class that provides (mostly) static methods in relation to the functions required by a ClassMolder.


Field Summary
static org.apache.commons.logging.Log LOG
          Logger used for logging.
 
Method Summary
static java.util.ArrayList extractIdentityList(TransactionContext tx, ClassMolder molder, java.lang.Object col)
          Return all the object identity of a Collection of object of the same type.
static java.util.Collection getAddedValuesList(TransactionContext tx, java.util.ArrayList orgIds, java.lang.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 java.util.Iterator getIterator(java.lang.Object object)
          Return the iterator on values of the specified Collection or, return the iterator on values of the specified Map.
static java.util.Collection getRemovedIdsList(TransactionContext tx, java.util.ArrayList orgIds, java.lang.Object collection, ClassMolder ch)
          It is assumed the returned collection will not be modified.
static boolean isEquals(java.util.Collection c1, java.util.Collection c2)
          Utility method to compare collections for equality.
static boolean isEquals(java.lang.Object o1, java.lang.Object o2)
          A utility method which compare object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Logger used for logging.

Method Detail

isEquals

public static boolean isEquals(java.lang.Object o1,
                               java.lang.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(java.util.Collection c1,
                               java.util.Collection c2)
Utility method to compare collections for equality.

Parameters:
c1 - collection one.
c2 - collection two.
Returns:
True if the collections are equal.

extractIdentityList

public static java.util.ArrayList extractIdentityList(TransactionContext tx,
                                                      ClassMolder molder,
                                                      java.lang.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

getIterator

public static java.util.Iterator getIterator(java.lang.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.

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.
Throws:
MappingException

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.

Throws:
MappingException

getAddedValuesList

public static java.util.Collection getAddedValuesList(TransactionContext tx,
                                                      java.util.ArrayList orgIds,
                                                      java.lang.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.


getRemovedIdsList

public static java.util.Collection getRemovedIdsList(TransactionContext tx,
                                                     java.util.ArrayList orgIds,
                                                     java.lang.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.



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