Package net.bytebuddy.dynamic
Class ClassFileLocator.ForFolder
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.ForFolder
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassFileLocator
- Enclosing interface:
ClassFileLocator
A class file locator that finds files from a standardized Java folder structure with
folders donating packages and class files being saved as
<classname>.class
files
within their package folder.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator
ClassFileLocator.Compound, ClassFileLocator.Filtering, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForInstrumentation, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
-
Field Summary
FieldsFields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Locates the class file for a given type and returns the binary data of the class file.
-
Field Details
-
folder
The base folder of the package structure.
-
-
Constructor Details
-
ForFolder
Creates a new class file locator for a folder structure of class files.- Parameters:
folder
- The base folder of the package structure.
-
-
Method Details
-
locate
Locates the class file for a given type and returns the binary data of the class file.- Specified by:
locate
in interfaceClassFileLocator
- Parameters:
name
- The name of the type to locate a class file representation for.- Returns:
- Any binary representation of the type which might be illegal.
- Throws:
IOException
- If reading a class file causes an error.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-