|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.SimpleTagSupport atg.taglib.json.JsonBaseTag
public abstract class JsonBaseTag
Abstract base class for all JSON tags
Field Summary | |
---|---|
protected java.lang.Boolean |
mEscapeXmlOriginalValue
|
protected boolean |
mEscapeXmlValueSet
|
protected java.lang.String |
mName
|
protected boolean |
mNewStackCreated
|
protected boolean |
mTrim
|
protected static int |
PRETTY_PRINT_INDENT
|
Constructor Summary | |
---|---|
JsonBaseTag()
|
Method Summary | |
---|---|
protected java.util.Stack |
createEntityStack()
Create a new entity stack and set it in pageContext |
protected boolean |
entityStackExists()
Does an entity stack exist? |
protected JsonEntity |
getCurrentEntity()
Get the topmost JSONObject or JSONArray from the stack |
protected java.lang.Object |
getDefaultValue(java.lang.String pParamKey,
java.lang.Object pDefaultConstant)
Get the default value for a parameter. |
protected java.util.Stack |
getEntityStack()
Get the JSON object stack. |
boolean |
getEscapeXml()
Gets the value of the EscapeXml flag. |
java.lang.Boolean |
getEscapeXmlDefault()
Get the default value of the escapeXml property |
java.lang.String |
getName()
Gets the Name |
int |
getPrettyPrintIndentFactor()
Get the number of spaces that should be used to indent the pretty-printed output, or 0 if no pretty-printing should be used |
boolean |
getTrim()
Gets the Trim |
protected boolean |
isRootTag()
Is this tag the root json: tag? |
protected void |
processTagEnd(JsonEntity pNewEntity)
Process the end of a tag. |
protected void |
removeEntityStack()
Remove the entity stack object from page context |
protected void |
resetEscapeXmlValue()
Replace the escapeXml value with the original value if this tag modified it |
void |
setEscapeXml(boolean pEscapeXml)
Sets the EscapeXml flag. |
void |
setName(java.lang.String pName)
Sets the Name |
void |
setPrettyPrint(boolean pPrettyPrint)
Sets the PrettyPrint flag. |
void |
setTrim(boolean pTrim)
Sets the Trim |
protected java.lang.Object |
trimAndEscapeValue(java.lang.Object pValue)
Trim and EscapeXml chars in the value depending on whether the trim and
escapeXml attributes have been set |
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport |
---|
doTag, findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int PRETTY_PRINT_INDENT
protected java.lang.String mName
protected boolean mTrim
protected boolean mNewStackCreated
protected java.lang.Boolean mEscapeXmlOriginalValue
protected boolean mEscapeXmlValueSet
Constructor Detail |
---|
public JsonBaseTag()
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String pName)
pName
- The Name to setpublic boolean getTrim()
public void setTrim(boolean pTrim)
pTrim
- The Trim to setpublic void setPrettyPrint(boolean pPrettyPrint)
pPrettyPrint
- The PrettyPrint to setpublic int getPrettyPrintIndentFactor()
public boolean getEscapeXml()
escapeXml
attribute to true
, or it can be set by setting
a page attribute atg.taglib.json.escapeXml
. When set on a tag it will
recursively apply to all sub-tags, but may be overriden by any sub-tag.
true
public void setEscapeXml(boolean pEscapeXml)
pEscapeXml
- The EscapeXml to setpublic java.lang.Boolean getEscapeXmlDefault()
protected void resetEscapeXmlValue()
protected java.util.Stack getEntityStack() throws javax.servlet.jsp.JspException
If an entity stack does not exists, then this method will create a new one
javax.servlet.jsp.JspException
- If there is a problem creating a new entity stackprotected java.util.Stack createEntityStack() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
protected void removeEntityStack()
protected JsonEntity getCurrentEntity() throws javax.servlet.jsp.JspException
JsonEntity
on the stack
javax.servlet.jsp.JspException
- if unable to get the object stackprotected boolean entityStackExists()
true
if an entity stack is found in pageContext, false
otherwiseprotected boolean isRootTag()
json:
tag?
true
if this tag instance is the root tag, false
otherwiseprotected java.lang.Object getDefaultValue(java.lang.String pParamKey, java.lang.Object pDefaultConstant)
pParamKey
- The key of the param.
protected java.lang.Object trimAndEscapeValue(java.lang.Object pValue)
trim
and
escapeXml
attributes have been set
pValue
- The value to trim and xml-escape
protected void processTagEnd(JsonEntity pNewEntity) throws javax.servlet.jsp.JspException, JSONException
pNewEntity
- The entity that has just been created by this tag
javax.servlet.jsp.JspException
JSONException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |