Class DynamicType.Default
java.lang.Object
net.bytebuddy.dynamic.DynamicType.AbstractBase
net.bytebuddy.dynamic.DynamicType.Default
- All Implemented Interfaces:
Closeable, AutoCloseable, ClassFileLocator, DynamicType
- Direct Known Subclasses:
DynamicType.Default.Loaded, DynamicType.Default.Unloaded
- Enclosing interface:
DynamicType
A default implementation of a dynamic type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA default implementation of a loaded dynamic type.static classA default implementation of an unloaded dynamic type.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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<? extends DynamicType> A list of auxiliary types for this dynamic type.protected final byte[]The byte array representing this dynamic type.protected final LoadedTypeInitializerThe loaded type initializer for this dynamic type.protected final TypeDescriptionA type description of this dynamic type.Fields inherited from interface ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS -
Constructor Summary
ConstructorsConstructorDescriptionDefault(TypeDescription typeDescription, byte[] binaryRepresentation, LoadedTypeInitializer loadedTypeInitializer, List<? extends DynamicType> auxiliaryTypes) Creates a new 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 type description of this dynamic type. -
binaryRepresentation
protected final byte[] binaryRepresentationThe byte array representing this dynamic type. -
loadedTypeInitializer
The loaded type initializer for this dynamic type. -
auxiliaryTypes
A list of auxiliary types for this dynamic type.
-
-
Constructor Details
-
Default
public Default(TypeDescription typeDescription, byte[] binaryRepresentation, LoadedTypeInitializer loadedTypeInitializer, List<? extends DynamicType> auxiliaryTypes) Creates a new dynamic type.- Parameters:
typeDescription- A description of this dynamic type.binaryRepresentation- A byte array containing the binary representation of this dynamic type. The array must not be modified.loadedTypeInitializer- The loaded type initializer of this dynamic type.auxiliaryTypes- The auxiliary type required for this dynamic type.
-
-
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.
-
getLoadedTypeInitializer
Returns the loaded type initializer of this dynamic type.- Returns:
- The loaded type initializer of this dynamic type.
-
getAuxiliaries
Returns all auxiliary types of this dynamic type.- Returns:
- A list of all auxiliary types of this dynamic type.
-