Package: org.codehaus.groovy.tools.shell.util

## [Groovy] Class PackageHelperImpl

- org.codehaus.groovy.tools.shell.util.PackageHelperImpl

- All Implemented Interfaces and Traits:
    PackageHelper, PreferenceChangeListener

      @CompileStaticCompileStatic
      @DeprecatedDeprecated
      class PackageHelperImpl
      extends Object

  Helper class that crawls all items of the classpath for packages. Retrieves from those sources the list of subpackages and classes on demand.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected static Logger` | `LOG` |
    `static Pattern` | `NAME_PATTERN` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `private ClassLoader` | `groovyClassLoader`
    `private Map` | `rootPackages`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `PackageHelperImpl (ClassLoader groovyClassLoader)`
    `PackageHelperImpl ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static Collection` | `collectPackageNamesFromFolderRecursive(File directory, String prefix, Set packnames)` Crawls a folder, iterates over subfolders, looking for class files.
    `` | `static Set` | `getClassnames(Set urls, String packagename)` Copied from JLine 1.0 ClassNameCompletor
    `` | `Set` | `getContents(String packagename)` returns the names of Classes and direct subpackages contained in a package
    `` | `static Collection` | `getPackageNames(URL url)` Returns all packagenames found at URL, accepts jar files and folders
    `` | `static Collection` | `getPackageNamesFromJar(JarFile jf)`
    `` | `static Object` | `mergeNewPackages(Collection packageNames, URL url, Map rootPackages)`
    `` | `void` | `preferenceChange(PreferenceChangeEvent evt)`
    `` | `void` | `reset()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### protected static final Logger LOG

    - #### public static final Pattern NAME_PATTERN

  - ### Property Detail

    - #### private final ClassLoader groovyClassLoader

    - #### private Map rootPackages

  - ### Constructor Detail

    - #### PackageHelperImpl(ClassLoader groovyClassLoader)

    - #### PackageHelperImpl()

  - ### Method Detail

    - #### static Collection collectPackageNamesFromFolderRecursive(File directory, String prefix, Set packnames)

      Crawls a folder, iterates over subfolders, looking for class files.

      Returns:
        Parameters:
          directory
          prefix
          packnames

    - #### static Set getClassnames(Set urls, String packagename)

      Copied from JLine 1.0 ClassNameCompletor

      Returns:
        Parameters:
          urls
          packagename

    - #### @CompileStaticCompileStatic Set getContents(String packagename)

      returns the names of Classes and direct subpackages contained in a package

      Returns:
        Parameters:
          packagename

    - #### static Collection getPackageNames(URL url)

      Returns all packagenames found at URL, accepts jar files and folders

      Returns:
        Parameters:
          url

    - #### static Collection getPackageNamesFromJar(JarFile jf)

    - #### static Object mergeNewPackages(Collection packageNames, URL url, Map rootPackages)

    - #### @OverrideOverride void preferenceChange(PreferenceChangeEvent evt)

    - #### void reset()