Class ArrayTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
com.invirgance.convirgance.web.tag.ArrayTag
- All Implemented Interfaces:
ValueTypeTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,Serializable
A JSP tag that creates and manages a JSON array.
This tag creates a
JSONArray object that can be populated with values
by nested tags such as ValueTag.
The resulting array can be: - Stored in a page-scoped variable using thevarattribute - Passed to a parent tag that implementsValueTypeTag
- Author:
- jbanes
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()intjakarta.servlet.jsp.tagext.TaggetScope()Gets the scope for where this will be stored.getValue()Returns JSON array managed by this tag.getVar()The name of the variable where this will be stored.voidrelease()voidsetParent(jakarta.servlet.jsp.tagext.Tag parent) voidSets the scope for where this will be stored.voidAdds a value to the array.voidSets the variable for where the JSONArray will be stored.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getValue, getValues, removeValue, setId, setPageContext, setValue
-
Constructor Details
-
ArrayTag
public ArrayTag()
-
-
Method Details
-
getVar
The name of the variable where this will be stored.- Returns:
- The variable.
-
setVar
Sets the variable for where the JSONArray will be stored.- Parameters:
variable- The variable name
-
getScope
Gets the scope for where this will be stored.- Returns:
- The scope
-
setScope
Sets the scope for where this will be stored. This changes its access level.Valid options are: - page - request - session - application
- Parameters:
scope- The scope location.
-
getValue
Returns JSON array managed by this tag.- Specified by:
getValuein interfaceValueTypeTag- Returns:
- The array.
-
setValue
Adds a value to the array. Called by child tags to contribute values.- Specified by:
setValuein interfaceValueTypeTag- Parameters:
value- The value to add.
-
getParent
public jakarta.servlet.jsp.tagext.Tag getParent()- Specified by:
getParentin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
getParentin classjakarta.servlet.jsp.tagext.TagSupport
-
setParent
public void setParent(jakarta.servlet.jsp.tagext.Tag parent) - Specified by:
setParentin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
setParentin classjakarta.servlet.jsp.tagext.TagSupport
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspException- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspException- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException
-
release
public void release()- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classjakarta.servlet.jsp.tagext.TagSupport
-