Class FieldVariableBinding
java.lang.Object
com.singularsys.jep.misc.boundvariable.FieldVariableBinding
- All Implemented Interfaces:
VariableBinding,Serializable
A
VariableBinding which binds variables to a particular field of an object.
Uses the reflection mechanism of Class.getField(String).- Since:
- Jep 3.5
- Author:
- Richard Morris
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFieldVariableBinding(Object obj, Field field) Create the binding object with the name of a field.FieldVariableBinding(Object obj, String fieldName) Create the binding object with the name of a field. -
Method Summary
-
Field Details
-
obj
-
fieldName
-
field
-
-
Constructor Details
-
FieldVariableBinding
public FieldVariableBinding(Object obj, String fieldName) throws SecurityException, NoSuchFieldException Create the binding object with the name of a field.- Parameters:
obj- the objectfieldName- the name of the field- Throws:
SecurityException- if the field can not be accessed.NoSuchFieldException- if the field does not exist.
-
FieldVariableBinding
Create the binding object with the name of a field.- Parameters:
obj- the objectfield- a field object
-
-
Method Details
-
getValue
Gets the value of the associated field.- Specified by:
getValuein interfaceVariableBinding- Returns:
- the value
- Throws:
IllegalArgumentExceptionIllegalAccessException- See Also:
-
setValue
Sets the value of the associated field.- Specified by:
setValuein interfaceVariableBinding- Parameters:
value- the value- Throws:
IllegalArgumentExceptionIllegalAccessException- See Also:
-