Class FWReflectionHelper
java.lang.Object
net.simplace.core.FWReflectionHelper
Reads values of static fields by reflection, used for
${STATIC:...} parameters.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FWReflectionHelper
public FWReflectionHelper()
-
-
Method Details
-
getString
Returns the value of a static field given by its full name.- Parameters:
afterFirstDivider- fully qualified class name and field name, e.g.net.simplace.core.FWConstants.PROCESS_TIME- Returns:
- the field value as string, or
nullif it cannot be read (the error is logged)
-
getVariableValue
public static String getVariableValue(Class<?> c, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException Returns the value of a static field of a class (also non-public fields).- Parameters:
c- the classfieldName- name of the static field- Returns:
- the field value as string, or
nullif the value isnull - Throws:
IllegalArgumentException- if the field is not staticIllegalAccessException- if the field cannot be accessedNoSuchFieldException- if the class has no such fieldSecurityException- if access is denied
-