@Beta public final class ClassPath extends Object
ClassLoader
and finds all the classes loadable.Modifier and Type | Class and Description |
---|---|
static class |
ClassPath.ClassInfo
Represents a class that can be loaded through
ClassPath.ClassInfo.load() . |
Modifier and Type | Method and Description |
---|---|
static ClassPath |
from(ClassLoader classloader)
Returns a
ClassPath representing all classes loadable from classloader and its
parent class loaders. |
ImmutableSet<ClassPath.ClassInfo> |
getTopLevelClasses()
Returns all top level classes loadable from the current class path.
|
ImmutableSet<ClassPath.ClassInfo> |
getTopLevelClasses(String packageName)
Returns all top level classes whose package name is
packageName . |
ImmutableSet<ClassPath.ClassInfo> |
getTopLevelClassesRecursive(String packageName)
Returns all top level classes whose package name is
packageName or starts with
packageName followed by a '.'. |
public static ClassPath from(ClassLoader classloader) throws IOException
ClassPath
representing all classes loadable from classloader
and its
parent class loaders.
Currently only URLClassLoader
and only file://
urls are supported.
IOException
- if the attempt to read class path resources (jar files or directories)
failed.public ImmutableSet<ClassPath.ClassInfo> getTopLevelClasses()
public ImmutableSet<ClassPath.ClassInfo> getTopLevelClasses(String packageName)
packageName
.public ImmutableSet<ClassPath.ClassInfo> getTopLevelClassesRecursive(String packageName)
packageName
or starts with
packageName
followed by a '.'.Copyright © 2010-2012. All Rights Reserved.