Class AgentBuilder.Transformer.ForAdvice.LazyDynamicType
java.lang.Object
net.bytebuddy.dynamic.DynamicType.AbstractBase
net.bytebuddy.agent.builder.AgentBuilder.Transformer.ForAdvice.LazyDynamicType
- All Implemented Interfaces:
Closeable, AutoCloseable, ClassFileLocator, DynamicType
- Enclosing class:
AgentBuilder.Transformer.ForAdvice
@Enhance
protected static class AgentBuilder.Transformer.ForAdvice.LazyDynamicType
extends DynamicType.AbstractBase
A lazy dynamic type that only loads a class file representation on demand.
-
Nested Class Summary
Nested classes/interfaces inherited from interface 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.SimpleNested classes/interfaces inherited from interface DynamicType
DynamicType.AbstractBase, DynamicType.Builder<T>, DynamicType.Default, DynamicType.Loaded<T>, DynamicType.Unloaded<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassFileLocatorThe class file locator to use.private final TypeDescriptionA description of the class to inject.Fields inherited from interface ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLazyDynamicType(TypeDescription typeDescription, ClassFileLocator classFileLocator) Creates a lazy dynamic type. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends DynamicType> Returns all auxiliary types of this dynamic type.byte[]getBytes()Returns a byte array representing this dynamic type.Returns the loaded type initializer of this dynamic type.Returns a description of this dynamic type.Methods inherited from class DynamicType.AbstractBase
close, getAllTypeDescriptions, getAllTypes, getAuxiliaryTypeDescriptions, getAuxiliaryTypes, getLoadedTypeInitializers, hasAliveLoadedTypeInitializers, inject, inject, locate, saveIn, toJar, toJar
-
Field Details
-
typeDescription
A description of the class to inject. -
classFileLocator
The class file locator to use.
-
-
Constructor Details
-
LazyDynamicType
Creates a lazy dynamic type.- Parameters:
typeDescription- A description of the class to inject.classFileLocator- The class file locator to use.
-
-
Method Details
-
getTypeDescription
Returns a description of this dynamic type.
Note: This description will most likely differ from the binary representation of this type. Normally, annotations and intercepted methods are not added to this type description.
- Returns:
- A description of this dynamic type.
-
getBytes
public byte[] getBytes()Returns a byte array representing this dynamic type. This byte array might be reused by this dynamic type and must therefore not be altered.- Returns:
- A byte array of the type's binary representation.
-
getAuxiliaries
Returns all auxiliary types of this dynamic type.- Returns:
- A list of all auxiliary types of this dynamic type.
-
getLoadedTypeInitializer
Returns the loaded type initializer of this dynamic type.- Returns:
- The loaded type initializer of this dynamic type.
-