org.apache.tools.ant.taskdefs

Class Antlib

Implemented Interfaces:
TaskContainer

public class Antlib
extends Task
implements TaskContainer

Antlib task. It does not occur in an ant build file. It is the root element an antlib xml file.
Since:
Ant 1.6

Field Summary

static String
TAG
The name of this task

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

Method Summary

void
addTask(Task nestedTask)
add a task to the list of tasks
static Antlib
createAntlib(Project project, URL antlibUrl, String uri)
Static method to read an ant lib definition from a url.
void
execute()
Execute the nested tasks, setting the classloader for any tasks that derive from Definer.
protected void
setClassLoader(ClassLoader classLoader)
Set the class loader for this antlib.
protected void
setURI(String uri)
Set the URI for this antlib.

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

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

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

getProject, log, log, setProject

Field Details

TAG

public static final String TAG
The name of this task

Method Details

addTask

public void addTask(Task nestedTask)
add a task to the list of tasks
Specified by:
addTask in interface TaskContainer
Parameters:
nestedTask - Nested task to execute in antlib

createAntlib

public static Antlib createAntlib(Project project,
                                  URL antlibUrl,
                                  String uri)
Static method to read an ant lib definition from a url.
Parameters:
project - the current project
antlibUrl - the url to read the definitions from
uri - the uri that the antlib is to be placed in
Returns:
the ant lib task

execute

public void execute()
Execute the nested tasks, setting the classloader for any tasks that derive from Definer.
Overrides:
execute in interface Task

setClassLoader

protected void setClassLoader(ClassLoader classLoader)
Set the class loader for this antlib. This class loader is used for any tasks that derive from Definer.
Parameters:
classLoader - the class loader

setURI

protected void setURI(String uri)
Set the URI for this antlib.
Parameters:
uri - the namespace uri

Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.