MethodParameter Class
- public class MethodParameter
extends AbstractBaseTag
A tag that is used to add an argument to a method that will be called
on some object. This tag can be nested within tags that extend the AbstractCallMethod
class. Those tags are:
- <netui-data:callControl>
- <netui-data:callMethod>
- <netui-data:callPageFlow>
- <netui-data:choiceMethod>
The methodParameter
tags are used to parameterize the method
that the AbstractCallMethod
class will call; each methodParameter
tag represents a single parameter. These tags are evaluated in order and the parameters
they describe are passed in order.
Overloaded methods on an object can be invoked by setting the type
attribute on each methodParameter
tag that is embedded in
a method invocation tag. The type name must exactly match the primitive
type name or the fully qualified class name of the argument. The
methodParameter
tags must also be in the order that they
will be passed to this method. The value of the type attribute must be
an exact match of the type if it were printed after having been
accessed through Java reflection.
In order to pass null
as an argument to a method, the
null attribute must be set on this tag. Either the null attribute or the
value attribute must be set on this tag.
Attribute Descriptions |
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
null | No | No | No |
A boolean that, if true , will pass null to the method call. |
type | No | No | No |
The String of the type of this argument in the method signature.
This name should match the primitive type name or fully qualified class
name of the parameters on the signature of the method to which this
parameter will be passed. For example:
Method Signature | Argument Name | Type value |
addToPrice(int price) | price | int |
addToPrice(Integer price) | price | java.lang.Integer |
|
value | No | No | Yes |
The value to pass to the method call. |
Related Topics
CallControl
CallMethod
CallPageFlow
How Do I: Pass Request-time Data to a methodParameter?
-
Hierarchy
-
Object
TagSupport
BodyTagSupport
AbstractBaseTag
MethodParameter
-
All Implemented Interfaces
-
BodyTag
, IterationTag
, Serializable
, Tag
Fields from com.bea.wlw.netui.tags.AbstractBaseTag |
ATTR_GENERAL , ATTR_GENERAL_EXPRESSION , ATTR_JAVASCRIPT , ATTR_STYLE , CLASS , ID , JAVASCRIPT_STATUS , NAME , NETUI_UNIQUE_CNT , ONCLICK , ONDBLCLICK , ONKEYDOWN , ONKEYPRESS , ONKEYUP , ONMOUSEDOWN , ONMOUSEMOVE , ONMOUSEOUT , ONMOUSEOVER , ONMOUSEUP , STYLE , TABINDEX
|
public int |
-
doEndTag ()
- Prepare the value to pass up to the
AbstractCallMethod type
parent.
|
public int |
-
doStartTag ()
- Start this tag's lifecycle.
|
public String |
-
getTagName ()
- Get the name of this tag.
|
public String |
-
getType ()
- Get the name of the type of this argument in the method signature.
|
public String |
-
getValue ()
- Gets the String value of the parameter to pass to a method or an expression.
|
public boolean |
-
isNull ()
- Gets a boolean that describes whether or not a null should be passed
to the method that is to be called.
|
protected void |
-
localRelease ()
- Reset all of the fields of this tag.
|
public void |
-
setNull (boolean isNull)
- Sets a boolean that describes that the parameter that should be passed
to the method is null.
|
public void |
-
setType (String type)
Set a String matching the type of this parameter on the method to invoke.
|
public void |
-
setValue (String value)
- Sets the value of the method parameter that will be passed
to the method call.
|
Methods from com.bea.wlw.netui.tags.AbstractBaseTag |
addTagIdMapping , evaluateAttributeToString , filter , filter , getJavaScriptUtils , getNearestForm , getScriptReporter , getUserLocale , registerTagError , release , renderAttribute , rewriteName , write
|
Methods from javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodParameter
public MethodParameter()
doEndTag() Method
public int doEndTag()
throws JspException
Prepare the value to pass up to the AbstractCallMethod
type
parent.
-
Overrides
-
BodyTagSupport.doEndTag()
Returns
- EVAL_PAGE to continue evaluating the page
Exceptions
-
JspException
doStartTag() Method
public int doStartTag()
throws JspException
Start this tag's lifecycle. Verify that this tag is nested within
a AbstractCallMethod
tag and that one of the "null" and "value"
attributes are set.
-
Overrides
-
BodyTagSupport.doStartTag()
Returns
- SKIP_BODY
Exceptions
-
JspException
- if an error occurs getting the parameter
getTagName() Method
public String
getTagName()
Get the name of this tag. This is used to identify the type of this tag
for reporting tag errors.
-
Overrides
-
AbstractBaseTag.getTagName()
Returns
- a constant String representing the name of this tag.
getType() Method
public String
getType()
Get the name of the type of this argument in the method signature.
Returns
- the type name
getValue() Method
public String
getValue()
Gets the String value of the parameter to pass to a method or an expression.
Returns
- a String value or an expression
isNull() Method
public boolean isNull()
Gets a boolean that describes whether or not a null should be passed
to the method that is to be called.
Returns
- true if null will be passed; false otherwise
localRelease() Method
protected void localRelease()
Reset all of the fields of this tag.
-
Overrides
-
AbstractBaseTag.localRelease()
setNull(boolean) Method
public void setNull(boolean isNull)
Sets a boolean that describes that the parameter that should be passed
to the method is null.
Parameters
-
isNull
- a value that describes whether or not this tag should pass null; if
true
null will be passed; otherwise the value from the value attribute
will be passed.
setType(String) Method
public void setType(String
type)
Set a String matching the type of this parameter on the method to invoke.
This name should match the primitive type name or fully qualified class
name of the parameters on the signature of the method to which this
parameter will be passed.
For example:
Method Signature | Argument Name | Type value |
addToPrice(int price) | price | int |
addToPrice(Integer price) | price | java.lang.Integer |
Parameters
-
type
- the type name
setValue(String) Method
public void setValue(String
value)
Sets the value of the method parameter that will be passed
to the method call. This String can be an expression.
If the value is not an expression that references
an Object, the AbstractCallMethod.doEndTag()
will attempt to convert
the String to type that matches the position of the MethodParameter
tag in the list of MethodParameter tags nested inside of an AbstractCallMethod
tag.
Parameters
-
value
- a String value which may be an expression