Class FileSystemClassInformationRepository
java.lang.Object
com.offbynull.coroutines.instrumenter.asm.FileSystemClassInformationRepository
- All Implemented Interfaces:
ClassInformationRepository
public final class FileSystemClassInformationRepository
extends Object
implements ClassInformationRepository
Provides information on classes contained within JARs and folders.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClasspath
(List<File> classpath) Add classes contained within a list of JAR files and folders.private void
addDirectory
(File directory) void
addIndividual
(String className, ClassInformation classInformation) Add a custom class.private void
Constructs aFileSystemClassInformationRepository
object and loads it up with the classes in a classpath.getInformation
(String internalClassName) Get information for a class.private void
-
Field Details
-
hierarchyMap
-
-
Constructor Details
-
FileSystemClassInformationRepository
public FileSystemClassInformationRepository()
-
-
Method Details
-
create
public static FileSystemClassInformationRepository create(List<File> initialClasspath) throws IOException Constructs aFileSystemClassInformationRepository
object and loads it up with the classes in a classpath.- Parameters:
initialClasspath
- classpath to scan for class information (can be JAR files and/or folders)- Returns:
- newly created
FileSystemClassInformationRepository
object - Throws:
NullPointerException
- if any argument isnull
or containsnull
elementsIOException
- if an IO error occurs
-
getInformation
Description copied from interface:ClassInformationRepository
Get information for a class.This method returns class information as if it were encountered in a class file. In a class file, if the class is an interface, then its superclass is set to
Object
. Note that this is different from whatClass.getSuperclass()
returns when the class represents an interface (it returnsnull
).- Specified by:
getInformation
in interfaceClassInformationRepository
- Parameters:
internalClassName
- internal class name- Returns:
- information for that class, or
null
if not found
-
addIndividual
Add a custom class.- Parameters:
className
- name of classclassInformation
- information for class- Throws:
NullPointerException
- if any argument isnull
IllegalArgumentException
- ifclassName
already exists in this repository
-
addClasspath
Add classes contained within a list of JAR files and folders. Note that if a duplicate class is encountered, the original is kept.- Parameters:
classpath
- list of JARs and folders to scan- Throws:
NullPointerException
- if any argument isnull
or containsnull
elementsIOException
- if an IO error occurs
-
addDirectory
- Throws:
IOException
-
addJar
- Throws:
IOException
-
populateSuperClassMapping
- Throws:
IOException
-