Package net.bytebuddy.asm
@ByDefault
package net.bytebuddy.asm
The ASM package contains classes that are meant for direct interaction with the ASM API.
-
ClassDescriptionAdvice wrappers copy the code of blueprint methods to be executed before and/or after a matched method.A method visitor that weaves the advice methods' byte codes.An advice visitor that applies exit advice.An advice visitor that captures exceptions by weaving try-catch blocks around user code.An advice visitor that does not capture exceptions.An advice visitor that does not apply exit advice.Assigns an array containing all arguments of the instrumented method to the annotated parameter.A byte code appender for implementing
Advice
.A method visitor that allows for the emulation of a full method visitor invocation circle without delegating initial and ending visitations to the underlying visitor.Indicates that the annotated parameter should be mapped to the parameter with indexAdvice.Argument.value()
of the instrumented method.An argument handler is responsible for resolving offsets of the local variable array in the context of the applied instrumentation.A factory for creating an argument handler.An argument handler that is used for resolving an advice method.A default implementation for an argument handler for an advice method.An argument handler for an enter advice method.An argument handler for an exit advice method.An argument handler that is used for resolving the instrumented method.A default implementation of an argument handler for an instrumented method.An argument handler for an instrumented method that copies all arguments before executing the instrumented method.A simple argument handler for an instrumented method.A post processor that uses the return value of an advice method to define values for fields, arguments, the instrumented method's return value or the exception being thrown.Indicates that the advice method's return value is to be treated as a scalar value also if it is of an array type.A stack manipulation that applies a null-check on the returned value which indicates if an assignment should be skipped, if discovered.A dispatcher for skipping a default value.An exception handler to handle exceptions during assignment.A factory for wrapping an assignment with an exception handler, if appropriate.A factory that creates an exception handler for a given exception type.A non-operational factory that does not produce an exception handler.A factory to create aAdvice.AssignReturned
post processor.A post processor implementation ofAdvice.AssignReturned
that works on the value of an array.A post processor implementation ofAdvice.AssignReturned
that uses the returned value as such.A handler for anAdvice.AssignReturned
post processor to assign a value that was returned by advice to a value of the instrumented method.Advice.AssignReturned.Handler.Factory<T extends Annotation>A factory for resolving a handler for a given advice method.A simple implementation of aAdvice.AssignReturned.Handler.Factory
that resolves a given list ofAdvice.AssignReturned.Handler
s.Assigns the advice method's return value as an array to a number of arguments which are returned as an array where each element assigns a single value with the same index as the instrumented method's parameter.A handler for aAdvice.AssignReturned.ToAllArguments
annotation.A factory to create a handler for aAdvice.AssignReturned.ToAllArguments
annotation.Assigns the advice method's return value to an argument of the instrumented method of the given index.A handler for aAdvice.AssignReturned.ToArguments.ToArgument
annotation.A factory to create a handler for aAdvice.AssignReturned.ToArguments
annotation.Defines a particular assignment for aAdvice.AssignReturned.ToArguments
.Assigns the advice method's return value to a given field.A handler for aAdvice.AssignReturned.ToFields.ToField
annotation.A factory to create a handler for aAdvice.AssignReturned.ToFields
annotation.Determines what fields are assigned when using aAdvice.AssignReturned.ToFields
annotation.Assigns the advice method's return value to the instrumented method's return value.A handler for aAdvice.AssignReturned.ToReturned
annotation.A factory to create a handler for aAdvice.AssignReturned.ToReturned
annotation.Assigns the advice method's return value to thethis
reference of the instrumented method.A handler for theAdvice.AssignReturned.ToThis
annotation.A handler factory for theAdvice.AssignReturned.ToThis
annotation which assigns an advice method's return value to the this reference of a non-static method.Assigns the advice method's return value to the instrumented method's return value.A handler for aAdvice.AssignReturned.ToThrown
annotation.A factory to create a handler for aAdvice.AssignReturned.ToThrown
annotation.Materializes an advice invocation within a delegation.Invokes an advice method using a dynamic method call.Invokes an advice method using a static method call.A dispatcher for implementing advice.A bound resolution of an advice method.A dispatcher for an advice method that is being invoked from the instrumented method.A resolved version of a dispatcher.A bound advice method that copies the code by first extracting the exception table and later appending the code of the method without copying any meta data.An advice method writer for a method enter.An advice method writer for a method exit.A resolved dispatcher for implementing method enter advice.Implementation of an advice that does not expose an enter type.Implementation of an advice that does expose an enter type.A resolved dispatcher for implementing method exit advice.Implementation of exit advice that handles exceptions.Implementation of exit advice that ignores exceptions.An implementation for inactive devise that does not write any byte code.A dispatcher for an advice method that is being inlined into the instrumented method.A visitor for translating an advice method's byte code for inlining into the instrumented method.A resolved version of a dispatcher.A resolved dispatcher for implementing method enter advice.Implementation of an advice that does not expose an enter type.Implementation of an advice that does expose an enter type.A resolved dispatcher for implementing method exit advice.Implementation of exit advice that handles exceptions.Implementation of exit advice that ignores exceptions.A relocation handler is responsible for chaining the usual control flow of an instrumented method.A boundAdvice.Dispatcher.RelocationHandler
.A disabled relocation handler that does never trigger a relocation.A relocation handler that is triggered if the checked value is an instance of a given type.A relocation handler that triggers a relocation for a default or non-default value.A relocator is responsible for triggering a relocation if a relocation handler triggers a relocating condition.A relocation that unconditionally jumps to a given label.Represents a resolved dispatcher.An abstract base implementation of aAdvice.Dispatcher.Resolved
dispatcher.Represents a resolved dispatcher for entering a method.Represents a resolved dispatcher for exiting a method.A suppression handler for optionally suppressing exceptions.A bound version of a suppression handler that must not be reused.A non-operational suppression handler that does not suppress any method.A suppression handler that suppresses a given throwable type.An active, bound suppression handler.A dispatcher that is not yet resolved.Indicates that the annotated parameter should be mapped to the value that is returned by the advice method that is annotated byAdvice.OnMethodEnter
.An exception handler is responsible for providing byte code for handling an exception thrown from a suppressing advice method.Default implementations for commonly used exception handlers.A simple exception handler that returns a fixed stack manipulation.Indicates that the annotated parameter should be mapped to the value that is returned by the advice method that is annotated byAdvice.OnMethodExit
.Indicates that the annotated parameter should be mapped to a field in the scope of the instrumented method.Declares the annotated parameter as a local variable that is created by Byte Buddy for the instrumented method.A handler for computing the instrumented method's size.A default implementation for a method size handler.A method size handler that expects that the original arguments were copied.A method size handler that expects that the original arguments are retained.A method size handler for an advice method.A method size handler for the instrumented method.A non-operational method size handler.A marker class that indicates that an advice method does not suppress anyThrowable
.Represents an offset mapping for an advice method to an alternative offset.Advice.OffsetMapping.Factory<T extends Annotation>Represents a factory for creating aAdvice.OffsetMapping
for a given parameter for a given annotation.Describes the type of advice being applied.Advice.OffsetMapping.Factory.Illegal<T extends Annotation>A factory for an annotation whose use is not permitted.Advice.OffsetMapping.Factory.Simple<T extends Annotation>A simple factory that binds a constant offset mapping.An offset mapping that maps an array containing all arguments of the instrumented method.A factory for an offset mapping that maps all arguments values of the instrumented method.An offset mapping for a given parameter of the instrumented method.An offset mapping for a specific parameter of the instrumented method.A factory for a parameter argument of the instrumented method.An offset mapping for a parameter of the instrumented method with a specific index.A factory for a mapping of a parameter of the instrumented method.An offset mapping that provides access to the value that is returned by the enter advice.A factory for creating aAdvice.OffsetMapping.ForEnterValue
offset mapping.An offset mapping that provides access to the value that is returned by the exit advice.A factory for creating aAdvice.OffsetMapping.ForExitValue
offset mapping.An offset mapping for a field.A binding for an offset mapping that represents a specific field.A factory that binds a field.An offset mapping for a field that is resolved from the instrumented type by its name.A factory for aAdvice.OffsetMapping.ForField.Unresolved
offset mapping.An offset mapping for a field with an explicit declaring type.An offset mapping for a field with an implicit declaring type.Maps a constant representing the instrumented method.Maps the declaring type of the instrumented method.An offset mapping that provides access to a named local variable that is declared by the advice methods viaAdvice.Local
.A factory for an offset mapping for a local variable that is declared by the advice methods viaAdvice.Local
.An offset mapping for theAdvice.Origin
annotation.A factory for a method origin.A renderer for an origin pattern element.A renderer for a constant value.A renderer for a method descriptor.A renderer for a method's Java signature in binary form.A renderer for a method's internal name.A renderer for a property name.A renderer for a method's return type in binary form.A renderer for a method'sObject.toString()
representation.A renderer for a method declaring type's binary name.An offset mapping that provides access to the value that is returned by the instrumented method.A factory for creating aAdvice.OffsetMapping.ForReturnValue
offset mapping.An offset mapping that loads a serialized value.A factory for loading a deserialized value.An offset mapping for binding a stack manipulation.A factory that binds a stack manipulation.A factory for binding an annotation's property.A factory for binding the annotated parameter's default value.Uses dynamic method invocation for binding an annotated parameter to a value.An offset mapping for a parameter where assignments are fully ignored and that is assigned a boxed version of the instrumented method's return value ornull
if the return type is not primitive orvoid
.An offset mapping that provides access to thethis
reference of the instrumented method.A factory for creating aAdvice.OffsetMapping.ForThisReference
offset mapping.An offset mapping for accessing aThrowable
of the instrumented method.A factory for accessing an exception that was thrown by the instrumented method.An offset mapping for a parameter where assignments are fully ignored and that always return the parameter type's default value.A factory for an offset mapping for an unused value.Describes the sort of the executed advice.A target offset of an offset mapping.An adapter class for a target that only can be read.A target mapping for an array of all local variables.A target mapping for a read-only target mapping for an array of local variables.A target mapping for a writable target mapping for an array of local variables.A target for an offset mapping that represents a non-operational value.A read-only target for a default value.A read-write target for a default value.A target for an offset mapping that loads a field value.A read-only mapping for a field value.A mapping for a writable field.A target for an offset mapping that represents a read-only stack manipulation.A constant value that can be written to.A target for an offset mapping that represents a local variable.A target for a read-only mapping of a local variable.A target for a writable mapping of a local variable.A marker type to be used as an argument forAdvice.OnMethodEnter.skipOn()
.Indicates that this method should be inlined before the matched method is invoked.Indicates that this method should be executed before exiting the instrumented method.A marker type to be used as an argument forAdvice.OnMethodEnter.skipOn()
.Indicates that the annotated parameter should be mapped to a string representation of the instrumented method, a constant representing theClass
declaring the adviced method or aMethod
,Constructor
orjava.lang.reflect.Executable
representing this method.A post processor for advice methods that is invoked after advice is executed.A compound post processor.A factory for creating aAdvice.PostProcessor
.A compound factory for a post processor.A non-operational advice post processor.Indicates that the annotated parameter should be mapped to the return value of the instrumented method.A handler for computing and translating stack map frames.A default implementation of a stack map frame handler for an instrumented method.Represents the initialization state of a stack value that can either be initialized or uninitialized.A translation mode that determines how the fixed frames of the instrumented method are written.A trivial stack map frame handler that applies a trivial translation for the instrumented method's stack map frames.A stack map frame handler that requires the original arguments of the instrumented method to be preserved in their original form.A stack map frame handler that expects that an argument copy of the original method arguments was made.A stack map frame handler that expects that the original argument frames remain preserved throughout the original invocation.A stack map frame handler for an advice method.A stack map frame handler for an instrumented method.A stack map frame handler that can be used within a post processor.A non-operational stack map frame handler.Indicates that the annotated parameter should always return a default a boxed version of the instrumented methods return value (i.e.Indicates that the annotated parameter should be mapped to thethis
reference of the instrumented method.Indicates that the annotated parameter should be mapped to theThrowable
thrown by the instrumented method or tonull
if the method returned regularly.Indicates that the annotated parameter should always return a default value (i.e.A builder step for creating anAdvice
that uses custom mappings of annotations to constant pool values.A class visitor wrapper is used in order to register an intermediate ASMClassVisitor
which is applied to the main type created by aDynamicType.Builder
but not to anyAuxiliaryType
s, if any.An abstract base implementation of an ASM visitor wrapper that does not set any flags.An ordered, immutable chain ofAsmVisitorWrapper
s.An ASM visitor wrapper that allows to wrap declared fields of the instrumented type with aAsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper
.An entry describing a field visitor wrapper paired with a matcher for fields to be wrapped.A field visitor wrapper that allows for wrapping aFieldVisitor
defining a declared field.An ASM visitor wrapper that allows to wrap declared methods of the instrumented type with aAsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper
.An entry describing a method visitor wrapper paired with a matcher for fields to be wrapped.A method visitor wrapper that allows for wrapping aMethodVisitor
defining a declared method.A class visitor wrapper that does not apply any changes.A visitor that adds attributes to a class member.A visitor that adds attributes to a field.A field visitor to apply an field attribute appender.A visitor that adds attributes to a method.A method visitor to apply a method attribute appender.A visitor wrapper that removes fields or methods that match a givenElementMatcher
.A class visitor that removes members based on element matchers.Substitutes field access or method invocations within a method's body.A replacement combines aMemberSubstitution.Substitution
and a way of choosing if this substitution should be applied for a discovered member.A binding for a replacement of a field or method access within another method.A binding that was resolved for an actual substitution.An unresolved binding.A factory for creating a replacement for an instrumented method.A compound factory.A replacement that substitutes a member based on a row of element matchers.A factory for creating a replacement that chooses members based on a row of element matchers.A replacement that only resolves the first matching replacement of a list of replacements.Describes a method invocation type.A non-operational replacement.A method visitor that applies a substitution for matched methods.A substitution replaces or enhances an interaction with a field or method within an instrumented method.A substitution chain allows for chaining multiple substitution steps for a byte code element being replaced.A factory for creating a substitution chain.Represents a step of a substitution chain.Resolves a substitution for an instrumented method.A resolved substitution step.A simple substitution step within a substitution chain.A factory for creating a substitution for an instrumented method.A substitution with a field access.A method resolver for locating a field for a substitute.A field matcher that resolves a non-static field on the first parameter type of the substituted member usage.A simple field resolver that returns a specific field.A factory for a substitution that substitutes with a given field.A factory for a substitution that locates a field on the receiver type using a matcher.A substitution with a method invocation.A method resolver for locating a method for a substitute.A method resolver that locates a non-static method by locating it from the receiver type.A simple method resolver that returns a given method.A factory for a substitution that invokes a given method.A factory for a substitution that invokes the instrumented method.A factory for a substitution that locates a method on the receiver type using a matcher.A substitution that drops any field or method access and returns the expected return type's default value, i.enull
or zero for primitive types.A type pool resolver is responsible for resolving aTypePool
for locating substituted members.A type pool resolver that resolves the implicit pool but additionally checks another class file locator.A type pool resolver that returns a specific type pool.Returns the implicit type pool.A member substitution that lacks a specification for how to substitute the matched members references within a method body.Describes a member substitution that requires a specification for how to replace a byte code element.Describes a member substitution that requires a specification for how to replace a field.Describes a member substitution that requires a specification for how to replace a method or constructor.A visitor wrapper that adjusts the modifiers of the instrumented type or its members.A description of a conditional adjustment.A class visitor that enforces a collection of modifier adjustments.This class visitor wrapper ensures that class files of a version previous to Java 5 do not store class entries in the generated class's constant pool.A class visitor that checks a class file version for its support of storing class constants in the constant pool and remaps such constants on discovery if that is not the case.A method visitor that remaps class constants to invocations ofClass.forName(String)
.Adds an attribute value for all inner classes that are referenced by the instrumented type.A class visitor that collects all type references and all inner class references.