Package com.composum.sling.cpnl
Class TextTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- com.composum.sling.cpnl.CpnlBodyTagSupport
-
- com.composum.sling.cpnl.TagBase
-
- com.composum.sling.cpnl.TextTag
-
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.DynamicAttributes,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class TextTag extends TagBase
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTextTag.EscapeFunctionstatic classTextTag.Type
-
Field Summary
Fields Modifier and Type Field Description static Map<TextTag.Type,TextTag.EscapeFunction>ESCAPE_FUNCTION_MAPprotected TextTag.Typetype-
Fields inherited from class com.composum.sling.cpnl.TagBase
classes, dynamicAttributes, TAG_NONE, tagName, test
-
Fields inherited from class com.composum.sling.cpnl.CpnlBodyTagSupport
context, out, request, resource, resourceResolver
-
-
Constructor Summary
Constructors Constructor Description TextTag()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclear()Reset all member variables to the (default) start values.intdoAfterBody()intdoStartTag()protected Objectescape(Object value)the extension hook for the various types of encoding; must work with Object values to ensure that non String values can be used as isprotected StringgetDefaultTagName()FormatgetFormatter(Object value)LocalegetLocale()protected voidrenderTagEnd()is rendering the text and a tag around if 'tagName' is set or CSS classes are specifiedprotected voidrenderTagStart()voidsetEscape(boolean escape)voidsetFormat(String format)voidsetI18n(boolean i18n)voidsetLocale(Locale locale)voidsetProperty(String propertyName)voidsetTagClass(String tagClass)voidsetType(String type)voidsetValue(Object value)static StringtoString(Object value)-
Methods inherited from class com.composum.sling.cpnl.TagBase
acceptDynamicAttribute, doEndTag, getClasses, getTagName, getTestResult, renderTag, setClasses, setDynamicAttribute, setTagName, setTest, writeAttributes
-
Methods inherited from class com.composum.sling.cpnl.CpnlBodyTagSupport
createContext, eval, getExpressionUtil, release, setPageContext
-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
-
-
-
Field Detail
-
ESCAPE_FUNCTION_MAP
public static final Map<TextTag.Type,TextTag.EscapeFunction> ESCAPE_FUNCTION_MAP
-
type
protected TextTag.Type type
-
-
Method Detail
-
clear
protected void clear()
Description copied from class:CpnlBodyTagSupportReset all member variables to the (default) start values. Called prior processing the tag and at release time.
-
getDefaultTagName
protected String getDefaultTagName()
- Specified by:
getDefaultTagNamein classTagBase
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classTagBase- Throws:
javax.servlet.jsp.JspException
-
doAfterBody
public int doAfterBody()
- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport
-
renderTagStart
protected void renderTagStart()
- Overrides:
renderTagStartin classTagBase
-
renderTagEnd
protected void renderTagEnd()
is rendering the text and a tag around if 'tagName' is set or CSS classes are specified- Overrides:
renderTagEndin classTagBase
-
escape
protected Object escape(Object value)
the extension hook for the various types of encoding; must work with Object values to ensure that non String values can be used as is- Parameters:
value- the value (String) to encode- Returns:
- the encoded String or an appropriate Object
-
setType
public void setType(String type)
- Parameters:
type- the type of the value and the escape strategy key
-
setValue
public void setValue(Object value)
- Parameters:
value- the value to set
-
setProperty
public void setProperty(String propertyName)
- Parameters:
propertyName- the propertyName to set
-
setEscape
public void setEscape(boolean escape)
- Parameters:
escape- flag for escaping the text (default: 'true')
-
setI18n
public void setI18n(boolean i18n)
- Parameters:
i18n- flag for translating the text (default: 'false')
-
setFormat
public void setFormat(String format)
- Parameters:
format- the fmt to set
-
setLocale
public void setLocale(Locale locale)
-
getLocale
public Locale getLocale()
-
setTagClass
public void setTagClass(String tagClass)
- Parameters:
tagClass- the tagClass to set
-
-