Package net.bytebuddy.dynamic
Class ClassFileLocator.MultiReleaseAware
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.MultiReleaseAware
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassFileLocator
- Direct Known Subclasses:
ClassFileLocator.ForFolder
,ClassFileLocator.ForJarFile
- Enclosing interface:
ClassFileLocator
@Enhance
public abstract static class ClassFileLocator.MultiReleaseAware
extends Object
implements ClassFileLocator
A class file locator that is aware of multi-release JAR file semantics.
-
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.MultiReleaseAware, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The property name of a multi-release JAR file.protected static final int[]
Indicates that no multi-release versions exist.private final int[]
Contains the existing multi-release jar folders that are available for the current JVM version in decreasing order.Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MultiReleaseAware
(int[] version) Creates a multi-release aware class file locator. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract byte[]
Resolves a possible multi-release entry, if it exists.Locates the class file for a given type and returns the binary data of the class file.
-
Field Details
-
MULTI_RELEASE_ATTRIBUTE
The property name of a multi-release JAR file.- See Also:
-
NO_MULTI_RELEASE
protected static final int[] NO_MULTI_RELEASEIndicates that no multi-release versions exist. -
version
private final int[] versionContains the existing multi-release jar folders that are available for the current JVM version in decreasing order.
-
-
Constructor Details
-
MultiReleaseAware
protected MultiReleaseAware(int[] version) Creates a multi-release aware class file locator.- Parameters:
version
- Contains the existing multi-release jar folders that are available for the current JVM version in decreasing order.
-
-
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.
-
doLocate
Resolves a possible multi-release entry, if it exists.- Parameters:
path
- The path of the class file.- Returns:
- The class file's binary representation or
null
if it does not exist. - Throws:
IOException
- If an I/O exception occurs.
-