org.apache.beehive.netui.tags.databinding.invoke
Class CallMethod
Object
TagSupport
BodyTagSupport
AbstractClassicTag
AbstractCallMethod
CallMethod
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag
- Direct Known Subclasses:
- CallPageFlow
public class CallMethod
- extends AbstractCallMethod
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.
- See Also:
MethodParameter
,
CallPageFlow
,
PageContext
,
Serialized Form
Fields inherited from class BodyTagSupport |
bodyContent |
Fields inherited from class TagSupport |
id, pageContext |
Fields inherited from interface BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Method Summary |
protected Method |
findMethod(Object target,
String methodName,
boolean verifyTypes)
The default findMethod implementation is an uncached search of all
of the methods available on the Class of the target |
protected String |
getObjectName()
Get the name of the object that is the target of the invocation. |
String |
getTagName()
Get the name of this tag. |
protected void |
localRelease()
Reset all of the fields of this tag. |
protected Object |
resolveObject()
Resolve the object on which the method should be invoked. |
void |
setObject(Object object)
Set the object on which to invoke a method. |
Methods inherited from class AbstractClassicTag |
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write |
Methods inherited from class BodyTagSupport |
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
getParent, setPageContext, setParent |
CallMethod
public CallMethod()
getTagName
public String getTagName()
- Get the name of this tag. This is used to identify the type of this tag
for reporting tag errors.
- Specified by:
getTagName
in interface INetuiTag
- Specified by:
getTagName
in class AbstractClassicTag
- Returns:
- a constant String representing the name of this tag.
setObject
public void setObject(Object object)
- Set the object on which to invoke a method.
- Parameters:
object
- the object on which to invoke a method
localRelease
protected void localRelease()
- Reset all of the fields of this tag.
- Overrides:
localRelease
in class AbstractCallMethod
resolveObject
protected Object resolveObject()
throws ObjectNotFoundException,
JspException
- Description copied from class:
AbstractCallMethod
-
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
.
- Specified by:
resolveObject
in class AbstractCallMethod
- Returns:
- the object on which to reflectively invoke the method or
null
if the
object was not found and no exception occurred.
- Throws:
ObjectNotFoundException
- if an exception occurred attempting to resolve an object
JspException
findMethod
protected final Method findMethod(Object target,
String methodName,
boolean verifyTypes)
- Description copied from class:
AbstractCallMethod
- The default findMethod implementation is an uncached search of all
of the methods available on the Class of the
target
- Specified by:
findMethod
in class AbstractCallMethod
- Parameters:
target
- the object from which to find the methodmethodName
- the name of the method to findverifyTypes
- a boolean that if true will match the type names in addition to the String method name
- Returns:
- a Method object matching the methodName and types, if
verifyTypes
is true.
null
otherwise.
getObjectName
protected String getObjectName()
- Description copied from class:
AbstractCallMethod
- 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.
- Specified by:
getObjectName
in class AbstractCallMethod
- Returns:
- a name for the object on which the method will be invoked.