intarsys runtime library

de.intarsys.tools.objectmodel
Class FunctorField

java.lang.Object
  extended by de.intarsys.tools.objectmodel.Member
      extended by de.intarsys.tools.objectmodel.FunctorField
All Implemented Interfaces:
IField, IMember, IFieldHandler

public class FunctorField
extends Member
implements IField

The wrapper around IFunctor to make it an IField.


Constructor Summary
FunctorField(String name, IFunctor getFunctor, IFunctor setFunctor)
           
 
Method Summary
 IClass getFieldType()
          The declared type of the field.
 String getName()
          The name of the IMember.
 Object getValue(Object receiver)
          Make a reflective read access to the field represented by this within the receiver.
 Object setValue(Object receiver, Object value)
          Make a reflective write access to the field represented by this within receiver.
 
Methods inherited from class de.intarsys.tools.objectmodel.Member
getDeclaringClass, hasModifier, setDeclaringClass, setModifiers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.intarsys.tools.objectmodel.IMember
getDeclaringClass, hasModifier
 

Constructor Detail

FunctorField

public FunctorField(String name,
                    IFunctor getFunctor,
                    IFunctor setFunctor)
Method Detail

getFieldType

public IClass getFieldType()
Description copied from interface: IField
The declared type of the field.

Specified by:
getFieldType in interface IField
Returns:
The declared type of the field.

getName

public String getName()
Description copied from interface: IMember
The name of the IMember.

Specified by:
getName in interface IMember
Returns:
The name of the IMember.

getValue

public Object getValue(Object receiver)
                throws FieldAccessException
Description copied from interface: IFieldHandler
Make a reflective read access to the field represented by this within the receiver.

Specified by:
getValue in interface IFieldHandler
Parameters:
receiver - The object hosting the field.
Returns:
The field value
Throws:
FieldAccessException

setValue

public Object setValue(Object receiver,
                       Object value)
                throws FieldAccessException
Description copied from interface: IFieldHandler
Make a reflective write access to the field represented by this within receiver.

Specified by:
setValue in interface IFieldHandler
Parameters:
receiver - The object hosting the field.
value - The new value for the field
Returns:
The previous field value. This is an optional feature.
Throws:
FieldAccessException

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.