Java Over HTTP Vuser Functions > Alphabetical List of Functions > lrapi.lr2.fieldGetter

lrapi.lr2.fieldGetter

Example: fieldGetter and fieldSetter Java 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
Argument Description
subject The object to reflect. 
path The path to the array or member. 

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 that the default java behavior, which is to access members directly.

Parameterization

Parameterization is not applicable to this function.