org.openxava.util
Class Objects

java.lang.Object
  extended by org.openxava.util.Objects

Deprecated. User XObjects instead. This class will be removed in future OpenXava versions.

public class Objects
extends java.lang.Object

Utility class to work with objects.


Constructor Summary
Objects()
          Deprecated.  
 
Method Summary
static java.lang.Object clone(java.lang.Object o)
          Deprecated. Clone the sent object.
static java.lang.Object deepClone(java.lang.Object source)
          Deprecated. Does an deep clone of the sent object.
static java.lang.Object execute(java.lang.Class theClass, java.lang.String methodName)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an static method of an class.
static java.lang.Object execute(java.lang.Class theClass, java.lang.String methodName, java.lang.Class argumentClass, java.lang.Object arg)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an static method of an class.
static java.lang.Object execute(java.lang.Class theClass, java.lang.String methodName, java.lang.Class argumentClass1, java.lang.Object arg1, java.lang.Class argumentClass2, java.lang.Object arg2)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an static method of an class.
static java.lang.Object execute(java.lang.Object o, java.lang.String methodName)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an method of an object.
static java.lang.Object execute(java.lang.Object o, java.lang.String methodName, java.lang.Class argumentClass, java.lang.Object arg)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an method of an object.
static java.lang.Object execute(java.lang.Object o, java.lang.String methodName, java.lang.Class argumentClass1, java.lang.Object arg1, java.lang.Class argumentClass2, java.lang.Object arg2)
          Deprecated. Allows to execute dinamically (as in SmallTalk) an method of an object.
static java.lang.Object tryClone(java.lang.Object o)
          Deprecated. Try to clone the sent object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Objects

public Objects()
Deprecated. 
Method Detail

clone

public static java.lang.Object clone(java.lang.Object o)
                              throws java.lang.CloneNotSupportedException
Deprecated. 
Clone the sent object.

The clone is done using the method clone() of the sent object if this implements Cloneable

Throws:
java.lang.CloneNotSupportedException - If the object is not Cloneable.

deepClone

public static java.lang.Object deepClone(java.lang.Object source)
                                  throws CloneException
Deprecated. 
Does an deep clone of the sent object.

If the argument is null, then returns null.

Parameters:
source - Must be serializable. It's not necessary that it implements Cloneable.
Returns:
Clone of the sent object. Does an clon of all levels, complete, deep.
Throws:
CloneException - Any problem on cloning.

execute

public static java.lang.Object execute(java.lang.Object o,
                                       java.lang.String methodName)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an method of an object.

Parameters:
o - Object where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target object.

execute

public static java.lang.Object execute(java.lang.Object o,
                                       java.lang.String methodName,
                                       java.lang.Class argumentClass,
                                       java.lang.Object arg)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an method of an object.

Parameters:
o - Object where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
argumentClass - Not null.
arg - Argument value. It can be null.
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target object.

execute

public static java.lang.Object execute(java.lang.Object o,
                                       java.lang.String methodName,
                                       java.lang.Class argumentClass1,
                                       java.lang.Object arg1,
                                       java.lang.Class argumentClass2,
                                       java.lang.Object arg2)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an method of an object.

Parameters:
o - Object where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
argumentClass1 - Not null.
arg1 - Argument value. It can be null.
argumentClass2 - Not null.
arg2 - Argument value. It can be null.
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target object.

execute

public static java.lang.Object execute(java.lang.Class theClass,
                                       java.lang.String methodName,
                                       java.lang.Class argumentClass1,
                                       java.lang.Object arg1,
                                       java.lang.Class argumentClass2,
                                       java.lang.Object arg2)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an static method of an class.

Parameters:
theClass - The class where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
argumentClass1 - Not null.
arg1 - Argument value. It can be null.
argumentClass2 - Not null.
arg2 - Argument value. It can be null. *
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target class.

execute

public static java.lang.Object execute(java.lang.Class theClass,
                                       java.lang.String methodName,
                                       java.lang.Class argumentClass,
                                       java.lang.Object arg)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an static method of an class.

Parameters:
theClass - The class where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
argumentClass - Not null.
arg - Argument value. It can be null.
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target class.

execute

public static java.lang.Object execute(java.lang.Class theClass,
                                       java.lang.String methodName)
                                throws java.lang.Exception
Deprecated. 
Allows to execute dinamically (as in SmallTalk) an static method of an class.

Parameters:
theClass - The class where the method will be executed. It cannot be null.
methodName - Name of the method to execute.
Returns:
Result of method execution.
Throws:
java.lang.Exception - Any problem, including exceptions from target method.
java.lang.NoSuchMethodException - If the method does not exist in target class.

tryClone

public static java.lang.Object tryClone(java.lang.Object o)
Deprecated. 
Try to clone the sent object.

If it does not win it, then return the original element.
The clone is done using the method clone() of the sent object, if it implements Cloneable.