org.apache.commons.jelly.tags.ant
Class AntTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.DynaTagSupport
          extended byorg.apache.commons.jelly.MapTagSupport
              extended byorg.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
 

Field Detail

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.

Constructor Detail

AntTag

public AntTag(java.lang.String tagName)
Construct with a project and tag name.

Parameters:
tagName - The name on the tag.
Method Detail

toString

public java.lang.String toString()

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
Throws:
org.apache.commons.jelly.JellyTagException

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
Specified by:
doTag in interface org.apache.commons.jelly.Tag
Throws:
org.apache.commons.jelly.JellyTagException

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

Throws:
org.apache.commons.jelly.JellyTagException

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface org.apache.commons.jelly.DynaTag

setBeanProperty

public void setBeanProperty(java.lang.Object object,
                            java.lang.String name,
                            java.lang.Object value)
                     throws org.apache.commons.jelly.JellyTagException
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
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.

Throws:
org.apache.commons.jelly.JellyTagException

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

Throws:
org.apache.commons.jelly.JellyTagException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.