PreSetDef (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: PreSetDef

Package org.apache.tools.ant.taskdefs

# Class PreSetDef

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AntlibDefinition
org.apache.tools.ant.taskdefs.PreSetDef

All Implemented Interfaces:
  `Cloneable`, `TaskContainer`

public class PreSetDef extends AntlibDefinition implements TaskContainer
The preset definition task generates a new definition based on a current definition with some attributes or elements preset.

     <presetdef name="my.javac">
       <javac deprecation="${deprecation}" debug="${debug}"/>
     </presetdef>
     <my.javac srcdir="src" destdir="classes"/>

Since:
  Ant 1.6

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `PreSetDef.PreSetDefinition`
  This class contains the unknown element and the object that is predefined.

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.Task

  `target, taskName, taskType, wrapper`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PreSetDef()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addTask(Task nestedTask)`
  Add a nested task to predefine attributes and elements on.
  `void`
  `execute()`
  Make a new definition.
  `void`
  `setName(String name)`
  Set the name of this definition.

  ### Methods inherited from class org.apache.tools.ant.taskdefs.AntlibDefinition

  `getAntlibClassLoader, getURI, setAntlibClassLoader, setURI`

  ### Methods inherited from class org.apache.tools.ant.Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PreSetDef

    public PreSetDef()

- ## Method Details

  - ### setName

    public void setName(String name)
    Set the name of this definition.
    Parameters:
      `name` - the name of the definition.

  - ### addTask

    public void addTask(Task nestedTask)
    Add a nested task to predefine attributes and elements on.
    Specified by:
      `addTask` in interface `TaskContainer`
    Parameters:
      `nestedTask` - Nested task/type to extend.

  - ### execute

    public void execute()
    Make a new definition.
    Overrides:
      `execute` in class `Task`