Package org.coliper.ibean.proxy
Interface IBeanFieldAccess
-
public interface IBeanFieldAccessInterface provided toExtensionHandlers to gain access to the field values of their corresponding proxy bean. Only used inExtensionHandlercontext, for example inExtensionHandler.handleExtendedInterfaceCall(IBeanContext, IBeanFieldAccess, Object, java.lang.reflect.Method, Object[])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetFieldValue(String fieldName)Retrieves the value of a bean field.ObjectgetFieldValue(IBeanFieldMetaInfo fieldMeta)Retrieves the value of a bean field.voidsetFieldValue(String fieldName, Object newValue)Changes the value of a field to the specified value.voidsetFieldValue(IBeanFieldMetaInfo fieldMeta, Object newValue)Changes the value of a field to the specified value.
-
-
-
Method Detail
-
setFieldValue
void setFieldValue(String fieldName, Object newValue)
Changes the value of a field to the specified value.- Parameters:
fieldName- specifies the field to change; must match to an existing field namenewValue- the new value of the field; may benull. The type of the given value must match the field type; types that can be converted by Java implicit type conversion are allowed as well, for exampleintinstead oflong.- Throws:
IllegalArgumentException- if the fieldName does not existClassCastException- if the value type does not match the field type
-
getFieldValue
Object getFieldValue(String fieldName)
Retrieves the value of a bean field.- Parameters:
fieldName- specifies the field to retrieve; must be an existing field name- Returns:
- the value having expected field type. Prititive types are
converted to their object types. Value may be
null. - Throws:
IllegalArgumentException- if the fieldName does not exist
-
setFieldValue
void setFieldValue(IBeanFieldMetaInfo fieldMeta, Object newValue)
Changes the value of a field to the specified value.- Parameters:
fieldMeta- specifies the field to change; must match to the respective bean typenewValue- the new value of the field; may benull. The type of the given value must match the field type; types that can be converted by Java implicit type conversion are allowed as well, for exampleintinstead oflong.- Throws:
IllegalArgumentException- iffieldMetadoes not belong to the bean classClassCastException- if the value type does not match the field type
-
getFieldValue
Object getFieldValue(IBeanFieldMetaInfo fieldMeta)
Retrieves the value of a bean field.- Parameters:
fieldMeta- specifies the field to retrieve; must match to the respective bean type- Returns:
- the value having expected field type. Prititive types are
converted to their object types. Value may be
null. - Throws:
IllegalArgumentException- if the fieldName does not exist
-
-