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.
- Author:
- Kasra Faghihi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClasspath(List<File> classpath) Add classes contained within a list of JAR files and folders.voidaddIndividual(String className, ClassInformation classInformation) Add a custom class.Constructs aFileSystemClassInformationRepositoryobject and loads it up with the classes in a classpath.getInformation(String internalClassName) Get information for a class.
-
Constructor Details
-
FileSystemClassInformationRepository
public FileSystemClassInformationRepository()
-
-
Method Details
-
create
public static FileSystemClassInformationRepository create(List<File> initialClasspath) throws IOException Constructs aFileSystemClassInformationRepositoryobject 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
FileSystemClassInformationRepositoryobject - Throws:
NullPointerException- if any argument isnullor containsnullelementsIOException- if an IO error occurs
-
getInformation
Description copied from interface:ClassInformationRepositoryGet 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:
getInformationin interfaceClassInformationRepository- Parameters:
internalClassName- internal class name- Returns:
- information for that class, or
nullif not found
-
addIndividual
Add a custom class.- Parameters:
className- name of classclassInformation- information for class- Throws:
NullPointerException- if any argument isnullIllegalArgumentException- ifclassNamealready 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 isnullor containsnullelementsIOException- if an IO error occurs
-