- Author:
- AO Industries, Inc.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addArrayParams
(ParamsAttribute paramsAttribute, String name, Object values) Adds an array of parameters to the givenParamsAttribute
parent tag.static boolean
addDynamicAttribute
(String uri, String localName, Object value, List<String> expectedPatterns, ParamsAttribute paramsAttribute) Adds theparam
static void
addEnumerationParams
(ParamsAttribute paramsAttribute, String name, Enumeration<?> values) Adds a set of parameters to the givenParamsAttribute
parent tag.static void
addIterableParams
(ParamsAttribute paramsAttribute, String name, Iterable<?> values) Adds a set of parameters to the givenParamsAttribute
parent tag.static void
addIteratorParams
(ParamsAttribute paramsAttribute, String name, Iterator<?> values) Adds a set of parameters to the givenParamsAttribute
parent tag.static void
addParam
(ParamsAttribute paramsAttribute, String name, Object value) Adds one parameter to the givenParamsAttribute
parent tag.static void
Adds one parameter to the first parent of the given tag that implementsParamsAttribute
.
-
Field Details
-
PARAM_ATTRIBUTE_PREFIX
The prefix forparam.*
dynamic attributes.- See Also:
-
-
Method Details
-
addParam
public static void addParam(String fromTagName, JspTag from, String name, Object value) throws JspTagException Adds one parameter to the first parent of the given tag that implementsParamsAttribute
. If value is null, the parameter is not added.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
fromTagName
- the name of the tag searching fromfrom
- the tag to search fromname
- the name of the parameter (required)value
- the value of the parameter- Throws:
JspTagException
- See Also:
-
addParam
Adds one parameter to the givenParamsAttribute
parent tag. If value is null, the parameter is not added.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
paramsAttribute
- the parent tag that will receive the parametersname
- the name of the parameter (required)value
- the value of the parameter
-
addIterableParams
public static void addIterableParams(ParamsAttribute paramsAttribute, String name, Iterable<?> values) Adds a set of parameters to the givenParamsAttribute
parent tag. If value is null, no parameters are added. If any element is null, the parameter is not added for the element.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
paramsAttribute
- the parent tag that will receive the parametersname
- the name of the parameter (required)
-
addIteratorParams
public static void addIteratorParams(ParamsAttribute paramsAttribute, String name, Iterator<?> values) Adds a set of parameters to the givenParamsAttribute
parent tag. If value is null, no parameters are added. If any element is null, the parameter is not added for the element.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
paramsAttribute
- the parent tag that will receive the parametersname
- the name of the parameter (required)
-
addEnumerationParams
public static void addEnumerationParams(ParamsAttribute paramsAttribute, String name, Enumeration<?> values) throws JspTagException Adds a set of parameters to the givenParamsAttribute
parent tag. If value is null, no parameters are added. If any element is null, the parameter is not added for the element.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
paramsAttribute
- the parent tag that will receive the parametersname
- the name of the parameter (required)- Throws:
JspTagException
-
addArrayParams
public static void addArrayParams(ParamsAttribute paramsAttribute, String name, Object values) throws JspTagException Adds an array of parameters to the givenParamsAttribute
parent tag. If value is null, no parameters are added. If any element is null, the parameter is not added for the element.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Parameters:
paramsAttribute
- the parent tag that will receive the parametersname
- the name of the parameter (required)- Throws:
JspTagException
-
addDynamicAttribute
public static boolean addDynamicAttribute(String uri, String localName, Object value, List<String> expectedPatterns, ParamsAttribute paramsAttribute) throws JspTagException Adds theparam.*
dynamic attributes. Handles Iterable, Iterator, Enumeration, arrays, and direct coercion.The conversion to string may be deferred, or the value may be streamed instead of being converted to a string. It is incorrect to change the state of the provided value; doing so may or may not affect the value of the resulting parameter.
When the value is an
Enum
, the parameter value is obtained fromEnum.name()
instead ofEnum.toString()
. This is to intuitively use enums as parameters whenEnum.toString()
is overridden.- Returns:
true
when added, orfalse
when attribute not expected and has not been added.- Throws:
JspTagException
- See Also:
-