public class ResourceList extends Object
Utilities to list class resources (ie .class files) available from the classpath
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAllClasses(String classPathEntry,
boolean includeInternalClasses)
Given the target classpath entry (eg folder or jar file), return the names (eg foo.Foo) of all the classes (.class files)
inside
|
Set<String> |
getAllClasses(String classPathEntry,
String prefix,
boolean includeInternalClasses)
Given the target classpath entry (eg folder or jar file), return the names (eg foo.Foo) of all the classes (.class files)
inside
|
Set<String> |
getAllClasses(String classPathEntry,
String prefix,
boolean includeInternalClasses,
boolean excludeAnonymous)
Given the target classpath entry (eg folder or jar file), return the names (eg foo.Foo) of all the classes (.class files)
inside
|
InputStream |
getClassAsStream(String name) |
static String |
getClassNameFromResourcePath(String resource)
Given a resource path, eg foo/Foo.class, return the class name, eg foo.Foo
|
static ResourceList |
getInstance(ClassLoader classLoader) |
protected static String |
getParentPackageName(String className)
Remove last '.' token
|
boolean |
hasClass(String className)
is the target class among the ones in the SUT classpath?
|
boolean |
isClassAnInterface(String className) |
boolean |
isClassDeprecated(String className) |
boolean |
isClassTestable(String className) |
static boolean |
isInterface(String resource) |
static void |
resetAllCaches() |
void |
resetCache() |
public static ResourceList getInstance(ClassLoader classLoader)
public void resetCache()
public static void resetAllCaches()
public boolean hasClass(String className)
className - a fully qualified class namepublic InputStream getClassAsStream(String name)
name - a fully qualifying name, e.g. org.some.Foopublic Set<String> getAllClasses(String classPathEntry, boolean includeInternalClasses)
classPathEntry - includeInternalClasses - should internal classes (ie static and anonymous having $ in their name) be included?public Set<String> getAllClasses(String classPathEntry, String prefix, boolean includeInternalClasses)
classPathEntry - prefix - includeInternalClasses - should internal classes (ie static and anonymous having $ in their name) be included?public Set<String> getAllClasses(String classPathEntry, String prefix, boolean includeInternalClasses, boolean excludeAnonymous)
classPathEntry - prefix - includeInternalClasses - should internal classes (ie static and anonymous having $ in their name) be included?excludeAnonymous - if including internal classes, should though still exclude the anonymous? (ie keep only the static ones)public static boolean isInterface(String resource) throws IOException
IOExceptionpublic boolean isClassAnInterface(String className) throws IOException
IOExceptionpublic boolean isClassDeprecated(String className) throws IOException
IOExceptionpublic boolean isClassTestable(String className) throws IOException
IOExceptionpublic static String getClassNameFromResourcePath(String resource)
Given a resource path, eg foo/Foo.class, return the class name, eg foo.Foo
This method is able to handle different operating systems (Unix/Windows) and whether the resource is in a folder or inside a jar file ('/' separator independent of operating system).
Copyright © 2010–2017 EvoSuite. All rights reserved.