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

java.lang.Object
  |
  +--org.apache.commons.jelly.TagSupport
        |
        +--org.apache.commons.jelly.MapTagSupport
              |
              +--org.apache.commons.jelly.tags.ant.AntTag
All Implemented Interfaces:
DynaTag, Tag, TaskSource

public class AntTag
extends 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(XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
protected  java.lang.Object findBeanAncestor()
          Attempts to look up in the parent hierarchy for a tag that implements the BeanSource interface which creates a dynamic bean, or will return the parent tag, which is also a bean.
 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)
          Sets an attribute value of this tag before the tag is invoked
 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.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, 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:
project - The Ant project.
tagName - The name on the tag.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

doTag

public void doTag(XMLOutput output)
           throws java.lang.Exception
Description copied from interface: Tag
Evaluates this tag after all the tags properties have been initialized.

getTagName

public java.lang.String getTagName()

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.

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 java.lang.Exception
Sets the properties on the Ant task

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Description copied from class: MapTagSupport
Sets an attribute value of this tag before the tag is invoked
Overrides:
setAttribute in class MapTagSupport

setBeanProperty

public void setBeanProperty(java.lang.Object object,
                            java.lang.String name,
                            java.lang.Object value)
                     throws java.lang.Exception

createNestedObject

public java.lang.Object createNestedObject(java.lang.Object object,
                                           java.lang.String name)
                                    throws java.lang.Exception
Creates a nested object of the given object with the specified name

createDataType

public java.lang.Object createDataType(java.lang.String name)
                                throws java.lang.Exception

createTask

public org.apache.tools.ant.Task createTask(java.lang.String taskName)
                                     throws java.lang.Exception

createTask

public org.apache.tools.ant.Task createTask(java.lang.String taskName,
                                            java.lang.Class taskType)
                                     throws java.lang.Exception

findBeanAncestor

protected java.lang.Object findBeanAncestor()
                                     throws java.lang.Exception
Attempts to look up in the parent hierarchy for a tag that implements the BeanSource interface which creates a dynamic bean, or will return the parent tag, which is also a bean.


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