Class Digger
java.lang.Object
clazzfish.core.Digger
- Direct Known Subclasses:
ClasspathDigger
The Class Digger was extracted from ClasspathDigger and
ResourcepathDigger. It is intended to pull up common code of both
classes into this class to avoid code duplicates.
For later it is planned to derive ClasspathDigger from ResourepathDigger (the other way around at now), because a class can be considered as specialized resource (resource with suffix ".class").
Originally this class was part of the PatternTesting project.
- Author:
- oboehm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Digs into the classpath and returns the found classes.String[]Gets the classpath using theClasspathInspector.Digs into the classpath and returns the found classes together with the URI of the classpath where the class belongs to.String[]Shadowed classes are classes which are more than once in the classpath and which are shadowed by another class.static Collection<String> readElementsFromNestedArchive(File archive) Read elements from nested archive.static StringresourceToClass(String name) Converts a resource (e.g.
-
Constructor Details
-
Digger
public Digger() -
Digger
-
-
Method Details
-
resourceToClass
-
getClasspath
Gets the classpath using theClasspathInspector.- Returns:
- the classpath
-
getLoadedClassnames
-
getClasses
Digs into the classpath and returns the found classes.NOTE: This logic was formerly part of ClasspathDigger in the monitor module.
- Returns:
- classes of the classpath
-
getClassRecords
Digs into the classpath and returns the found classes together with the URI of the classpath where the class belongs to. Shaded classes (seegetShadedRecords()) are not part of the returned set.- Returns:
- classes of the classpath (without shadowed classes)
-
getShadedRecords
Shadowed classes are classes which are more than once in the classpath and which are shadowed by another class. I.e. these are classes which are on position 2 (or higher) in the classpath which will be never loaded by the classloader.- Returns:
- set of shadowed classes
-
readElementsFromNestedArchive
Read elements from nested archive.- Parameters:
archive- a JAR, WAR or EAR archive- Returns:
- the digged resources
- Throws:
IOException- Signals that an I/O exception has occurred.
-