RootLoaderRef (Groovy 5.0.6)

Package: org.codehaus.groovy.ant

## [Java] Class RootLoaderRef

- org.codehaus.groovy.ant.RootLoaderRef

-     public class RootLoaderRef
      extends MatchingTask

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

  - ref
  - classpath
  all arguments are required. As ant requires 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 looks for a matching method which includes a matching class. But two classes of the same name with different class loaders are different, so ant would not be able to find the method.
  See Also:
    RootLoader

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Path` | `createClasspath()` Adds a path to the classpath.
    `` | `public void` | `execute()`
    `` | `public void` | `setClasspath(Path classpath)` Set the classpath to be used for this compilation.
    `` | `public void` | `setClasspathRef(Reference r)` Adds a reference to a classpath defined elsewhere.
    `` | `public void` | `setRef(String n)` sets the name of the reference which should store the Loader

  - ### Inherited Methods Summary

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

- - ### Method Detail

    - #### public Path createClasspath()

      Adds a path to the classpath.

      Returns:
        a class path to be configured

    - #### @Override
      public void execute()

    - #### public void setClasspath(Path classpath)

      Set the classpath to be used for this compilation.

      Parameters:
        `classpath` - an Ant Path object containing the compilation classpath.

    - #### public void setClasspathRef(Reference r)

      Adds a reference to a classpath defined elsewhere.

      Parameters:
        `r` - a reference to a classpath

    - #### public void setRef(String n)

      sets the name of the reference which should store the Loader