Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForArgument.Resolved.Factory<T extends Annotation>
java.lang.Object
net.bytebuddy.asm.Advice.OffsetMapping.ForArgument.Resolved.Factory<T>
- Type Parameters:
T- The type of the bound annotation.
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<T>
- Enclosing class:
Advice.OffsetMapping.ForArgument.Resolved
@Enhance
public static class Advice.OffsetMapping.ForArgument.Resolved.Factory<T extends Annotation>
extends Object
implements Advice.OffsetMapping.Factory<T>
A factory for a parameter argument of the instrumented method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.OffsetMapping.Factory
Advice.OffsetMapping.Factory.AdviceType, Advice.OffsetMapping.Factory.Illegal<T extends Annotation>, Advice.OffsetMapping.Factory.Simple<T extends Annotation> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe annotation type.private final ParameterDescriptionThe bound parameter.private final booleantrueif the factory should create a read-only binding.private final Assigner.TypingThe typing to use. -
Constructor Summary
ConstructorsConstructorDescriptionFactory(Class<T> annotationType, ParameterDescription parameterDescription) Creates a new factory for binding a parameter of the instrumented method with read-only semantics and static typing.Factory(Class<T> annotationType, ParameterDescription parameterDescription, boolean readOnly, Assigner.Typing typing) Creates a new factory for binding a parameter of the instrumented method. -
Method Summary
Modifier and TypeMethodDescriptionReturns the annotation type of this factory.make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType) Creates a new offset mapping for the supplied parameter if possible.
-
Field Details
-
annotationType
The annotation type. -
parameterDescription
The bound parameter. -
readOnly
private final boolean readOnlytrueif the factory should create a read-only binding. -
typing
The typing to use.
-
-
Constructor Details
-
Factory
Creates a new factory for binding a parameter of the instrumented method with read-only semantics and static typing.- Parameters:
annotationType- The annotation type.parameterDescription- The bound parameter.
-
Factory
public Factory(Class<T> annotationType, ParameterDescription parameterDescription, boolean readOnly, Assigner.Typing typing) Creates a new factory for binding a parameter of the instrumented method.- Parameters:
annotationType- The annotation type.parameterDescription- The bound parameter.readOnly-trueif the factory should create a read-only binding.typing- The typing to use.
-
-
Method Details
-
getAnnotationType
Returns the annotation type of this factory.- Specified by:
getAnnotationTypein interfaceAdvice.OffsetMapping.Factory<T extends Annotation>- Returns:
- The factory's annotation type.
-
make
public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType) Creates a new offset mapping for the supplied parameter if possible.- Specified by:
makein interfaceAdvice.OffsetMapping.Factory<T extends Annotation>- Parameters:
target- The parameter description for which to resolve an offset mapping.annotation- The annotation that triggered this factory.adviceType-trueif the binding is applied using advice method delegation.- Returns:
- A resolved offset mapping or
nullif no mapping can be resolved for this parameter.
-