IcedTea-Web
NetX

net.sourceforge.jnlp.util
Class Reflect

java.lang.Object
  extended by net.sourceforge.jnlp.util.Reflect

public class Reflect
extends java.lang.Object

Provides simply, convenient methods to invoke methods by name. This class is used to consolidate reflection needed to access methods specific to Sun's JVM or to remain backward compatible while supporting method in newer JVMs.

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 Summary
Reflect()
          Create a new Reflect instance.
Reflect(boolean accessible)
          Create a new Reflect instance.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reflect

public Reflect()
Create a new Reflect instance.


Reflect

public Reflect(boolean accessible)
Create a new Reflect instance.

Parameters:
accessible - whether to bypass access permissions
Method Detail

invokeStatic

public java.lang.Object invokeStatic(java.lang.String className,
                                     java.lang.String method)
Invoke a zero-parameter static method by name.


invokeStatic

public java.lang.Object invokeStatic(java.lang.String className,
                                     java.lang.String method,
                                     java.lang.Object[] args)
Invoke the static method using the specified parameters.


invoke

public java.lang.Object invoke(java.lang.Object object,
                               java.lang.String method)
Invoke a zero-parameter method by name on the specified object.


invoke

public 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.

Returns:
the result of the method, or null on exception.

getMethod

public 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.


IcedTea-Web
NetX

Submit a bug or feature