groovy.util
Class AntBuilder

java.lang.Object
  extended bygroovy.lang.GroovyObjectSupport
      extended bygroovy.util.BuilderSupport
          extended bygroovy.util.AntBuilder
All Implemented Interfaces:
GroovyObject

public class AntBuilder
extends BuilderSupport

Allows Ant tasks to be used with GroovyMarkup

Version:
$Revision: 1.10 $
Author:
James Strachan, changes by Dierk Koenig (dk)

Constructor Summary
AntBuilder()
           
AntBuilder(org.apache.tools.ant.Project project)
           
 
Method Summary
protected  Object createDataType(Constructor ctor, Object[] args, String name, String argDescription)
           
protected  Object createDataType(String name)
           
protected  Object createNestedObject(Object object, String name)
          Creates a nested object of the given object with the specified name
protected  Object createNode(Object tagName)
           
protected  Object createNode(Object name, Map attributes)
           
protected  Object createNode(Object name, Map attributes, Object value)
           
protected  Object createNode(Object name, Object value)
           
protected  org.apache.tools.ant.Project createProject()
           
protected  org.apache.tools.ant.Task createTask(String taskName)
           
protected  org.apache.tools.ant.Task createTask(String taskName, Class taskType)
           
protected  Method getAccessibleMethod(Class theClass, String name, Class[] paramTypes)
           
 org.apache.tools.ant.Project getAntProject()
           
protected  org.apache.tools.ant.Task getParentTask()
           
protected  org.apache.tools.ant.Project getProject()
           
protected  void nodeCompleted(Object parent, Object node)
          Determines, when the ANT Task that is represented by the "node" should perform.
protected  void setBeanProperties(Object object, Map map)
           
protected  void setBeanProperty(Object object, String name, Object value)
           
protected  void setParent(Object parent, Object child)
           
protected  void setText(Object task, String text)
           
 
Methods inherited from class groovy.util.BuilderSupport
doInvokeMethod, getCurrent, getName, invokeMethod, setClosureDelegate, setCurrent
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntBuilder

public AntBuilder()

AntBuilder

public AntBuilder(org.apache.tools.ant.Project project)
Method Detail

getProject

protected org.apache.tools.ant.Project getProject()

createProject

protected org.apache.tools.ant.Project createProject()
Returns:
Factory method to create new Project instances

setParent

protected void setParent(Object parent,
                         Object child)
Specified by:
setParent in class BuilderSupport

nodeCompleted

protected void nodeCompleted(Object parent,
                             Object node)
Determines, when the ANT Task that is represented by the "node" should perform. Node must be an ANT Task or no "perform" is called. If node is an ANT Task, it performs right after complete contstruction. If node is nested in a TaskContainer, calling "perform" is delegated to that TaskContainer.

Overrides:
nodeCompleted in class BuilderSupport
Parameters:
parent - note: null when node is root
node - the node that now has all its children applied

createNode

protected Object createNode(Object tagName)
Specified by:
createNode in class BuilderSupport

createNode

protected Object createNode(Object name,
                            Object value)
Specified by:
createNode in class BuilderSupport

createNode

protected Object createNode(Object name,
                            Map attributes,
                            Object value)
Specified by:
createNode in class BuilderSupport

createNode

protected Object createNode(Object name,
                            Map attributes)
Specified by:
createNode in class BuilderSupport

setText

protected void setText(Object task,
                       String text)

getAccessibleMethod

protected Method getAccessibleMethod(Class theClass,
                                     String name,
                                     Class[] paramTypes)

getAntProject

public org.apache.tools.ant.Project getAntProject()

setBeanProperties

protected void setBeanProperties(Object object,
                                 Map map)

setBeanProperty

protected void setBeanProperty(Object object,
                               String name,
                               Object value)

createNestedObject

protected Object createNestedObject(Object object,
                                    String name)
Creates a nested object of the given object with the specified name


createDataType

protected Object createDataType(String name)

createDataType

protected Object createDataType(Constructor ctor,
                                Object[] args,
                                String name,
                                String argDescription)
Parameters:
ctor - a constructor to use creating the object
args - the arguments to pass to the constructor
name - the name of the data type being created
argDescription - a human readable description of the args passed
Returns:
an object create with the given constructor and args.

createTask

protected org.apache.tools.ant.Task createTask(String taskName)
Parameters:
taskName - the name of the task to create
Returns:
a newly created task

createTask

protected org.apache.tools.ant.Task createTask(String taskName,
                                               Class taskType)

getParentTask

protected org.apache.tools.ant.Task getParentTask()


Copyright © 2003-2007 The Codehaus. All Rights Reserved.