Package 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
- All Implemented Interfaces:
- Cloneable
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 SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd a target to the list of targets to invoke.voidSet of properties to pass to the new project.voidReference element identifying a data type to carry over to the invoked target.Create a new Property to pass to the invoked target(s).voidexecute()Delegate the work to the ant task instance, after setting it up.voidhandleErrorFlush(String output) Handle error output.voidhandleErrorOutput(String output) Handle error output.voidhandleFlush(String output) Handles output.inthandleInput(byte[] buffer, int offset, int length) Handles input.voidhandleOutput(String output) Handles output.voidinit()Initialize this task by creating new instance of the ant task and configuring it by calling its own init method.voidsetInheritAll(boolean inherit) If true, pass all properties to the new Ant project.voidsetInheritRefs(boolean inheritRefs) If true, pass all references to the new Ant project.voidSet target to execute.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
CallTargetpublic CallTarget()
 
- 
- 
Method Details- 
setInheritAllpublic void setInheritAll(boolean inherit) If true, pass all properties to the new Ant project. Defaults to true.- Parameters:
- inherit-- booleanflag.
 
- 
setInheritRefspublic void setInheritRefs(boolean inheritRefs) If true, pass all references to the new Ant project. Defaults to false.- Parameters:
- inheritRefs-- booleanflag.
 
- 
init
- 
executeDelegate the work to the ant task instance, after setting it up.- Overrides:
- executein class- Task
- Throws:
- BuildException- on validation failure or if the target didn't execute.
 
- 
createParamCreate a new Property to pass to the invoked target(s).- Returns:
- a Propertyobject.
 
- 
addReferenceReference element identifying a data type to carry over to the invoked target.- Parameters:
- r- the specified- Ant.Reference.
- Since:
- Ant 1.5
 
- 
addPropertysetSet of properties to pass to the new project.- Parameters:
- ps- the- PropertySetto pass.
- Since:
- Ant 1.6
 
- 
setTargetSet target to execute.- Parameters:
- target- the name of the target to execute.
 
- 
addConfiguredTargetAdd a target to the list of targets to invoke.- Parameters:
- t-- Ant.TargetElementrepresenting the target.
- Since:
- Ant 1.6.3
 
- 
handleOutputHandles output. Send it the the new project if is present, otherwise call the super class.- Overrides:
- handleOutputin class- Task
- Parameters:
- output- The string output to output.
- Since:
- Ant 1.5
- See Also:
 
- 
handleInputHandles input. Delegate to the created project, if present, otherwise call the super class.- Overrides:
- handleInputin class- Task
- Parameters:
- buffer- the buffer into which data is to be read.
- offset- the offset into the buffer at which data is stored.
- length- the amount of data to read.
- Returns:
- the number of bytes read.
- Throws:
- IOException- if the data cannot be read.
- Since:
- Ant 1.6
- See Also:
 
- 
handleFlushHandles output. Send it the the new project if is present, otherwise call the super class.- Overrides:
- handleFlushin class- Task
- Parameters:
- output- The string to output.
- Since:
- Ant 1.5.2
- See Also:
 
- 
handleErrorOutputHandle error output. Send it the the new project if is present, otherwise call the super class.- Overrides:
- handleErrorOutputin class- Task
- Parameters:
- output- The string to output.
- Since:
- Ant 1.5
- See Also:
 
- 
handleErrorFlushHandle error output. Send it the the new project if is present, otherwise call the super class.- Overrides:
- handleErrorFlushin class- Task
- Parameters:
- output- The string to output.
- Since:
- Ant 1.5.2
- See Also:
 
 
-