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
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, 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()intGets the default value for this key.getName()Gets the name of the key in the key-value pair.jakarta.servlet.jsp.tagext.TaggetValue()Gets the value associated with this key.voidrelease()voidsetDefault(Object defaultValue) Sets the default value if none is provided later on.voidSets the name of the key in the key-value pair.voidsetParent(jakarta.servlet.jsp.tagext.Tag parent) voidSets the value associated with this key.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getValue, getValues, removeValue, setId, setPageContext, setValue
-
Constructor Details
-
KeyTag
public KeyTag()
-
-
Method Details
-
getName
Gets the name of the key in the key-value pair.- Returns:
- The name.
-
setName
Sets the name of the key in the key-value pair.- Parameters:
name- The name.
-
getValue
Gets the value associated with this key.- Specified by:
getValuein interfaceValueTypeTag- Returns:
- The value for this key
-
setValue
Sets the value associated with this key.- Specified by:
setValuein interfaceValueTypeTag- Parameters:
value- The value for this key
-
getDefault
Gets the default value for this key.- Returns:
- The default.
-
setDefault
Sets the default value if none is provided later on.- Parameters:
defaultValue- The default.
-
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
-