Class KeyTag

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

public class KeyTag extends jakarta.servlet.jsp.tagext.TagSupport implements ValueTypeTag
A custom JSP tag that defines a key-value pair for JSON objects. This tag is designed to be used within parent tags that implement the KeyValueTypeTag interface, such as ObjectTag or ServiceTag. It assigns a named value to a key in the parent's data structure.
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
     
    Gets the default value for this key.
    Gets the name of the key in the key-value pair.
    jakarta.servlet.jsp.tagext.Tag
     
    Gets the value associated with this key.
    void
     
    void
    setDefault(Object defaultValue)
    Sets the default value if none is provided later on.
    void
    Sets the name of the key in the key-value pair.
    void
    setParent(jakarta.servlet.jsp.tagext.Tag parent)
     
    void
    Sets the value associated with this key.

    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

    • KeyTag

      public KeyTag()
  • Method Details

    • getName

      public String getName()
      Gets the name of the key in the key-value pair.
      Returns:
      The name.
    • setName

      public void setName(String name)
      Sets the name of the key in the key-value pair.
      Parameters:
      name - The name.
    • getValue

      public Object getValue()
      Gets the value associated with this key.
      Specified by:
      getValue in interface ValueTypeTag
      Returns:
      The value for this key
    • setValue

      public void setValue(Object value)
      Sets the value associated with this key.
      Specified by:
      setValue in interface ValueTypeTag
      Parameters:
      value - The value for this key
    • getDefault

      public Object getDefault()
      Gets the default value for this key.
      Returns:
      The default.
    • setDefault

      public void setDefault(Object defaultValue)
      Sets the default value if none is provided later on.
      Parameters:
      defaultValue - The default.
    • 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