Package org.apache.groovy.groovysh.jline

# Class PackageHelper

java.lang.Object
org.apache.groovy.groovysh.jline.PackageHelper

public class PackageHelper extends Object
Discovers classes and package entries from file systems, jars, and Groovy class loaders.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PackageHelper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static List<Object>`
  `getClassesForPackage(String packageName)`
  Attempts to list all the classes in the specified package as determined by the context class loader
  `static List<Object>`
  `getClassesForPackage(String packageName, GroovyClassLoader classLoader, Function<String,Class<?>> classResolver)`
  Attempts to list all the classes in the specified package as determined by the Groovy class loader classpath
  `static List<String>`
  `getClassNamesForPackage(String packageName, ClassLoader classLoader)`
  Attempts to list all the class names in the specified package as determined by the Groovy class loader classpath

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PackageHelper

    public PackageHelper()

- ## Method Details

  - ### getClassNamesForPackage

    public static List<String> getClassNamesForPackage(String packageName, ClassLoader classLoader)
    Attempts to list all the class names in the specified package as determined by the Groovy class loader classpath
    Parameters:
      `packageName` - the package name to search
      `classLoader` - class loader
    Returns:
      a list of class names that exist within that package

  - ### getClassesForPackage

    public static List<Object> getClassesForPackage(String packageName, GroovyClassLoader classLoader, Function<String,Class<?>> classResolver) throws ClassNotFoundException
    Attempts to list all the classes in the specified package as determined by the Groovy class loader classpath
    Parameters:
      `packageName` - the package name to search
      `classLoader` - Groovy class loader
      `classResolver` - resolve class from class name
    Returns:
      a list of classes that exist within that package
    Throws:
      `ClassNotFoundException` - if something went wrong

  - ### getClassesForPackage

    public static List<Object> getClassesForPackage(String packageName) throws ClassNotFoundException
    Attempts to list all the classes in the specified package as determined by the context class loader
    Parameters:
      `packageName` - the package name to search
    Returns:
      a list of classes that exist within that package
    Throws:
      `ClassNotFoundException` - if something went wrong