tests
Class PrivateAccessor

java.lang.Object
  extended by tests.PrivateAccessor

public class PrivateAccessor
extends java.lang.Object

Provides access to private members in classes.

Author:
Ross Burton, Mathias Ricken

Constructor Summary
PrivateAccessor()
           
 
Method Summary
static java.lang.Object callMethod(java.lang.Object o, java.lang.String methodName, java.lang.Class[] types, java.lang.Object[] params)
          Call the method specified.
static java.lang.Object callMethod(java.lang.Object o, java.lang.String methodName, java.lang.Object[] params)
          Call the method specified.
static java.lang.Object getField(java.lang.Object o, java.lang.String fieldName)
          Return the value of the field specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivateAccessor

public PrivateAccessor()
Method Detail

getField

public static java.lang.Object getField(java.lang.Object o,
                                        java.lang.String fieldName)
Return the value of the field specified.

Parameters:
o - method containing the field
fieldName - name of the field
Returns:
value of the field

callMethod

public static java.lang.Object callMethod(java.lang.Object o,
                                          java.lang.String methodName,
                                          java.lang.Class[] types,
                                          java.lang.Object[] params)
Call the method specified.

Parameters:
o - object containing the method
methodName - name of the method
types - type of the arguments
params - parameters
Returns:
return value

callMethod

public static java.lang.Object callMethod(java.lang.Object o,
                                          java.lang.String methodName,
                                          java.lang.Object[] params)
Call the method specified.

Parameters:
o - object containing the method
methodName - name of the method
params - parameters
Returns:
return value