net.sf.jga.fn.property
public class GetProperty<T,R> extends AbstractUnaryFunctor<T,R> implements Serializable
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 David A. Hall
Nested Class Summary | |
---|---|
interface | GetProperty.Visitor
Interface for classes that may interpret a GetProperty
function. |
Constructor Summary | |
---|---|
GetProperty(String propName)
Builds a GetProperty for the given property. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(GetProperty) method, if it
implements the nested Visitor interface. |
R | fn(T arg)
Returns the value of the designated property of the argument |
String | toString() |
Throws: IllegalArgumentException if the property name is null or empty
visit(GetProperty)
method, if it
implements the nested Visitor interface.Returns: the value of the designated property of the argument
Throws: EvaluationException if the argument does not have the designated public property, or if it is not of the correct type.