Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » taskdefs » [javadoc | source]
org.apache.tools.ant.taskdefs
abstract public class: Definer [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
         org.apache.tools.ant.taskdefs.AntlibDefinition
            org.apache.tools.ant.taskdefs.DefBase
               org.apache.tools.ant.taskdefs.Definer

All Implemented Interfaces:
    Cloneable

Direct Known Subclasses:
    Typedef, Taskdef

Base class for Taskdef and Typedef - handles all the attributes for Typedef. The uri and class handling is handled by DefBase
Nested Class Summary:
public static class  Definer.OnError  Enumerated type for onError attribute 
public static class  Definer.Format  Enumerated type for format attribute 
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Method from org.apache.tools.ant.taskdefs.Definer Summary:
addDefinition,   execute,   getClassname,   getFile,   getName,   getResource,   loadProperties,   makeResourceFromURI,   setAdaptTo,   setAdaptToClass,   setAdapter,   setAdapterClass,   setAntlib,   setClassname,   setFile,   setFormat,   setName,   setOnError,   setResource
Methods from org.apache.tools.ant.taskdefs.DefBase:
createClasspath,   createLoader,   getClasspath,   getClasspathId,   getLoaderId,   hasCpDelegate,   init,   isReverseLoader,   setClasspath,   setClasspathRef,   setLoaderRef,   setReverseLoader
Methods from org.apache.tools.ant.taskdefs.AntlibDefinition:
getAntlibClassLoader,   getURI,   setAntlibClassLoader,   setURI
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.taskdefs.Definer Detail:
 protected  void addDefinition(ClassLoader al,
    String name,
    String classname) throws BuildException 
    Add a definition using the attributes of Definer
 public  void execute() throws BuildException 
    Run the definition.
 public String getClassname() 
    Returns the classname of the object we are defining. May be null.
 public File getFile() 
 public String getName() 
 public String getResource() 
 protected  void loadProperties(ClassLoader al,
    URL url) 
    Load type definitions as properties from a URL.
 public static String makeResourceFromURI(String uri) 
    This is where the logic to map from a URI to an antlib resource is kept.
 public  void setAdaptTo(String adaptTo) 
    Set the classname of the class that the definition must be compatible with, either directly or by use of the adapter class.
 protected  void setAdaptToClass(Class adaptToClass) 
    Set the class for adaptToClass, to be used by derived classes, used instead of the adaptTo attribute.
 public  void setAdapter(String adapter) 
    Set the class name of the adapter class. An adapter class is used to proxy the definition class. It is used if the definition class is not assignable to the adaptto class, or if the adaptto class is not present.
 protected  void setAdapterClass(Class adapterClass) 
    Set the adapter class.
 public  void setAntlib(String antlib) 
    Antlib attribute, sets resource and uri. uri is set the antlib value and, resource is set to the antlib.xml resource in the classpath. For example antlib="antlib:org.acme.bland.cola" corresponds to uri="antlib:org.acme.bland.cola" resource="org/acme/bland/cola/antlib.xml". ASF Bugzilla Bug 31999
 public  void setClassname(String classname) 
    The full class name of the object being defined. Required, unless file or resource have been specified.
 public  void setFile(File file) 
    Name of the property file to load ant name/classname pairs from.
 public  void setFormat(Definer.Format format) 
    Sets the format of the file or resource
 public  void setName(String name) 
    Name of the definition
 public  void setOnError(Definer.OnError onError) 
    What to do if there is an error in loading the class.
  • error - throw build exception
  • report - output at warning level
  • ignore - output at debug level
 public  void setResource(String res) 
    Name of the property resource to load ant name/classname pairs from.