BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.databinding.invoke
Class MethodParameter

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.invoke.MethodParameter
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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:

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
AttributeRequiredRuntime Expression EvaluationData Bindable
nullNoNoNo
A boolean that, if true, will pass null to the method call.
typeNoNoNo
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 SignatureArgument NameType value
addToPrice(int price)priceint
addToPrice(Integer price)pricejava.lang.Integer
valueNoNoYes
The value to pass to the method call.

See Also:
CallControl, CallMethod, CallPageFlow, Serialized Form
Example:
The following sample shows how to pass parameters to the method call foo(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>
    ...

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/binaryFlow/showImage.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/choice/items.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/choice/shipping.jsp
Beadoc.see:
How Do I: Pass Request-time Data to a methodParameter?
Beadoc.tagdescription:
This tag provides an argument to a method-calling tag. The <netui-data:methodParameter> tag can be nested within the following method-calling tags:

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 com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
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

MethodParameter

public MethodParameter()
Method Detail

localRelease

protected void localRelease()
Reset all of the fields of this tag.

Overrides:
localRelease in class AbstractBaseTag

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 class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

setType

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 SignatureArgument NameType value
addToPrice(int price)priceint
addToPrice(Integer price)pricejava.lang.Integer

Parameters:
type - the type name
Beadoc.attributedescription:

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 SignatureArgument NameType value
addToPrice(int price)priceint
addToPrice(Integer price)pricejava.lang.Integer
Beadoc.attributesyntaxvalue:
string_type
Beadoc.databindable:
false

getType

public String getType()
Get the name of the type of this argument in the method signature.

Returns:
the type name

setValue

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
Beadoc.attributedescription:
The value of the method parameter that will be passed to the method call.
Beadoc.attributesyntaxvalue:
expression_value
Beadoc.databindable:
true

getValue

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

setNull

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.
Beadoc.attributedescription:
Boolean. Determines if the parameter passed to the method is null.
Beadoc.attributesyntaxvalue:
boolean_passNullValue
Beadoc.databindable:
false

isNull

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

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.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.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY
Throws:
javax.servlet.jsp.JspException - if an error occurs getting the parameter

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Prepare the value to pass up to the AbstractCallMethod type parent.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE to continue evaluating the page
Throws:
javax.servlet.jsp.JspException

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.