Example: fieldGetter and fieldSetterJava over HTTP Vuser Functions

Reflects an object and returns the value of a field.

public static Object fieldGetter(Object subject, String path) throws IllegalAccessException, NoSuchFieldException, ArrayIndexOutOfBoundsException


subject The object to reflect. 
path The path to the array or member. 

Return values

fieldGetter reflects an object and returns the value of a field.

If the path leads to a primitive variable, fieldGetter returns an Object wrapper. For example, Integer for int or Boolean for boolean.If the path leads to an Object, the function returns the value.

In specifying the path, members from inherited parent classes must be accessed using the super keyword. This is different than the default Java behavior, which is to access members directly.


Parameterization is not applicable to this function.