|
|||||||||
| Home >> All >> org >> apache >> commons >> [ jelly overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.commons.jelly
Class TagSupport

java.lang.Objectorg.apache.commons.jelly.TagSupport
- All Implemented Interfaces:
- Tag
- Direct Known Subclasses:
- DynaTagSupport
- public abstract class TagSupport
- extends java.lang.Object
- implements Tag
- extends java.lang.Object
TagSupport an abstract base class which is useful to
inherit from if developing your own tag.
- Version:
- $Revision: 155420 $
| 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 |
parent
protected Tag parent
- the parent of this tag
body
protected Script body
- the body of the tag
shouldTrim
protected java.lang.Boolean shouldTrim
- The current context
hasTrimmed
protected boolean hasTrimmed
context
protected JellyContext context
escapeText
private boolean escapeText
- whether xml text should be escaped
| Constructor Detail |
TagSupport
public TagSupport()
TagSupport
public TagSupport(boolean shouldTrim)
| Method Detail |
findAncestorWithClass
public 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
findAncestorWithClass
public 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.
findAncestorWithClass
public 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.
setTrim
public void setTrim(boolean shouldTrim)
- Sets whether whitespace inside this tag should be trimmed or not.
Defaults to true so whitespace is trimmed
isTrim
public boolean isTrim()
getParent
public Tag getParent()
setParent
public void setParent(Tag parent)
getBody
public Script getBody()
setBody
public void setBody(Script body)
getContext
public JellyContext getContext()
- Description copied from interface:
Tag - Gets the context in which the tag will be run
- Specified by:
getContextin interfaceTag
setContext
public void setContext(JellyContext context) throws JellyTagException
- Sets the context in which the tag will be run
- Specified by:
setContextin interfaceTag
invokeBody
public void invokeBody(XMLOutput output) throws JellyTagException
- Invokes the body of this tag using the given output
- Specified by:
invokeBodyin interfaceTag
findAncestorWithClass
protected Tag findAncestorWithClass(java.lang.Class parentClass)
- Searches up the parent hierarchy for a Tag of the given type.
findAncestorWithClass
protected Tag findAncestorWithClass(java.lang.Class[] parentClasses)
- Searches up the parent hierarchy for a Tag of one of the given types.
findAncestorWithClass
protected Tag findAncestorWithClass(java.util.Collection parentClasses)
- Searches up the parent hierarchy for a Tag of one of the given types.
getBodyText
protected java.lang.String getBodyText() throws JellyTagException
- Executes the body of the tag and returns the result as a String.
getBodyText
protected java.lang.String getBodyText(boolean shouldEscape) throws JellyTagException
- Executes the body of the tag and returns the result as a String.
trimBody
protected void trimBody()
- Find all text nodes inside the top level of this body and
if they are just whitespace then remove them
isEscapeText
public boolean isEscapeText()
- Returns whether the body of this tag will be escaped or not.
setEscapeText
public 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.
|
|||||||||
| Home >> All >> org >> apache >> commons >> [ jelly overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.commons.jelly.TagSupport