CallTarget (Apache Ant API)
Keywords: org.apache.tools.ant.taskdefs.CallTarget class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.taskdefs
Class CallTarget

    java.lang.Object
      org.apache.tools.ant.ProjectComponent
          org.apache.tools.ant.Task
              org.apache.tools.ant.taskdefs.CallTarget

public class CallTarget
extends Task

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
Author:
  Stefan Bodewig

Field Summary

Fields inherited from class org.apache.tools.ant.Task
`description, location, target, taskName, taskType, wrapper`

Fields inherited from class org.apache.tools.ant.ProjectComponent
`project`

Constructor Summary
`CallTarget()`

Method Summary
`void` | `addReference(Ant.Reference r)` Reference element identifying a data type to carry over to the invoked target.
`Property` | `createParam()` Property to pass to the invoked target.
`void` | `execute()` hand off the work to the ant task of ours, after setting it up
`void` | `handleErrorFlush(java.lang.String line)` Pass output sent to System.err to the new project.
`void` | `handleErrorOutput(java.lang.String line)` Pass output sent to System.err to the new project.
`void` | `handleFlush(java.lang.String line)` Pass output sent to System.out to the new project.
`void` | `handleOutput(java.lang.String line)` Pass output sent to System.out to the new project.
`void` | `init()` init this task by creating new instance of the ant task and configuring it's by calling its own init method.
`void` | `setInheritAll(boolean inherit)` If true, pass all properties to the new Ant project.
`void` | `setInheritRefs(boolean inheritRefs)` If true, pass all references to the new Ant project.
`void` | `setTarget(java.lang.String target)` Target to execute, required.

Methods inherited from class org.apache.tools.ant.Task
`getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName`

Methods inherited from class org.apache.tools.ant.ProjectComponent
`getProject, setProject`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CallTarget

    public CallTarget()

Method Detail

### setInheritAll

    public void setInheritAll(boolean inherit)

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

### setInheritRefs

    public void setInheritRefs(boolean inheritRefs)

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

  Parameters:
    `inheritRefs` - new value

### init

    public void init()

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

  Overrides:
    `init` in class `Task`

### execute

    public void execute()
                 throws BuildException

  hand off the work to the ant task of ours, after setting it up

  Overrides:
    `execute` in class `Task`
  Throws:
    `BuildException` - on validation failure or if the target didn't execute

### createParam

    public Property createParam()

  Property to pass to the invoked target.

### addReference

    public void addReference(Ant.Reference r)

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

  Since:
    Ant 1.5

### setTarget

    public void setTarget(java.lang.String target)

  Target to execute, required.

### handleOutput

    public void handleOutput(java.lang.String line)

  Pass output sent to System.out to the new project.

  Overrides:
    `handleOutput` in class `Task`
  Parameters:
    `line` - The line of output to log. Should not be `null`.
  Since:
    Ant 1.5

### handleFlush

    public void handleFlush(java.lang.String line)

  Pass output sent to System.out to the new project.

  Overrides:
    `handleFlush` in class `Task`
  Parameters:
    `line` - The line of output to log. Should not be `null`.
  Since:
    Ant 1.5.2

### handleErrorOutput

    public void handleErrorOutput(java.lang.String line)

  Pass output sent to System.err to the new project.

  Overrides:
    `handleErrorOutput` in class `Task`
  Parameters:
    `line` - The error line to log. Should not be `null`.
  Since:
    Ant 1.5

### handleErrorFlush

    public void handleErrorFlush(java.lang.String line)

  Pass output sent to System.err to the new project.

  Overrides:
    `handleErrorFlush` in class `Task`
  Parameters:
    `line` - The error line to log. Should not be `null`.
  Since:
    Ant 1.5.2

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.