|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.databinding.invoke.MethodParameter
public class MethodParameter
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:
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:
| |||||||||||
value | No | No | Yes | ||||||||
The value to pass to the method call. |
CallControl
,
CallMethod
,
CallPageFlow
,
Serialized Formfoo(int integer, String string)
.
<netui-data:methodParamter value="42"/> <netui-data:methodParamter null="true"/>This will correspond to the method call:
foo(42, null);The following sample shows how to pass parameters to the method call
foo(int integer, String string)
where the class has both of the methods foo(int integer, String string)
and foo(Integer integer, String string)
.
<netui-data:methodParamter type="int" value="42"/> <netui-data:methodParamter type="java.lang.String" null="true"/>This will correspond to the method call:
foo(42, null);
This next example shows a <netui-data:methodParameter> tag being used to specify
a dynamic parameter as an argument to the "isItemOnSale" method.
The parameter passed is dependent on the current data item in the data set.
The <netui-data:methodParameter> tag, in this example, is embedded
within a ChoiceMethod
tag.
... <netui-data:repeaterItem> <netui-data:choiceMethod object="{pageFlow.someDataSet}" method="isItemOnSale"> <netui-data:methodParameter value="{container.item.quantityavailable}"/> </netui-data:choiceMethod> <netui-data:choice value="true"> <tr class="row" bgcolor="#FF9999"> <td><netui:label value="{container.item.itemnumber}"/></td> <td><netui:label value="{container.item.itemname}"/></td> <td><netui:label value="{container.item.quantityavailable}"/></td> <td><netui:label value="{container.item.price}"/> Clearance Item</td> </tr> </netui-data:choice> <netui-data:choice value="false"> <tr class="row"> <td><netui:label value="{container.item.itemnumber}"/></td> <td><netui:label value="{container.item.itemname}"/></td> <td><netui:label value="{container.item.quantityavailable}"/></td> <td><netui:label value="{container.item.price}"/></td> </tr> </netui-data:choice> </netui-data:repeaterItem> ...
Each <netui-data:methodParameter> tag represents a single parameter. A group of <netui-data:methodParameter> 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 <netui-data:methodParameter> tag that is embedded in
a method-calling tag. The type name must exactly match the primitive
type name or the fully qualified class name of the argument. The
<netui-data:methodParameter> tags must also be in the order that they
will be passed to the method. The value of the type
attribute must be
an exact match of the type as 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.
Field Summary |
---|
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
MethodParameter()
|
Method Summary | |
---|---|
int |
doEndTag()
Prepare the value to pass up to the AbstractCallMethod type
parent. |
int |
doStartTag()
Start this tag's lifecycle. |
String |
getTagName()
Get the name of this tag. |
String |
getType()
Get the name of the type of this argument in the method signature. |
String |
getValue()
Gets the String value of the parameter to pass to a method or an expression. |
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. |
void |
setNull(boolean isNull)
Sets a boolean that describes that the parameter that should be passed to the method is null. |
void |
setType(String type)
Set a String matching the type of this parameter on the method to invoke. |
void |
setValue(String value)
Sets the value of the method parameter that will be passed to the method call. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Constructor Detail |
---|
public MethodParameter()
Method Detail |
---|
protected void localRelease()
localRelease
in class AbstractBaseTag
public String getTagName()
getTagName
in class AbstractBaseTag
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 |
type
- the type nameSet 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 |
public String getType()
public void setValue(String value)
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.
value
- a String value which may be an expressionpublic String getValue()
public void setNull(boolean isNull)
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.public boolean isNull()
public int doStartTag() throws javax.servlet.jsp.JspException
AbstractCallMethod
tag and that one of the "null" and "value"
attributes are set.
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if an error occurs getting the parameterpublic int doEndTag() throws javax.servlet.jsp.JspException
AbstractCallMethod
type
parent.
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |