net.sourceforge.jnlp.util
public class Reflect extends java.lang.Object
Most methods of this class invoke the first method on the specified object that matches the name and number of parameters. The type of the parameters are not considered, so do not attempt to use this class to invoke overloaded methods.
Instances of this class are not synchronized.
Constructor and Description |
---|
Reflect()
Create a new Reflect instance.
|
Reflect(boolean accessible)
Create a new Reflect instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Method |
getMethod(java.lang.Class type,
java.lang.String method,
java.lang.Object[] args)
Return the Method matching the specified name and number of
arguments.
|
java.lang.Object |
invoke(java.lang.Object object,
java.lang.String method)
Invoke a zero-parameter method by name on the specified
object.
|
java.lang.Object |
invoke(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
Invoke a method by name with the specified parameters.
|
java.lang.Object |
invokeStatic(java.lang.String className,
java.lang.String method)
Invoke a zero-parameter static method by name.
|
java.lang.Object |
invokeStatic(java.lang.String className,
java.lang.String method,
java.lang.Object[] args)
Invoke the static method using the specified parameters.
|
public Reflect()
public Reflect(boolean accessible)
accessible
- whether to bypass access permissionspublic java.lang.Object invokeStatic(java.lang.String className, java.lang.String method)
public java.lang.Object invokeStatic(java.lang.String className, java.lang.String method, java.lang.Object[] args)
public java.lang.Object invoke(java.lang.Object object, java.lang.String method)
public java.lang.Object invoke(java.lang.Object object, java.lang.String method, java.lang.Object[] args)
public java.lang.reflect.Method getMethod(java.lang.Class type, java.lang.String method, java.lang.Object[] args)