net.yagga.util
Class MetaUt
java.lang.Object
|
+--net.yagga.util.MetaUt
- public class MetaUt
- extends java.lang.Object
Utilities for Meta classes, helper for Reflection and so on
- Author:
- Walter Gamba
|
Method Summary |
static java.lang.Object |
simpleInvokeMethod(java.lang.Class _class,
java.lang.Object target,
java.lang.String method,
java.lang.Object[] args)
Invokes a method of a given class and given object.
|
static java.lang.Object |
simpleInvokeMethod(java.lang.Class _class,
java.lang.Object target,
java.lang.String method,
java.lang.Object[] args,
boolean _static)
Invokes a method of a given class and given object.
|
static java.lang.Object |
simpleInvokeStaticMethod(java.lang.Class _class,
java.lang.String method,
java.lang.Object[] args)
Invokes a static method of a given class and given object.
|
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
MetaUt
public MetaUt()
simpleInvokeStaticMethod
public static java.lang.Object simpleInvokeStaticMethod(java.lang.Class _class,
java.lang.String method,
java.lang.Object[] args)
- Invokes a static method of a given class and given object.
The class must define this static
method which takes any number of arguments
and can return anything.
No arrays if not of the appropraite type needed by the method, i.e. no
conversion is attempted (example from array of String to array of Integers)
Please note that no overloading/polymorohism of methods is used. The first method that
has the same name as the one passed, and the same number of arguments, is used.
And of course,
"first" has no predictable meaning, so please be sure that you don't have ambiguities.
- Parameters:
_class - an Object representing the Class of targetmethod - the name of the method to invokeargs - the arguments to the method of this class of the jar file, as Objects- Returns:
- an Object containing the return value or values.
- See Also:
for description
simpleInvokeMethod
public static java.lang.Object simpleInvokeMethod(java.lang.Class _class,
java.lang.Object target,
java.lang.String method,
java.lang.Object[] args)
- Invokes a method of a given class and given object.
By default non static methods can be invoked
- See Also:
for description
simpleInvokeMethod
public static java.lang.Object simpleInvokeMethod(java.lang.Class _class,
java.lang.Object target,
java.lang.String method,
java.lang.Object[] args,
boolean _static)
- Invokes a method of a given class and given object.
The class must define this
method which takes any number of arguments
and can return anything.
No arrays if not of the appropraite type needed by the method, i.e. no
conversion is attempted (example from array of String to array of Integers)
Please note that no overloading/polymorohism of methods is used. The first method that
has the same name as the one passed, and the same number of arguments, is used.
And of course,
"first" has no predictable meaning, so please be sure that you don't have ambiguities.
- Parameters:
_class - an Object representing the Class of targettarget - the object on to which to invoke method. Can be null if method is staticmethod - the name of the method to invokeargs - the arguments to the method of this class of the jar file, as Object_static - boolean. If true method MUST be static, else no check is made- Returns:
- an Object containing th return value or values.