|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jelly.TagSupport
public abstract class TagSupport
TagSupport
an abstract base class which is useful to
inherit from if developing your own tag.
Field Summary | |
---|---|
protected Script |
body
the body of the tag |
protected JellyContext |
context
|
private boolean |
escapeText
whether xml text should be escaped |
protected boolean |
hasTrimmed
|
protected Tag |
parent
the parent of this tag |
protected java.lang.Boolean |
shouldTrim
The current context |
Constructor Summary | |
---|---|
TagSupport()
|
|
TagSupport(boolean shouldTrim)
|
Method Summary | |
---|---|
protected Tag |
findAncestorWithClass(java.lang.Class parentClass)
Searches up the parent hierarchy for a Tag of the given type. |
protected Tag |
findAncestorWithClass(java.lang.Class[] parentClasses)
Searches up the parent hierarchy for a Tag of one of the given types. |
protected Tag |
findAncestorWithClass(java.util.Collection parentClasses)
Searches up the parent hierarchy for a Tag of one of the given types. |
static Tag |
findAncestorWithClass(Tag from,
java.lang.Class tagClass)
Searches up the parent hierarchy from the given tag for a Tag of the given type |
static Tag |
findAncestorWithClass(Tag from,
java.lang.Class[] tagClasses)
Searches up the parent hierarchy from the given tag for a Tag matching one or more of given types. |
static Tag |
findAncestorWithClass(Tag from,
java.util.Collection tagClasses)
Searches up the parent hierarchy from the given tag for a Tag matching one or more of given types. |
Script |
getBody()
|
protected java.lang.String |
getBodyText()
Executes the body of the tag and returns the result as a String. |
protected java.lang.String |
getBodyText(boolean shouldEscape)
Executes the body of the tag and returns the result as a String. |
JellyContext |
getContext()
Gets the context in which the tag will be run |
Tag |
getParent()
|
void |
invokeBody(XMLOutput output)
Invokes the body of this tag using the given output |
boolean |
isEscapeText()
Returns whether the body of this tag will be escaped or not. |
boolean |
isTrim()
|
void |
setBody(Script body)
Sets the body of the tag |
void |
setContext(JellyContext context)
Sets the context in which the tag will be run |
void |
setEscapeText(boolean escapeText)
Sets whether the body of the tag should be escaped as text (so that < and > are escaped as < and >), which is the default or leave the text as XML. |
void |
setParent(Tag parent)
Sets the parent of this tag |
void |
setTrim(boolean shouldTrim)
Sets whether whitespace inside this tag should be trimmed or not. |
protected void |
trimBody()
Find all text nodes inside the top level of this body and if they are just whitespace then remove them |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.jelly.Tag |
---|
doTag |
Field Detail |
---|
protected Tag parent
protected Script body
protected java.lang.Boolean shouldTrim
protected boolean hasTrimmed
protected JellyContext context
private boolean escapeText
Constructor Detail |
---|
public TagSupport()
public TagSupport(boolean shouldTrim)
Method Detail |
---|
public static Tag findAncestorWithClass(Tag from, java.lang.Class tagClass)
from
- the tag to start searching fromtagClass
- the type of the tag to find
public static Tag findAncestorWithClass(Tag from, java.util.Collection tagClasses)
from
- the tag to start searching fromtagClasses
- a Collection of Class types that might match
public static Tag findAncestorWithClass(Tag from, java.lang.Class[] tagClasses)
from
- the tag to start searching fromtagClasses
- an array of types that might match
findAncestorWithClass(Tag,Collection)
public void setTrim(boolean shouldTrim)
public boolean isTrim()
public Tag getParent()
getParent
in interface Tag
public void setParent(Tag parent)
setParent
in interface Tag
public Script getBody()
getBody
in interface Tag
public void setBody(Script body)
setBody
in interface Tag
public JellyContext getContext()
Tag
getContext
in interface Tag
public void setContext(JellyContext context) throws JellyTagException
setContext
in interface Tag
JellyTagException
public void invokeBody(XMLOutput output) throws JellyTagException
invokeBody
in interface Tag
JellyTagException
protected Tag findAncestorWithClass(java.lang.Class parentClass)
protected Tag findAncestorWithClass(java.lang.Class[] parentClasses)
findAncestorWithClass(Collection)
protected Tag findAncestorWithClass(java.util.Collection parentClasses)
protected java.lang.String getBodyText() throws JellyTagException
JellyTagException
protected java.lang.String getBodyText(boolean shouldEscape) throws JellyTagException
shouldEscape
- Signal if the text should be escaped.
JellyTagException
protected void trimBody()
public boolean isEscapeText()
public void setEscapeText(boolean escapeText)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |