|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.Reflective
public final class Reflective
This is a utility class to call different methods of classes via java.lang.reflect package.
| Method Summary | |
|---|---|
static Object |
call(Object pObject,
boolean pOnlyDeclared,
String pMethod,
Object... pParams)
Invokes the method of an object without changing the access to the method. |
static Object |
call(Object pObject,
String pMethod,
Object... pParams)
Invokes the method of an object without changing the access to the method. |
static Object |
construct(Class<?> pClass,
boolean pOnlyDeclared,
Object... pParams)
Invokes the constructor of a pre-loaded class. |
static Object |
construct(Class<?> pClass,
Object... pParams)
Invokes the constructor of a pre-loaded class. |
static Object |
construct(ClassLoader pClassLoader,
String pClassName,
Object... pParams)
Invokes the constructor of a desired class. |
static Object |
construct(String pClassName,
Object... pParams)
Invokes the constructor of a desired class. |
static Object |
get(Object pObject,
String pProperty)
Invokes the get method of the given property. |
static String |
getMethodDeclaration(Class pClass,
String pMethod,
Object... pParams)
Gets the human readable method declaration of a method with its parameter list. |
static Object |
getValue(Object pObject,
Field pField)
Gets the value from a vield. |
static Object |
getValue(Object pObject,
String pFieldName)
Gets the value from a field. |
static Object |
invoke(Object pObject,
Method pMethod,
Object... pParams)
Invokes a method with parameters. |
static void |
invokeLater(Runnable pRunnable)
Causes pRunnable.run() to be executed asynchronously on the
current event dispatching thread. |
static void |
set(Object pObject,
String pProperty,
Object pValue)
Invokes the set method of the given property. |
static void |
setValue(Object pObject,
Field pField,
Object pValue)
Sets a field on a specified object value. |
static void |
setValue(Object pObject,
String pFieldName,
Object pValue)
Sets a field on a specified object value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final Object construct(String pClassName,
Object... pParams)
throws Throwable
pClassName - full qualified class namepParams - parameters for the constructor
Throwable - if it is not possible to invoke the constructor
public static final Object construct(ClassLoader pClassLoader,
String pClassName,
Object... pParams)
throws Throwable
pClassLoader - an optional ClassLoader for dynamic class loadingpClassName - full qualified class namepParams - parameters for the constructor
Throwable - if it is not possible to invoke the constructor
public static final Object construct(Class<?> pClass,
Object... pParams)
throws Throwable
pClass - the pre-loaded classpParams - parameters for the constructor
Throwable - if it is not possible to invoke the constructor
public static final Object construct(Class<?> pClass,
boolean pOnlyDeclared,
Object... pParams)
throws Throwable
pClass - the pre-loaded classpOnlyDeclared - true to use only declared constructorspParams - parameters for the constructor
Throwable - if it is not possible to invoke the constructor
public static final Object call(Object pObject,
String pMethod,
Object... pParams)
throws Throwable
pObject - object with the desired methodpMethod - invocable methodpParams - parameters for the method
Throwable - if it is not possible to invoke the method
public static final Object call(Object pObject,
boolean pOnlyDeclared,
String pMethod,
Object... pParams)
throws Throwable
pObject - object with the desired methodpOnlyDeclared - true to use only declared methodspMethod - invocable methodpParams - parameters for the method
Throwable - if it is not possible to invoke the method
public static final String getMethodDeclaration(Class pClass,
String pMethod,
Object... pParams)
pClass - the classpMethod - method or full qualified class namepParams - parameter list
public static void setValue(Object pObject,
String pFieldName,
Object pValue)
throws Throwable
pObject - the object with the fieldpFieldName - the field namepValue - the new value
Throwable - if it is not possible to set the desired fieldsetValue(Object, Field, Object)
public static void setValue(Object pObject,
Field pField,
Object pValue)
throws Throwable
pObject - the object with the fieldpField - the fieldpValue - the new value
Throwable - if it is not possible to set the desired field
public static Object getValue(Object pObject,
String pFieldName)
throws Throwable
pObject - the object with the fieldpFieldName - the field name
Throwable - if it is not possible to get the value of desired field or the field is not presendgetValue(Object, Field)
public static Object getValue(Object pObject,
Field pField)
throws Throwable
pObject - the object with the fieldpField - the field
Throwable - if it is not possible to get the value of desired field or the field is not presend
public static Object invoke(Object pObject,
Method pMethod,
Object... pParams)
throws Throwable
pObject - the object with the methodpMethod - the methodpParams - the method parameters
Throwable - if an error occurs during invocation
public static Object get(Object pObject,
String pProperty)
throws Throwable
pObject - the object with the methodpProperty - the property
Throwable - if an error occurs during invocation
public static void set(Object pObject,
String pProperty,
Object pValue)
throws Throwable
pObject - the object with the methodpProperty - the propertypValue - the value of the property.
Throwable - if an error occurs during invocationpublic static void invokeLater(Runnable pRunnable)
pRunnable.run() to be executed asynchronously on the
current event dispatching thread. There are different technologies
with different invokeLater implementations. To find the UI
dependent method the current factory manager will be used. If there is
no factory manager, then the pRunnable.run() will be
started within the current thread.
pRunnable - specific functionality to run asynchronous
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||