Class ValueTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
com.invirgance.convirgance.web.tag.ValueTag
All Implemented Interfaces:
ValueTypeTag, jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable

public class ValueTag extends jakarta.servlet.jsp.tagext.TagSupport implements ValueTypeTag
A custom JSP tag that sets a value on a parent tag implementing ValueTypeTag. This tag is designed to be used within parent tags that implement the ValueTypeTag interface, such as ArrayTag. It passes a value to the parent tag, which can be provided either through its body content, the value attribute, or from nested tags.
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
    Passes the value (or default value if null) to the parent ValueTypeTag.
    int
    Evaluates the tag body to potentially set the value.
    Gets the default value to use when no value is provided.
    jakarta.servlet.jsp.tagext.Tag
     
    Gets the value to be passed to the parent tag.
    void
     
    void
    setDefault(Object defaultValue)
    Sets the default value to use when no value is provided.
    void
    setParent(jakarta.servlet.jsp.tagext.Tag parent)
     
    void
    Sets the value to be passed to the parent tag.

    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

    • ValueTag

      public ValueTag()
  • Method Details

    • getValue

      public Object getValue()
      Gets the value to be passed to the parent tag.
      Specified by:
      getValue in interface ValueTypeTag
      Returns:
      The stored value
    • setValue

      public void setValue(Object value)
      Sets the value to be passed to the parent tag.
      Specified by:
      setValue in interface ValueTypeTag
      Parameters:
      value - The value to store
    • getDefault

      public Object getDefault()
      Gets the default value to use when no value is provided.
      Returns:
      The default value
    • setDefault

      public void setDefault(Object defaultValue)
      Sets the default value to use when no value is provided.
      Parameters:
      defaultValue - The default value
    • 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
      Evaluates the tag body to potentially set the value.
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Returns:
      EVAL_BODY_INCLUDE to process the tag body
      Throws:
      jakarta.servlet.jsp.JspException - If evaluation fails
    • doEndTag

      public int doEndTag() throws jakarta.servlet.jsp.JspException
      Passes the value (or default value if null) to the parent ValueTypeTag.
      Specified by:
      doEndTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class jakarta.servlet.jsp.tagext.TagSupport
      Returns:
      EVAL_PAGE to continue processing the page
      Throws:
      jakarta.servlet.jsp.JspException - If passing the value fails
    • release

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