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

public class ArrayTag extends jakarta.servlet.jsp.tagext.TagSupport implements ValueTypeTag
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 the var attribute
 - Passed to a parent tag that implements ValueTypeTag
 
Author:
jbanes
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    int
     
    jakarta.servlet.jsp.tagext.Tag
     
    Gets the scope for where this will be stored.
    Returns JSON array managed by this tag.
    The name of the variable where this will be stored.
    void
     
    void
    setParent(jakarta.servlet.jsp.tagext.Tag parent)
     
    void
    Sets the scope for where this will be stored.
    void
    Adds a value to the array.
    void
    setVar(String variable)
    Sets 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArrayTag

      public ArrayTag()
  • Method Details

    • getVar

      public String getVar()
      The name of the variable where this will be stored.
      Returns:
      The variable.
    • setVar

      public void setVar(String variable)
      Sets the variable for where the JSONArray will be stored.
      Parameters:
      variable - The variable name
    • getScope

      public String getScope()
      Gets the scope for where this will be stored.
      Returns:
      The scope
    • setScope

      public void setScope(String scope)
      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

      public Object getValue()
      Returns JSON array managed by this tag.
      Specified by:
      getValue in interface ValueTypeTag
      Returns:
      The array.
    • setValue

      public void setValue(Object value)
      Adds a value to the array. Called by child tags to contribute values.
      Specified by:
      setValue in interface ValueTypeTag
      Parameters:
      value - The value to add.
    • getParent

      public jakarta.servlet.jsp.tagext.Tag getParent()
      Specified by:
      getParent in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      getParent in class jakarta.servlet.jsp.tagext.TagSupport
    • setParent

      public void setParent(jakarta.servlet.jsp.tagext.Tag parent)
      Specified by:
      setParent in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      setParent in class jakarta.servlet.jsp.tagext.TagSupport
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException
    • doEndTag

      public int doEndTag() throws jakarta.servlet.jsp.JspException
      Specified by:
      doEndTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException
    • release

      public void release()
      Specified by:
      release in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      release in class jakarta.servlet.jsp.tagext.TagSupport