Package | Description |
---|---|
net.bytebuddy.agent.builder |
An agent builder is used to easily implement load-time class-transformations using a Java agent.
|
net.bytebuddy.dynamic |
This package contains classes and interfaces that are connected to writing the byte stream that represents a Java
type that is dynamically created and for loading this type into a running JVM process.
|
net.bytebuddy.dynamic.scaffold |
This package contains helper types and implementations that are responsible for the actual writing of a byte array
representing a Java class.
|
net.bytebuddy.dynamic.scaffold.inline |
All classes and types in this package are related to creating a
DynamicType by
enhancing a given type. |
net.bytebuddy.implementation |
The implementation package contains any logic for intercepting method calls.
|
Modifier and Type | Class and Description |
---|---|
protected static class |
AgentBuilder.InitializationStrategy.SelfInjection.Dispatcher.InjectingInitializer
A type initializer that injects all auxiliary types of the instrumented type.
|
Constructor and Description |
---|
InjectingInitializer(TypeDescription instrumentedType,
Map<TypeDescription,byte[]> rawAuxiliaryTypes,
Map<TypeDescription,LoadedTypeInitializer> loadedTypeInitializers,
ClassInjector classInjector)
Creates a new injection initializer.
|
Modifier and Type | Field and Description |
---|---|
protected LoadedTypeInitializer |
DynamicType.Default.loadedTypeInitializer
The loaded type initializer for this dynamic type.
|
Modifier and Type | Method and Description |
---|---|
Map<TypeDescription,LoadedTypeInitializer> |
DynamicType.getLoadedTypeInitializers()
Returns a map of all loaded type initializers for the main type and all auxiliary types, if any.
|
Map<TypeDescription,LoadedTypeInitializer> |
DynamicType.Default.getLoadedTypeInitializers()
Returns a map of all loaded type initializers for the main type and all auxiliary types, if any.
|
Modifier and Type | Method and Description |
---|---|
DynamicType.Builder<T> |
DynamicType.Builder.initializer(LoadedTypeInitializer loadedTypeInitializer)
Executes the supplied loaded type initializer when loading the created instrumented type.
|
DynamicType.Builder<U> |
DynamicType.Builder.AbstractBase.Delegator.initializer(LoadedTypeInitializer loadedTypeInitializer)
Executes the supplied loaded type initializer when loading the created instrumented type.
|
DynamicType.Builder<U> |
DynamicType.Builder.AbstractBase.Adapter.initializer(LoadedTypeInitializer loadedTypeInitializer)
Executes the supplied loaded type initializer when loading the created instrumented type.
|
void |
NexusAccessor.register(String name,
ClassLoader classLoader,
int identification,
LoadedTypeInitializer loadedTypeInitializer)
Registers a loaded type initializer in Byte Buddy's
Nexus which is injected into the system class loader. |
void |
NexusAccessor.Dispatcher.register(String name,
ClassLoader classLoader,
ReferenceQueue<? super ClassLoader> referenceQueue,
int identification,
LoadedTypeInitializer loadedTypeInitializer)
Registers a type initializer with the system class loader's nexus.
|
void |
NexusAccessor.Dispatcher.Available.register(String name,
ClassLoader classLoader,
ReferenceQueue<? super ClassLoader> referenceQueue,
int identification,
LoadedTypeInitializer loadedTypeInitializer)
Registers a type initializer with the system class loader's nexus.
|
void |
NexusAccessor.Dispatcher.Unavailable.register(String name,
ClassLoader classLoader,
ReferenceQueue<? super ClassLoader> referenceQueue,
int identification,
LoadedTypeInitializer loadedTypeInitializer)
Registers a type initializer with the system class loader's nexus.
|
DynamicType.Builder<T> |
DynamicType.Builder.require(TypeDescription type,
byte[] binaryRepresentation,
LoadedTypeInitializer typeInitializer)
Explicitly requires another dynamic type for the creation of this type.
|
DynamicType.Builder<S> |
DynamicType.Builder.AbstractBase.require(TypeDescription type,
byte[] binaryRepresentation,
LoadedTypeInitializer typeInitializer)
Explicitly requires another dynamic type for the creation of this type.
|
Constructor and Description |
---|
Default(TypeDescription typeDescription,
byte[] binaryRepresentation,
LoadedTypeInitializer loadedTypeInitializer,
List<? extends DynamicType> auxiliaryTypes)
Creates a new dynamic type.
|
Loaded(TypeDescription typeDescription,
byte[] typeByte,
LoadedTypeInitializer loadedTypeInitializer,
List<? extends DynamicType> auxiliaryTypes,
Map<TypeDescription,Class<?>> loadedTypes)
Creates a new representation of a loaded dynamic type.
|
Unloaded(TypeDescription typeDescription,
byte[] binaryRepresentation,
LoadedTypeInitializer loadedTypeInitializer,
List<? extends DynamicType> auxiliaryTypes,
TypeResolutionStrategy.Resolved typeResolutionStrategy)
Creates a new unloaded representation of a dynamic type.
|
Modifier and Type | Field and Description |
---|---|
protected LoadedTypeInitializer |
TypeWriter.Default.loadedTypeInitializer
The loaded type initializer to apply onto the created type after loading.
|
Modifier and Type | Method and Description |
---|---|
LoadedTypeInitializer |
MethodRegistry.Prepared.getLoadedTypeInitializer()
Returns the loaded type initializer of the instrumented type.
|
LoadedTypeInitializer |
MethodRegistry.Compiled.getLoadedTypeInitializer()
Returns the loaded type initializer of the instrumented type.
|
LoadedTypeInitializer |
MethodRegistry.Default.Prepared.getLoadedTypeInitializer()
Returns the loaded type initializer of the instrumented type.
|
LoadedTypeInitializer |
MethodRegistry.Default.Compiled.getLoadedTypeInitializer()
Returns the loaded type initializer of the instrumented type.
|
LoadedTypeInitializer |
InstrumentedType.getLoadedTypeInitializer()
Returns the
LoadedTypeInitializer s that were registered
for this instrumented type. |
LoadedTypeInitializer |
InstrumentedType.Default.getLoadedTypeInitializer()
Returns the
LoadedTypeInitializer s that were registered
for this instrumented type. |
LoadedTypeInitializer |
InstrumentedType.Frozen.getLoadedTypeInitializer()
Returns the
LoadedTypeInitializer s that were registered
for this instrumented type. |
Modifier and Type | Method and Description |
---|---|
InstrumentedType |
InstrumentedType.withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the given
LoadedTypeInitializer . |
InstrumentedType.WithFlexibleName |
InstrumentedType.WithFlexibleName.withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the given
LoadedTypeInitializer . |
InstrumentedType.WithFlexibleName |
InstrumentedType.Default.withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the given
LoadedTypeInitializer . |
InstrumentedType.WithFlexibleName |
InstrumentedType.Frozen.withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the given
LoadedTypeInitializer . |
Constructor and Description |
---|
Compiled(TypeDescription instrumentedType,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
MethodList<?> methods,
LinkedHashMap<MethodDescription,MethodRegistry.Default.Compiled.Entry> implementations,
boolean supportsBridges)
Creates a new compiled version of a default method registry.
|
Default(String name,
int modifiers,
TypeDescription.Generic superClass,
List<? extends TypeVariableToken> typeVariables,
List<? extends TypeDescription.Generic> interfaceTypes,
List<? extends FieldDescription.Token> fieldTokens,
List<? extends MethodDescription.Token> methodTokens,
List<? extends RecordComponentDescription.Token> recordComponentTokens,
List<? extends AnnotationDescription> annotationDescriptions,
TypeInitializer typeInitializer,
LoadedTypeInitializer loadedTypeInitializer,
TypeDescription declaringType,
MethodDescription.InDefinedShape enclosingMethod,
TypeDescription enclosingType,
List<? extends TypeDescription> declaredTypes,
List<? extends TypeDescription> permittedSubclasses,
boolean anonymousClass,
boolean localClass,
boolean record,
TypeDescription nestHost,
List<? extends TypeDescription> nestMembers)
Creates a new instrumented type.
|
Default(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool)
Creates a new default type writer.
|
ForCreation(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.MethodPool methodPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool)
Creates a new default type writer for creating a new type that is not based on an existing class file.
|
ForInlining(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a new inlining type writer.
|
Frozen(TypeDescription typeDescription,
LoadedTypeInitializer loadedTypeInitializer)
Creates a new frozen representation of an instrumented type.
|
Prepared(LinkedHashMap<MethodDescription,MethodRegistry.Default.Prepared.Entry> implementations,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeDescription instrumentedType,
MethodGraph.Linked methodGraph,
MethodList<?> methods)
Creates a prepared version of a default method registry.
|
WithFullProcessing(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRegistry.Prepared methodRegistry,
Implementation.Target.Factory implementationTargetFactory,
MethodRebaseResolver methodRebaseResolver)
Creates a new inlining type writer that fully reprocesses a type.
|
Modifier and Type | Method and Description |
---|---|
DynamicType.Builder<T> |
DecoratingDynamicTypeBuilder.initializer(LoadedTypeInitializer loadedTypeInitializer)
Executes the supplied loaded type initializer when loading the created instrumented type.
|
Modifier and Type | Class and Description |
---|---|
static class |
LoadedTypeInitializer.Compound
A compound loaded type initializer that combines several type initializers.
|
static class |
LoadedTypeInitializer.ForStaticField
A type initializer for setting a value for a static field.
|
static class |
LoadedTypeInitializer.NoOp
A loaded type initializer that does not do anything.
|
Constructor and Description |
---|
Compound(LoadedTypeInitializer... loadedTypeInitializer)
Creates a new compound loaded type initializer.
|
Constructor and Description |
---|
Compound(List<? extends LoadedTypeInitializer> loadedTypeInitializers)
Creates a new compound loaded type initializer.
|
Copyright © 2014–2020. All rights reserved.