Package net.bytebuddy.asm
Class Advice.OffsetMapping.Factory.Simple<T extends Annotation>
java.lang.Object
net.bytebuddy.asm.Advice.OffsetMapping.Factory.Simple<T>
- Type Parameters:
T- The annotation type that represents this offset mapping.
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<T>
- Enclosing interface:
Advice.OffsetMapping.Factory<T extends Annotation>
@Enhance
public static class Advice.OffsetMapping.Factory.Simple<T extends Annotation>
extends Object
implements Advice.OffsetMapping.Factory<T>
A simple factory that binds a constant offset mapping.
-
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 being bound.private final Advice.OffsetMappingThe fixed offset mapping. -
Constructor Summary
ConstructorsConstructorDescriptionSimple(Class<T> annotationType, Advice.OffsetMapping offsetMapping) Creates a simple factory for a simple binding for an offset mapping. -
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 being bound. -
offsetMapping
The fixed offset mapping.
-
-
Constructor Details
-
Simple
Creates a simple factory for a simple binding for an offset mapping.- Parameters:
annotationType- The annotation type being bound.offsetMapping- The fixed offset mapping.
-
-
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.
-