org.apache.tools.ant.taskdefs

Class MacroInstance

public class MacroInstance extends Task implements DynamicAttribute, TaskContainer

The class to be placed in the ant type definition. It is given a pointer to the template definition, and makes a copy of the unknown element, substituting the parameter values in attributes and text.

Since: Ant 1.6

Nested Class Summary
static classMacroInstance.Element
Embedded element in macro instance
Method Summary
voidaddTask(Task nestedTask)
Add a unknownElement for the macro instances nested elements.
voidaddText(String text)
Set the text contents for the macro.
ObjectcreateDynamicElement(String name)
Method present for BC purposes.
voidexecute()
Execute the templates instance.
MacroDefgetMacroDef()
voidsetDynamicAttribute(String name, String value)
A parameter name value pair as a xml attribute.
voidsetMacroDef(MacroDef macroDef)
Called from MacroDef.MyAntTypeDefinition#create()

Method Detail

addTask

public void addTask(Task nestedTask)
Add a unknownElement for the macro instances nested elements.

Parameters: nestedTask a nested element.

addText

public void addText(String text)
Set the text contents for the macro.

Parameters: text the text to be added to the macro.

createDynamicElement

public Object createDynamicElement(String name)

Deprecated:

Method present for BC purposes.

Parameters: name not used

Returns: nothing

Throws: BuildException always

execute

public void execute()
Execute the templates instance. Copies the unknown element, substitutes the attributes, and calls perform on the unknown element.

getMacroDef

public MacroDef getMacroDef()

Returns: the macro definition object for this macro instance.

setDynamicAttribute

public void setDynamicAttribute(String name, String value)
A parameter name value pair as a xml attribute.

Parameters: name the name of the attribute value the value of the attribute

setMacroDef

public void setMacroDef(MacroDef macroDef)
Called from MacroDef.MyAntTypeDefinition#create()

Parameters: macroDef a MacroDef value

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.