Package net.bytebuddy.dynamic
Interface ClassFileLocator
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
ClassFileLocator.AgentBased,ClassFileLocator.Compound,ClassFileLocator.ForClassLoader,ClassFileLocator.ForClassLoader.WeaklyReferenced,ClassFileLocator.ForFolder,ClassFileLocator.ForJarFile,ClassFileLocator.ForModule,ClassFileLocator.ForModule.WeaklyReferenced,ClassFileLocator.ForModuleFile,ClassFileLocator.NoOp,ClassFileLocator.PackageDiscriminating,ClassFileLocator.Simple
public interface ClassFileLocator extends java.io.CloseableLocates a class file or its byte array representation when it is given its type description.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classClassFileLocator.AgentBasedA Java agent that allows the location of class files by emulating a retransformation.static classClassFileLocator.CompoundA compoundClassFileLocatorthat chains several locators.static classClassFileLocator.ForClassLoaderA class file locator that queries a class loader for binary representations of class files.static classClassFileLocator.ForFolderA class file locator that finds files from a standardized Java folder structure with folders donating packages and class files being saved as<classname>.classfiles within their package folder.static classClassFileLocator.ForJarFileA class file locator that locates classes within a Java jar file.static classClassFileLocator.ForModuleA class file locator that locates class files by querying a Java module'sgetResourceAsStreammethod.static classClassFileLocator.ForModuleFileA class file locator that locates classes within a Java jmod file.static classClassFileLocator.NoOpA class file locator that cannot locate any class files.static classClassFileLocator.PackageDiscriminatingA class file locator that discriminates by a type's package.static interfaceClassFileLocator.ResolutionRepresents a class file as binary data.static classClassFileLocator.SimpleA simple class file locator that returns class files from a selection of given types.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLASS_FILE_EXTENSIONThe file extension for a Java class file.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassFileLocator.Resolutionlocate(java.lang.String typeName)Locates the class file for a given type and returns the binary data of the class file.
-
-
-
Field Detail
-
CLASS_FILE_EXTENSION
static final java.lang.String CLASS_FILE_EXTENSION
The file extension for a Java class file.- See Also:
- Constant Field Values
-
-
Method Detail
-
locate
ClassFileLocator.Resolution locate(java.lang.String typeName) throws java.io.IOException
Locates the class file for a given type and returns the binary data of the class file.- Parameters:
typeName- The name of the type to locate a class file representation for.- Returns:
- Any binary representation of the type which might be illegal.
- Throws:
java.io.IOException- If reading a class file causes an error.
-
-