Interface IBeanFieldAccess

    • 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 name
        newValue - the new value of the field; may be null. 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 example int instead of long.
        Throws:
        IllegalArgumentException - if the fieldName does not exist
        ClassCastException - 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 type
        newValue - the new value of the field; may be null. 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 example int instead of long.
        Throws:
        IllegalArgumentException - if fieldMeta does not belong to the bean class
        ClassCastException - 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