Interface ClassFileLocator
- All Superinterfaces:
AutoCloseable, Closeable
- All Known Subinterfaces:
DynamicType, DynamicType.Loaded<T>, DynamicType.Unloaded<T>
- All Known Implementing Classes:
AgentBuilder.Transformer.ForAdvice.LazyDynamicType, ClassFileLocator.Compound, ClassFileLocator.Filtering, ClassFileLocator.ForClassLoader, ClassFileLocator.ForClassLoader.WeaklyReferenced, ClassFileLocator.ForFolder, ClassFileLocator.ForInstrumentation, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModule.WeaklyReferenced, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.MultiReleaseAware, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Simple, DynamicType.AbstractBase, DynamicType.Default, DynamicType.Default.Loaded, DynamicType.Default.Unloaded, Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
Locates a class file or its byte array representation when it is given its type description.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA compoundClassFileLocatorthat chains several locators.static classA class file locator that only applies for matched names.static classA class file locator that queries a class loader for binary representations of class files.static classA 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 classA Java agent that allows the location of class files by emulating a retransformation.static classA class file locator that locates classes within a Java jar file.static classA class file locator that locates class files by querying a Java module'sgetResourceAsStreammethod.static classA class file locator that locates classes within a Java jmod file.static classA class file locator that reads class files from one or several URLs.static classA class file locator that is aware of multi-release JAR file semantics.static enumA class file locator that cannot locate any class files.static classA class file locator that discriminates by a type's package.static interfaceRepresents a class file as binary data.static classA simple class file locator that returns class files from a selection of given types. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionLocates the class file for a given type and returns the binary data of the class file.
-
Field Details
-
CLASS_FILE_EXTENSION
-
META_INF_VERSIONS
The prefix folder forMETA-INF/versions/which contains multi-release files.- See Also:
-
-
Method Details
-
locate
Locates the class file for a given type and returns the binary data of the class file.- 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.
-