net.sf.jsefa.common.accessor
Interface ObjectAccessor


public interface ObjectAccessor

An ObjectAccessor provides access to an object (i.e. creates it) and to its fields (retrieval and setting of field values).

Author:
Norman Lahme-Huetig

Method Summary
 Object createObject()
          Creates a new instance of the class this ObjectAccessor was created for.
 Object getValue(Object object, String fieldName)
          Returns the value of the field with the name fieldName of the given object.
 void setValue(Object object, String fieldName, Object value)
          Sets the value of the field with the name fieldName of the given object.
 

Method Detail

createObject

Object createObject()
Creates a new instance of the class this ObjectAccessor was created for.

Returns:
a new object.

getValue

Object getValue(Object object,
                String fieldName)
Returns the value of the field with the name fieldName of the given object.

Parameters:
object - the object
fieldName - the field name
Returns:
a field value

setValue

void setValue(Object object,
              String fieldName,
              Object value)
Sets the value of the field with the name fieldName of the given object.

Parameters:
object - the object
fieldName - the field name
value - the field value


Copyright © 2014. All rights reserved.