Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class CallTarget

extends Task
Class Inheritance
Imports
java.io.IOException, org.apache.tools.ant.BuildException, .MagicNames, .Task, org.apache.tools.ant.types.PropertySet

Call another target in the same project.
   <target name="foo">
     <antcall target="bar">
       <param name="property1" value="aaaaa" />
       <param name="foo" value="baz" />
      </antcall>
   </target>

   <target name="bar" depends="init">
     <echo message="prop is ${property1} ${foo}" />
   </target>

This only works as expected if neither property1 nor foo are defined in the project itself.

Since
Ant 1.2

Field Summary

Modifier and TypeField and Description
private Ant
private boolean
private boolean
private boolean
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addConfiguredTarget(Ant.TargetElement
Ant.TargetElement representing the target.
t
)

Add a target to the list of targets to invoke.

public void
addPropertyset(PropertySet
the PropertySet to pass.
ps
)

Set of properties to pass to the new project.

public void
addReference(Ant.Reference
the specified Ant.Reference.
r
)

Reference element identifying a data type to carry over to the invoked target.

public Property

Returns:

a Property object.
createParam
()

Create a new Property to pass to the invoked target(s).

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Delegate the work to the ant task instance, after setting it up.
public void
handleErrorFlush(String
The string to output.
output
)

Overrides org.apache.tools.ant.Task.handleErrorFlush.

Handle error output.
public void
handleErrorOutput(String
The string to output.
output
)

Overrides org.apache.tools.ant.Task.handleErrorOutput.

Handle error output.
public void
handleFlush(String
The string to output.
output
)

Overrides org.apache.tools.ant.Task.handleFlush.

Handles output.
public int

Returns:

the number of bytes read.
handleInput
(byte[]
the buffer into which data is to be read.
buffer
,
int
the offset into the buffer at which data is stored.
offset
,
int
the amount of data to read.
length
)

Overrides org.apache.tools.ant.Task.handleInput.

Handles input.
public void
handleOutput(String
The string output to output.
output
)

Overrides org.apache.tools.ant.Task.handleOutput.

Handles output.
public void
init()

Overrides org.apache.tools.ant.Task.init.

Initialize this task by creating new instance of the ant task and configuring it by calling its own init method.
public void
setInheritAll(boolean
boolean flag.
inherit
)

If true, pass all properties to the new Ant project.

public void
setInheritRefs(boolean
boolean flag.
inheritRefs
)

If true, pass all references to the new Ant project.

public void
setTarget(String
the name of the target to execute.
target
)

Set target to execute.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

calleeback to summary
private Ant callee
inheritAllback to summary
private boolean inheritAll
inheritRefsback to summary
private boolean inheritRefs
targetSetback to summary
private boolean targetSet

Constructor Detail

CallTargetback to summary
public CallTarget()

Method Detail

addConfiguredTargetback to summary
public void addConfiguredTarget(Ant.TargetElement t)

Add a target to the list of targets to invoke.

Parameters
t:Ant.TargetElement

Ant.TargetElement representing the target.

Since
Ant 1.6.3
addPropertysetback to summary
public void addPropertyset(PropertySet ps)

Set of properties to pass to the new project.

Parameters
ps:PropertySet

the PropertySet to pass.

Since
Ant 1.6
addReferenceback to summary
public void addReference(Ant.Reference r)

Reference element identifying a data type to carry over to the invoked target.

Parameters
r:Ant.Reference

the specified Ant.Reference.

Since
Ant 1.5
createParamback to summary
public Property createParam()

Create a new Property to pass to the invoked target(s).

Returns:Property

a Property object.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Delegate the work to the ant task instance, after setting it up.

Exceptions
BuildException:
on validation failure or if the target didn't execute.
handleErrorFlushback to summary
public void handleErrorFlush(String output)

Overrides org.apache.tools.ant.Task.handleErrorFlush.

Handle error output. Send it the the new project if is present, otherwise call the super class.

Parameters
output:String

The string to output.

Since
Ant 1.5.2
See Also
Task#handleErrorFlush(String)
handleErrorOutputback to summary
public void handleErrorOutput(String output)

Overrides org.apache.tools.ant.Task.handleErrorOutput.

Handle error output. Send it the the new project if is present, otherwise call the super class.

Parameters
output:String

The string to output.

Since
Ant 1.5
See Also
Task#handleErrorOutput(String)
handleFlushback to summary
public void handleFlush(String output)

Overrides org.apache.tools.ant.Task.handleFlush.

Handles output. Send it the the new project if is present, otherwise call the super class.

Parameters
output:String

The string to output.

Since
Ant 1.5.2
See Also
Task#handleFlush(String)
handleInputback to summary
public int handleInput(byte[] buffer, int offset, int length) throws IOException

Overrides org.apache.tools.ant.Task.handleInput.

Handles input. Delegate to the created project, if present, otherwise call the super class.

Parameters
buffer:byte[]

the buffer into which data is to be read.

offset:int

the offset into the buffer at which data is stored.

length:int

the amount of data to read.

Returns:int

the number of bytes read.

Exceptions
IOException:
if the data cannot be read.
Since
Ant 1.6
See Also
Task#handleInput(byte[], int, int)
handleOutputback to summary
public void handleOutput(String output)

Overrides org.apache.tools.ant.Task.handleOutput.

Handles output. Send it the the new project if is present, otherwise call the super class.

Parameters
output:String

The string output to output.

Since
Ant 1.5
See Also
Task#handleOutput(String)
initback to summary
public void init()

Overrides org.apache.tools.ant.Task.init.

Initialize this task by creating new instance of the ant task and configuring it by calling its own init method.

setInheritAllback to summary
public void setInheritAll(boolean inherit)

If true, pass all properties to the new Ant project. Defaults to true.

Parameters
inherit:boolean

boolean flag.

setInheritRefsback to summary
public void setInheritRefs(boolean inheritRefs)

If true, pass all references to the new Ant project. Defaults to false.

Parameters
inheritRefs:boolean

boolean flag.

setTargetback to summary
public void setTarget(String target)

Set target to execute.

Parameters
target:String

the name of the target to execute.