Package net.bytebuddy.agent.builder
Class AgentBuilder.Transformer.ForAdvice.LazyDynamicType
- java.lang.Object
-
- net.bytebuddy.dynamic.DynamicType.AbstractBase
-
- net.bytebuddy.agent.builder.AgentBuilder.Transformer.ForAdvice.LazyDynamicType
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.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 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
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType
DynamicType.AbstractBase, DynamicType.Builder<T>, DynamicType.Default, DynamicType.Loaded<T>, DynamicType.Unloaded<T>
-
-
Field Summary
Fields Modifier and Type Field Description private ClassFileLocator
classFileLocator
The class file locator to use.private TypeDescription
typeDescription
A description of the class to inject.-
Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
META_INF_VERSIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LazyDynamicType(TypeDescription typeDescription, ClassFileLocator classFileLocator)
Creates a lazy dynamic type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<? extends DynamicType>
getAuxiliaries()
Returns all auxiliary types of this dynamic type.byte[]
getBytes()
Returns a byte array representing this dynamic type.LoadedTypeInitializer
getLoadedTypeInitializer()
Returns the loaded type initializer of this dynamic type.TypeDescription
getTypeDescription()
Returns a description of this dynamic type.-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.AbstractBase
close, getAllTypeDescriptions, getAllTypes, getAuxiliaryTypeDescriptions, getAuxiliaryTypes, getLoadedTypeInitializers, hasAliveLoadedTypeInitializers, inject, inject, locate, saveIn, toJar, toJar
-
-
-
-
Field Detail
-
typeDescription
private final TypeDescription typeDescription
A description of the class to inject.
-
classFileLocator
private final ClassFileLocator classFileLocator
The class file locator to use.
-
-
Constructor Detail
-
LazyDynamicType
protected LazyDynamicType(TypeDescription typeDescription, ClassFileLocator classFileLocator)
Creates a lazy dynamic type.- Parameters:
typeDescription
- A description of the class to inject.classFileLocator
- The class file locator to use.
-
-
Method Detail
-
getTypeDescription
public TypeDescription 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
public java.util.List<? extends DynamicType> getAuxiliaries()
Returns all auxiliary types of this dynamic type.- Returns:
- A list of all auxiliary types of this dynamic type.
-
getLoadedTypeInitializer
public LoadedTypeInitializer getLoadedTypeInitializer()
Returns the loaded type initializer of this dynamic type.- Returns:
- The loaded type initializer of this dynamic type.
-
-