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

public Class PreSetDef

extends AntlibDefinition
implements TaskContainer
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.TaskContainer
Imports
org.apache.tools.ant.AntTypeDefinition, .BuildException, .ComponentHelper, .Project, .ProjectHelper, .Task, .TaskContainer, .UnknownElement

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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
PreSetDef.PreSetDefinition

This class contains the unknown element and the object that is predefined.

Field Summary

Modifier and TypeField and Description
private String
private UnknownElement

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addTask(Task
Nested task/type to extend.
nestedTask
)

Implements org.apache.tools.ant.TaskContainer.addTask.

Add a nested task to predefine attributes and elements on.
public void
execute()

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

Make a new definition.
public void
setName(String
the name of the definition.
name
)

Set the name of this definition.

Inherited from org.apache.tools.ant.taskdefs.AntlibDefinition:
getAntlibClassLoadergetURIsetAntlibClassLoadersetURI

Field Detail

nameback to summary
private String name
nestedTaskback to summary
private UnknownElement nestedTask

Constructor Detail

PreSetDefback to summary
public PreSetDef()

Method Detail

addTaskback to summary
public void addTask(Task nestedTask)

Implements org.apache.tools.ant.TaskContainer.addTask.

Add a nested task to predefine attributes and elements on.

Parameters
nestedTask:Task

Nested task/type to extend.

Annotations
@Override
executeback to summary
public void execute()

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

Make a new definition.

Annotations
@Override
setNameback to summary
public void setName(String name)

Set the name of this definition.

Parameters
name:String

the name of the definition.

org.apache.tools.ant.taskdefs back to summary

public Class PreSetDef.PreSetDefinition

extends AntTypeDefinition
Class Inheritance

This class contains the unknown element and the object that is predefined.
See Also
AntTypeDefinition

Field Summary

Modifier and TypeField and Description
private UnknownElement
private AntTypeDefinition

Constructor Summary

AccessConstructor and Description
public
PreSetDefinition(AntTypeDefinition
The parent of this predefinition.
parent
,
UnknownElement
The predefined attributes, nested elements and text.
el
)

Creates a new PresetDefinition instance.

Method Summary

Modifier and TypeMethod and Description
public void
checkClass(Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.checkClass.

Check if the attributes are correct.
public Object

Returns:

this object.
create
(Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.create.

Fake create an object, used by IntrospectionHelper and UnknownElement to see that this is a predefined object.
public Object

Returns:

the created object.
createObject
(Project
the current project.
project
)

Create an instance of the definition.

public ClassLoader

Returns:

the classloader for this definition.
getClassLoader
()

Overrides org.apache.tools.ant.AntTypeDefinition.getClassLoader.

Get the classloader for this definition.
public String

Returns:

the name of the class of this definition.
getClassName
()

Overrides org.apache.tools.ant.AntTypeDefinition.getClassName.

Get the classname of the definition.
public Class<?>

Returns:

the exposed class.
getExposedClass
(Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.getExposedClass.

Get the exposed class for this definition.
public UnknownElement

Returns:

the predefined attributes, elements and text as an UnknownElement.
getPreSets
()

Get the preset values.

public Class<?>

Returns:

the type of the definition.
getTypeClass
(Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.getTypeClass.

Get the definition class.
public boolean

Returns:

true if the definitions are the same.
sameDefinition
(AntTypeDefinition
another definition.
other
,
Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.sameDefinition.

Equality method for this definition.
public void
setAdapterClass(Class<?>
the adapterClass.
adapterClass
)

Overrides org.apache.tools.ant.AntTypeDefinition.setAdapterClass.

Set the adapter class for this definition.
public void
setAdaptToClass(Class<?>
the assignable class.
adaptToClass
)

Overrides org.apache.tools.ant.AntTypeDefinition.setAdaptToClass.

Set the assignable class for this definition.
public void
setClass(Class<?>
a Class value.
clazz
)

Overrides org.apache.tools.ant.AntTypeDefinition.setClass.

Override so that it is not allowed.
public void
setClassLoader(ClassLoader
the classLoader.
classLoader
)

Overrides org.apache.tools.ant.AntTypeDefinition.setClassLoader.

Set the classloader to use to create an instance of the definition.
public void
setClassName(String
a String value.
className
)

Overrides org.apache.tools.ant.AntTypeDefinition.setClassName.

Override so that it is not allowed.
public boolean

Returns:

true if the definitions are similar.
similarDefinition
(AntTypeDefinition
another definition.
other
,
Project
the current project.
project
)

Overrides org.apache.tools.ant.AntTypeDefinition.similarDefinition.

Similar method for this definition.
Inherited from org.apache.tools.ant.AntTypeDefinition:
getNameinnerCreateAndSetinnerGetTypeClassisRestrictsetNamesetRestrict

Field Detail

elementback to summary
private UnknownElement element
parentback to summary
private AntTypeDefinition parent

Constructor Detail

PreSetDefinitionback to summary
public PreSetDefinition(AntTypeDefinition parent, UnknownElement el)

Creates a new PresetDefinition instance.

Parameters
parent:AntTypeDefinition

The parent of this predefinition.

el:UnknownElement

The predefined attributes, nested elements and text.

Method Detail

checkClassback to summary
public void checkClass(Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.checkClass.

Check if the attributes are correct.

Parameters
project:Project

the current project.

Annotations
@Override
createback to summary
public Object create(Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.create.

Fake create an object, used by IntrospectionHelper and UnknownElement to see that this is a predefined object.

Parameters
project:Project

the current project.

Returns:Object

this object.

Annotations
@Override
createObjectback to summary
public Object createObject(Project project)

Create an instance of the definition. The instance may be wrapped in a proxy class. This is a special version of create for IntrospectionHelper and UnknownElement.

Parameters
project:Project

the current project.

Returns:Object

the created object.

getClassLoaderback to summary
public ClassLoader getClassLoader()

Overrides org.apache.tools.ant.AntTypeDefinition.getClassLoader.

Get the classloader for this definition.

Returns:ClassLoader

the classloader for this definition.

Annotations
@Override
getClassNameback to summary
public String getClassName()

Overrides org.apache.tools.ant.AntTypeDefinition.getClassName.

Get the classname of the definition.

Returns:String

the name of the class of this definition.

Annotations
@Override
getExposedClassback to summary
public Class<?> getExposedClass(Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.getExposedClass.

Get the exposed class for this definition.

Parameters
project:Project

the current project.

Returns:Class<?>

the exposed class.

Annotations
@Override
getPreSetsback to summary
public UnknownElement getPreSets()

Get the preset values.

Returns:UnknownElement

the predefined attributes, elements and text as an UnknownElement.

getTypeClassback to summary
public Class<?> getTypeClass(Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.getTypeClass.

Get the definition class.

Parameters
project:Project

the current project.

Returns:Class<?>

the type of the definition.

Annotations
@Override
sameDefinitionback to summary
public boolean sameDefinition(AntTypeDefinition other, Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.sameDefinition.

Equality method for this definition.

Parameters
other:AntTypeDefinition

another definition.

project:Project

the current project.

Returns:boolean

true if the definitions are the same.

Annotations
@Override
setAdapterClassback to summary
public void setAdapterClass(Class<?> adapterClass)

Overrides org.apache.tools.ant.AntTypeDefinition.setAdapterClass.

Set the adapter class for this definition. NOT Supported

Parameters
adapterClass:Class<?>

the adapterClass.

Annotations
@Override
setAdaptToClassback to summary
public void setAdaptToClass(Class<?> adaptToClass)

Overrides org.apache.tools.ant.AntTypeDefinition.setAdaptToClass.

Set the assignable class for this definition. NOT SUPPORTED

Parameters
adaptToClass:Class<?>

the assignable class.

Annotations
@Override
setClassback to summary
public void setClass(Class<?> clazz)

Overrides org.apache.tools.ant.AntTypeDefinition.setClass.

Override so that it is not allowed.

Parameters
clazz:Class<?>

a Class value.

Annotations
@Override
setClassLoaderback to summary
public void setClassLoader(ClassLoader classLoader)

Overrides org.apache.tools.ant.AntTypeDefinition.setClassLoader.

Set the classloader to use to create an instance of the definition. NOT SUPPORTED

Parameters
classLoader:ClassLoader

the classLoader.

Annotations
@Override
setClassNameback to summary
public void setClassName(String className)

Overrides org.apache.tools.ant.AntTypeDefinition.setClassName.

Override so that it is not allowed.

Parameters
className:String

a String value.

Annotations
@Override
similarDefinitionback to summary
public boolean similarDefinition(AntTypeDefinition other, Project project)

Overrides org.apache.tools.ant.AntTypeDefinition.similarDefinition.

Similar method for this definition.

Parameters
other:AntTypeDefinition

another definition.

project:Project

the current project.

Returns:boolean

true if the definitions are similar.

Annotations
@Override