FileDocCategorySizeDatePackage
AntlibDefinition.javaAPI DocApache Ant 1.702556Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs

AntlibDefinition

public class AntlibDefinition extends org.apache.tools.ant.Task
Base class for tasks that that can be used in antlibs. For handling uri and class loading.
since
Ant 1.6

Fields Summary
private String
uri
private ClassLoader
antlibClassLoader
Constructors Summary
Methods Summary
public java.lang.ClassLoadergetAntlibClassLoader()
The current antlib classloader

return
the antlib classloader for the definition, this is null if the definition is not used in an antlib.

        return antlibClassLoader;
    
public java.lang.StringgetURI()
The URI for this definition.

return
The URI for this defintion.

        return uri;
    
public voidsetAntlibClassLoader(java.lang.ClassLoader classLoader)
Set the class loader of the loading object

param
classLoader a ClassLoader value

        this.antlibClassLoader = classLoader;
    
public voidsetURI(java.lang.String uri)
The URI for this definition. If the URI is "antlib:org.apache.tools.ant", (this is the default uri) the uri will be set to "". URIs that start with "ant:" are reserved and are not allowed in this context.

param
uri the namespace URI
throws
BuildException if a reserved URI is used


                                                          
          
        if (uri.equals(ProjectHelper.ANT_CORE_URI)) {
            uri = "";
        }
        if (uri.startsWith("ant:")) {
            throw new BuildException("Attempt to use a reserved URI " + uri);
        }
        this.uri = uri;