Package org.opencms.jsp
Class CmsJspTagJsonValue
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- org.opencms.jsp.A_CmsJspJsonTag
-
- org.opencms.jsp.CmsJspTagJsonValue
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.jsp.tagext.BodyTag
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
public class CmsJspTagJsonValue extends A_CmsJspJsonTag
Adds a JSON value to the surrounding context and/or stores it as a variable in the page context.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CmsJspTagJsonValue()
Default constructor explicitly resetting all variables.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doEndTag()
java.lang.Object
getJsonValue()
Returns the JSON value that should be added to the surrounding context and/or stored in the variable given by the var attribute.protected void
init()
Initializes / resets the internal values.protected void
setError(java.lang.String errorMessage)
If an error variable has been specified, store the given error message in that variable.void
setErrorVar(java.lang.String errorVar)
Variable to store errors under in the page scope.void
setParse(java.lang.String parse)
Sets the parse attribute.void
setValue(java.lang.Object value)
Sets the value attribute.-
Methods inherited from class org.opencms.jsp.A_CmsJspJsonTag
addToTarget, getScope, release, setKey, setMode, setScope, setTarget, setVar
-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
-
-
-
Constructor Detail
-
CmsJspTagJsonValue
public CmsJspTagJsonValue()
Default constructor explicitly resetting all variables.
-
-
Method Detail
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspException
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classA_CmsJspJsonTag
- Throws:
javax.servlet.jsp.JspException
- See Also:
A_CmsJspJsonTag.doEndTag()
-
getJsonValue
public java.lang.Object getJsonValue()
Description copied from class:A_CmsJspJsonTag
Returns the JSON value that should be added to the surrounding context and/or stored in the variable given by the var attribute.- Specified by:
getJsonValue
in classA_CmsJspJsonTag
- Returns:
- the value to add/store
- See Also:
A_CmsJspJsonTag.getJsonValue()
-
setErrorVar
public void setErrorVar(java.lang.String errorVar)
Variable to store errors under in the page scope.- Parameters:
errorVar
- the error variable
-
setParse
public void setParse(java.lang.String parse)
Sets the parse attribute.If set to 'true', the value will be treated as a string and then parsed into JSON.
- Parameters:
parse
- the value being set
-
setValue
public void setValue(java.lang.Object value)
Sets the value attribute.- Parameters:
value
- the JSON value
-
init
protected void init()
Initializes / resets the internal values.- Overrides:
init
in classA_CmsJspJsonTag
-
setError
protected void setError(java.lang.String errorMessage)
If an error variable has been specified, store the given error message in that variable.- Parameters:
errorMessage
- the error message
-
-