| net.sf.jga.fn.property.InvokeNoArgMethod
InvokeNoArgMethod | public class InvokeNoArgMethod extends UnaryFunctor (Code) | | Functor that invokes a no-arg method named at construction and returns the
result or null if the result is void.
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 © 2003-2005 David A. Hall
author: David A. Hall |
Method Summary | |
public void | accept(net.sf.jga.fn.Visitor v) Calls the Visitor's visit(InvokeMethod) method, if it
implements the nested Visitor interface. | public R | fn(T obj) Invokes the method on the given object, and returns the result.
the result of the designated method of the object throws: EvaluationException - if the argument does not have the designatedpublic property, or if it is not of the correct type. | public synchronized Method | getMethod() | public String | getMethodName() Returns the name of the property that this functor retrieves. | public Class<R> | getReturnType() | public String | toString() |
serialVersionUID | final static long serialVersionUID(Code) | | |
InvokeNoArgMethod | public InvokeNoArgMethod(Class<T> objclass, String methName)(Code) | | Builds a InvokeMethod for the given method, which takes no arguments.
throws: IllegalArgumentException - if the method name is null or empty |
InvokeNoArgMethod | public InvokeNoArgMethod(Class<T> objClass, Method method)(Code) | | Builds a InvokeMethod for the given method, which takes no arguments.
throws: IllegalArgumentException - if the method name is null or empty,or if it is not defined for the given class, or if it takes arguments |
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(InvokeMethod) method, if it
implements the nested Visitor interface.
|
fn | public R fn(T obj)(Code) | | Invokes the method on the given object, and returns the result.
the result of the designated method of the object throws: EvaluationException - if the argument does not have the designatedpublic property, or if it is not of the correct type. |
getMethodName | public String getMethodName()(Code) | | Returns the name of the property that this functor retrieves.
|
getReturnType | public Class<R> getReturnType()(Code) | | Returns the type of the method
|
|
|