Groovy 1.7.0

## org.codehaus.groovy.ant
Class RootLoaderRef

    java.lang.Object
      org.apache.tools.ant.ProjectComponent
          org.apache.tools.ant.Task
              org.apache.tools.ant.taskdefs.MatchingTask
                  org.codehaus.groovy.ant.RootLoaderRef

    class RootLoaderRef
    extends MatchingTask

Sets the RootLoader as reference. Reexecution of this task will set a new instance of RootLoader for the reference. arguments:

- ref
- classpath

all arguments are requiered. As ant requieres an AntClassLoader as reference, this will create a RootLoader and set an AntClassLoader as child and stored in the reference. The AntClassLoader instance will not have a classpath nor will it have access to the classpath somehow, all loading is done by the RootLoader parent. To avoid problems with loading classes multiple times and using them at the same time, this task will filter out the ant jars and the commons-logging jars. This only works if the ant jars are starting with "ant-" and the logging jar starts with "commons-logging-". This was needed because if ant wants to access a task argument that uses for example a Path it look for a matching method which includes a matching class. But two classes of the same name with different classloaders are different, so ant would not be able to find the method.

see:
  RootLoader

author:
  Jochen Theodorou

version:
  $Revision: 6778 $

Constructor Summary
`RootLoaderRef()`

Method Summary
`Path` | `createClasspath()` Adds a path to the classpath.
`void` | `execute()`
`void` | `setClasspath(Path classpath)` Set the classpath to be used for this compilation.
`void` | `setClasspathRef(Reference r)` Adds a reference to a classpath defined elsewhere.
`void` | `setRef(String n)` sets the name of the reference which should store the Loader

Methods inherited from class MatchingTask

add, setProject, setIncludes, addNot, addAnd, addOr, addContains, createInclude, createIncludesFile, createExclude, createExcludesFile, createPatternSet, XsetItems, setExcludes, XsetIgnore, setDefaultexcludes, setIncludesfile, setExcludesfile, setCaseSensitive, setFollowSymlinks, hasSelectors, selectorCount, getSelectors, selectorElements, appendSelector, addSelector, addNone, addMajority, addDate, addSize, addFilename, addCustom, addPresent, addDepth, addDepend, addContainsRegexp, addDifferent, addType, addModified, log, log, log, log, init, execute, maybeConfigure, getTaskName, getOwningTarget, setRuntimeConfigurableWrapper, getTaskType, setTaskType, setTaskName, setOwningTarget, getRuntimeConfigurableWrapper, reconfigure, perform, bindToOwner, clone, getLocation, getDescription, setLocation, setDescription, getProject, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Methods inherited from class Task
log, log, log, log, init, execute, maybeConfigure, getTaskName, getOwningTarget, setRuntimeConfigurableWrapper, getTaskType, setTaskType, setTaskName, setOwningTarget, getRuntimeConfigurableWrapper, reconfigure, perform, bindToOwner, clone, getLocation, getDescription, setLocation, setDescription, getProject, setProject, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Methods inherited from class ProjectComponent
clone, log, log, getLocation, getDescription, setLocation, setDescription, getProject, setProject, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Constructor Detail

### RootLoaderRef

    RootLoaderRef()

Method Detail

### createClasspath

    public Path createClasspath()

  Adds a path to the classpath.
  return:
    a class path to be configured

### execute

    public void execute()

### setClasspath

    public void setClasspath(Path classpath)

  Set the classpath to be used for this compilation.
  param:
    classpath an Ant Path object containing the compilation classpath.

### setClasspathRef

    public void setClasspathRef(Reference r)

  Adds a reference to a classpath defined elsewhere.
  param:
    r a reference to a classpath

### setRef

    public void setRef(String n)

  sets the name of the reference which should store the Loader

Copyright © 2003-2009 The Codehaus. All rights reserved.