| org.apache.beehive.netui.tags.AbstractClassicTag org.apache.beehive.netui.tags.databinding.invoke.AbstractCallMethod
All known Subclasses: org.apache.beehive.netui.tags.databinding.invoke.CallMethod,
AbstractCallMethod | abstract public class AbstractCallMethod extends AbstractClassicTag (Code) | |
An abstract base class for tags that are capable of reflectively invoking methods. Specializations of this
tag provide method implementations that locate the object on which to invoke the method and that handle
any return value from the invoked method.
The CallMethod tag can have child tags of type
MethodParameter ; these tags must be in the same
order as the parameter list in the method signature of the method that will be invoked. To invoke an overloaded
method, the
MethodParameter.setType(String) property must be set to the String name of the type to pass
to the method. If the type attribute values on nested
MethodParameter tags do not match any method
signature, an error will be reported in the page.
|
Inner Class :protected class ParamNode | |
Method Summary | |
public void | addParameter(String type, Object parameter) Add a paramter that will be passed as an argument to the method that will be invoked. | protected boolean | allowNullInvocationTarget() When implemented to return true, this method allows a tag invoking a method to
accept a null invocation target and simply return null. | public int | doEndTag() Reflectively invokes the method specified by the method attribute,
AbstractCallMethod.findMethod(Object,String,boolean) . | public int | doStartTag() Causes the body of this tag to be rendered; only
MethodParameter tags are allowed to be
contained inside of this tag. | abstract protected Method | findMethod(Object target, String methodName, boolean verifyTypes) | abstract protected String | getObjectName() Get the name of the object that is the target of the invocation. | protected List | getParameterNodes() Internal, read-only property used by subclasses to get
the list of parameters to be used when reflectively
invoking a method. | protected void | handleReturnValue(Object result)
A method that allows concrete classes to handle the result of the
reflective invocation in an implementation specific way.
The default beahavior is to set the return value resulting from invoking the method
in the
javax.servlet.jsp.PageContext attribute map of the current JSP page.
The result is set as an attribute if the result is not null and the
CallMethod.setResultId(java.lang.String) String is not null. | protected void | localRelease() Reset all of the fields of this tag. | abstract protected Object | resolveObject()
Resolve the object on which the method should be invoked. | public void | setFailOnError(boolean failOnError) Sets whether or not to report exceptions to the page when errors occur invoking a method on an object. | public void | setMethod(String method) Sets the name of a method to invoke on the target object. | public void | setResultId(String resultId) Sets the identifier at which the result of invoking the method will stored. |
addParameter | public void addParameter(String type, Object parameter)(Code) | | Add a paramter that will be passed as an argument to the method that will be invoked. This method
is implemented to allow the the
MethodParameter tags to register their parameters. This
object is passed in the position that it appeared in the set of child
MethodParameter tags.
Parameters: type - a String of the type or class name of this parameter Parameters: parameter - an object that should be passed as an argument to the invoked method See Also: MethodParameter |
allowNullInvocationTarget | protected boolean allowNullInvocationTarget()(Code) | | When implemented to return true, this method allows a tag invoking a method to
accept a null invocation target and simply return null. The default
implementation returns false.
true if the object on which to invoke the method can be null; false otherwise. |
findMethod | abstract protected Method findMethod(Object target, String methodName, boolean verifyTypes)(Code) | | The default findMethod implementation is an uncached search of all
of the methods available on the Class of the target
Parameters: target - the object from which to find the method Parameters: methodName - the name of the method to find Parameters: verifyTypes - a boolean that if true will match the type names in addition to the String method name a Method object matching the methodName and types, if verifyTypes is true.null otherwise. |
getObjectName | abstract protected String getObjectName()(Code) | | Get the name of the object that is the target of the invocation. This is a generic method for this
tag that enables more specific error reporting.
a name for the object on which the method will be invoked. |
getParameterNodes | protected List getParameterNodes()(Code) | | Internal, read-only property used by subclasses to get
the list of parameters to be used when reflectively
invoking a method. If the method takes no parameters, this
list will be of size zero.
the list of parameters |
localRelease | protected void localRelease()(Code) | | Reset all of the fields of this tag.
|
resolveObject | abstract protected Object resolveObject() throws ObjectNotFoundException, JspException(Code) | |
Resolve the object on which the method should be invoked. If there are errors resolving this object,
this method will throw an
ObjectNotFoundException .
If the object is not found but no exception occurred, this method returns null .
the object on which to reflectively invoke the method or null if theobject was not found and no exception occurred. throws: ObjectNotFoundException - if an exception occurred attempting to resolve an object |
setFailOnError | public void setFailOnError(boolean failOnError)(Code) | | Sets whether or not to report exceptions to the page when errors occur invoking a method on an object.
Parameters: failOnError - a boolean that defines whether or not exceptions should be thrown when invocation fails. |
setMethod | public void setMethod(String method)(Code) | | Sets the name of a method to invoke on the target object.
Parameters: method - the name of the method to invoke |
setResultId | public void setResultId(String resultId)(Code) | | Sets the identifier at which the result of invoking the method will stored. Once stored, the
result of the reflective invocation will be available via the JSP EL implicit object
${pageScope} with the attribute name set via this property.
Parameters: resultId - a String that names an attribute in the PageContext'sattribute map where any resulting object will be stored. |
|
|