| net.sf.jga.fn.property.SetProperty
SetProperty | public class SetProperty extends BinaryFunctor (Code) | | Binary Functor that sets the named property of the first argument to the
value. The property name and type are set at construction. The return
value will be that which the argument's property setter method returns
(generally either null or the old value).
Note that declaring the return type incorrectly can result in
ClassCastExceptions being thrown when the functor is invoked: the compiler
cannot check the return type of a reflectively loaded method.
Copyright © 2002-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | SetProperty(Class<T> argType, String propName, Class<R> propType) Builds a SetProperty that will return the value of the named property
of an instance of type argType. |
Method Summary | |
public void | accept(net.sf.jga.fn.Visitor v) Calls the Visitor's visit(SetProperty) method, if it
implements the nested Visitor interface. | public R | fn(T arg, R val) Sets the designated property of the argument to the given value. | public String | getPropertyName() Returns the name of the property that this functor sets. | public String | toString() |
serialVersionUID | final static long serialVersionUID(Code) | | |
SetProperty | public SetProperty(Class<T> argType, String propName, Class<R> propType)(Code) | | Builds a SetProperty that will return the value of the named property
of an instance of type argType. The property will be of type propType.
throws: IllegalArgumentException - if either argument is omitted, or ifthere is no such setter method in type argType. |
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(SetProperty) method, if it
implements the nested Visitor interface.
|
fn | public R fn(T arg, R val)(Code) | | Sets the designated property of the argument to the given value. When
the property's setter method returns a value, then this functor will
return it (otherwise it will return null).
the value returned by the designated property's setter method:generally it is null, but in some cases it might be the old value throws: EvaluationException - if the argument does not have the designatedpublic property, or if it is accept the given value. |
getPropertyName | public String getPropertyName()(Code) | | Returns the name of the property that this functor sets.
|
|
|