Groovy 2.2.0

org.codehaus.groovy.tools.shell.util
[Groovy] Class PackageHelper

java.lang.Object
  org.codehaus.groovy.tools.shell.util.PackageHelper
All Implemented Interfaces:
PreferenceChangeListener

class PackageHelper

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
static String IMPORT_COMPLETION_PREFERENCE_KEY

static Pattern NAME_PATTERN

protected static Logger log

 
Property Summary
ClassLoader groovyClassLoader

Map rootPackages

 
Constructor Summary
PackageHelper(ClassLoader groovyClassLoader)

 
Method Summary
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 Map initializePackages(ClassLoader groovyClassLoader)

static def mergeNewPackages(Collection packageNames, URL url, Map rootPackages)

void preferenceChange(PreferenceChangeEvent evt)

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

Field Detail

IMPORT_COMPLETION_PREFERENCE_KEY

public static final String IMPORT_COMPLETION_PREFERENCE_KEY


NAME_PATTERN

public static final Pattern NAME_PATTERN


log

protected static final Logger log


 
Property Detail

groovyClassLoader

ClassLoader groovyClassLoader


rootPackages

Map rootPackages


 
Constructor Detail

PackageHelper

PackageHelper(ClassLoader groovyClassLoader)


 
Method Detail

collectPackageNamesFromFolderRecursive

static Collection collectPackageNamesFromFolderRecursive(File directory, String prefix, Set packnames)
Crawls a folder, iterates over subfolders, looking for class files.
Parameters:
directory
prefix
packnames
Returns:


getClassnames

static Set getClassnames(Set urls, String packagename)
Copied from JLine 1.0 ClassNameCompletor
Parameters:
urls
packagename
Returns:


getContents

Set getContents(String packagename)
returns the names of Classes and direct subpackages contained in a package
Parameters:
packagename
Returns:


getPackageNames

static Collection getPackageNames(URL url)
Returns all packagenames found at URL, accepts jar files and folders
Parameters:
url
Returns:


getPackageNamesFromJar

static Collection getPackageNamesFromJar(JarFile jf)


initializePackages

static Map initializePackages(ClassLoader groovyClassLoader)


mergeNewPackages

static def mergeNewPackages(Collection packageNames, URL url, Map rootPackages)


preferenceChange

@Override
void preferenceChange(PreferenceChangeEvent evt)


 

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