com.pow2.util
Class ReflectionUtil

java.lang.Object
  extended bycom.pow2.util.ReflectionUtil

public class ReflectionUtil
extends Object

Reflection Utility class.


Constructor Summary
ReflectionUtil()
           
 
Method Summary
static Object instanceObject(String className, Class[] constructorArgsTypes, Object[] constructorArgs)
          Return the object having the input class name, instanced with the constructor having the constructorArgsTypes arguments.
static void reflectClass(String name, OutputStream os)
          Reflect the input class state.
static void reflectClass(String name, Writer w)
          Reflect the input class state.
static void reflectObject(Object o, OutputStream os)
          Reflect the input object state.
static void reflectObject(Object o, Writer w)
          Reflect the input object state.
static String toString(Object o)
          Get the String representation of the input object
static String toString(String c)
          Get the String representation of the class having the input full qualified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtil

public ReflectionUtil()
Method Detail

instanceObject

public static Object instanceObject(String className,
                                    Class[] constructorArgsTypes,
                                    Object[] constructorArgs)
                             throws Exception
Return the object having the input class name, instanced with the constructor having the constructorArgsTypes arguments.

Parameters:
className - the object class name
constructorArgsTypes - the object constructor arguments classes
constructorArgs - the object constructor arguments values
Returns:
the instanced object
Throws:
Exception - if any error occurs

toString

public static String toString(Object o)
Get the String representation of the input object

Parameters:
o - the object to introspect
Returns:
the String representation of the input object

toString

public static String toString(String c)
Get the String representation of the class having the input full qualified name.

Parameters:
c - the full qualified name of the class to introspect
Returns:
the String representation of the input object

reflectObject

public static void reflectObject(Object o,
                                 OutputStream os)
Reflect the input object state.


reflectObject

public static void reflectObject(Object o,
                                 Writer w)
Reflect the input object state.

Parameters:
w - Description of the Parameter

reflectClass

public static void reflectClass(String name,
                                OutputStream os)
Reflect the input class state.

Parameters:
name - Description of the Parameter
os - Description of the Parameter

reflectClass

public static void reflectClass(String name,
                                Writer w)
Reflect the input class state.

Parameters:
name - Description of the Parameter
w - Description of the Parameter


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.