org.apache.commons.jelly.tags.ant
Class AntTag
java.lang.Object
|
+--org.apache.commons.jelly.TagSupport
|
+--org.apache.commons.jelly.DynaTagSupport
|
+--org.apache.commons.jelly.MapTagSupport
|
+--org.apache.commons.jelly.tags.ant.AntTag
- All Implemented Interfaces:
- org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag, TaskSource
- public class AntTag
- extends org.apache.commons.jelly.MapTagSupport
- implements TaskSource
Tag supporting ant's Tasks as well as
dynamic runtime behaviour for 'unknown' tags.
- Author:
- bob mcwhirter, James Strachan
Field Summary |
protected java.lang.Object |
object
The general object underlying this tag. |
protected java.lang.String |
tagName
The name of this tag. |
protected org.apache.tools.ant.Task |
task
Task, if this tag represents a task. |
Fields inherited from class org.apache.commons.jelly.TagSupport |
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary |
AntTag(java.lang.String tagName)
Construct with a project and tag name. |
Method Summary |
java.lang.Object |
createDataType(java.lang.String name)
|
java.lang.Object |
createNestedObject(java.lang.Object object,
java.lang.String name)
Creates a nested object of the given object with the specified name |
org.apache.tools.ant.Task |
createTask(java.lang.String taskName)
|
org.apache.tools.ant.Task |
createTask(java.lang.String taskName,
java.lang.Class taskType)
|
void |
doTag(org.apache.commons.jelly.XMLOutput output)
|
protected java.lang.Object |
findBeanAncestor()
Attempts to look up in the parent hierarchy for a tag that implements the
TaskSource interface, which returns an Ant Task object or that implements
BeanSource interface which creates a bean,
or will return the parent tag, which is also a bean. |
protected java.lang.Object |
findParentTaskObject()
Walks the hierarchy until it finds a parent TaskSource and returns its source or returns null |
org.apache.tools.ant.Project |
getAntProject()
|
java.lang.String |
getTagName()
|
java.lang.Object |
getTaskObject()
Retrieve the general object underlying this tag. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setBeanProperties()
Sets the properties on the Ant task |
void |
setBeanProperty(java.lang.Object object,
java.lang.String name,
java.lang.Object value)
|
void |
setObject(java.lang.Object object)
Set the object underlying this tag. |
void |
setTaskProperty(java.lang.String name,
java.lang.Object value)
Allows nested tags to set a property on the task object of this tag |
java.lang.String |
toString()
|
Methods inherited from class org.apache.commons.jelly.MapTagSupport |
createAttributes, getAttributes |
Methods inherited from class org.apache.commons.jelly.DynaTagSupport |
getAttributeType |
Methods inherited from class org.apache.commons.jelly.TagSupport |
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.commons.jelly.Tag |
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent |
tagName
protected java.lang.String tagName
- The name of this tag.
object
protected java.lang.Object object
- The general object underlying this tag.
task
protected org.apache.tools.ant.Task task
- Task, if this tag represents a task.
AntTag
public AntTag(java.lang.String tagName)
- Construct with a project and tag name.
- Parameters:
tagName
- The name on the tag.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getTaskObject
public java.lang.Object getTaskObject()
- Retrieve the general object underlying this tag.
- Specified by:
getTaskObject
in interface TaskSource
- Returns:
- The object underlying this tag.
setTaskProperty
public void setTaskProperty(java.lang.String name,
java.lang.Object value)
throws org.apache.commons.jelly.JellyTagException
- Allows nested tags to set a property on the task object of this tag
- Specified by:
setTaskProperty
in interface TaskSource
doTag
public void doTag(org.apache.commons.jelly.XMLOutput output)
throws org.apache.commons.jelly.JellyTagException
- Overrides:
doTag
in class org.apache.commons.jelly.TagSupport
getTagName
public java.lang.String getTagName()
setObject
public void setObject(java.lang.Object object)
- Set the object underlying this tag.
- Parameters:
object
- The object.
getAntProject
public org.apache.tools.ant.Project getAntProject()
setBeanProperties
public void setBeanProperties()
throws org.apache.commons.jelly.JellyTagException
- Sets the properties on the Ant task
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value)
- Overrides:
setAttribute
in class org.apache.commons.jelly.MapTagSupport
setBeanProperty
public void setBeanProperty(java.lang.Object object,
java.lang.String name,
java.lang.Object value)
throws org.apache.commons.jelly.JellyTagException
createNestedObject
public java.lang.Object createNestedObject(java.lang.Object object,
java.lang.String name)
- Creates a nested object of the given object with the specified name
createDataType
public java.lang.Object createDataType(java.lang.String name)
createTask
public org.apache.tools.ant.Task createTask(java.lang.String taskName)
throws org.apache.commons.jelly.JellyTagException
- Parameters:
taskName
- - Returns:
-
- Throws:
org.apache.commons.jelly.JellyTagException
-
createTask
public org.apache.tools.ant.Task createTask(java.lang.String taskName,
java.lang.Class taskType)
throws org.apache.commons.jelly.JellyTagException
findBeanAncestor
protected java.lang.Object findBeanAncestor()
throws org.apache.commons.jelly.JellyTagException
- Attempts to look up in the parent hierarchy for a tag that implements the
TaskSource interface, which returns an Ant Task object or that implements
BeanSource interface which creates a bean,
or will return the parent tag, which is also a bean.
findParentTaskObject
protected java.lang.Object findParentTaskObject()
throws org.apache.commons.jelly.JellyTagException
- Walks the hierarchy until it finds a parent TaskSource and returns its source or returns null
Copyright © 2002-2004 Apache Software Foundation. All Rights Reserved.