Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForStackManipulation.OfAnnotationProperty<T extends java.lang.annotation.Annotation>
- java.lang.Object
-
- net.bytebuddy.asm.Advice.OffsetMapping.ForStackManipulation.OfAnnotationProperty<T>
-
- Type Parameters:
T
- The annotation type this factory binds.
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<T>
- Enclosing class:
- Advice.OffsetMapping.ForStackManipulation
@Enhance public static class Advice.OffsetMapping.ForStackManipulation.OfAnnotationProperty<T extends java.lang.annotation.Annotation> extends java.lang.Object implements Advice.OffsetMapping.Factory<T>
A factory for binding an annotation's property.
-
-
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 java.lang.annotation.Annotation>, Advice.OffsetMapping.Factory.Simple<T extends java.lang.annotation.Annotation>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<T>
annotationType
The annotation type.private MethodDescription.InDefinedShape
property
The annotation property.
-
Constructor Summary
Constructors Modifier Constructor Description protected
OfAnnotationProperty(java.lang.Class<T> annotationType, MethodDescription.InDefinedShape property)
Creates a factory for binding an annotation property.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<T>
getAnnotationType()
Returns the annotation type of this factory.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.static <S extends java.lang.annotation.Annotation>
Advice.OffsetMapping.Factory<S>of(java.lang.Class<S> annotationType, java.lang.String property)
Creates a factory for an offset mapping that binds an annotation property.
-
-
-
Field Detail
-
annotationType
private final java.lang.Class<T extends java.lang.annotation.Annotation> annotationType
The annotation type.
-
property
private final MethodDescription.InDefinedShape property
The annotation property.
-
-
Constructor Detail
-
OfAnnotationProperty
protected OfAnnotationProperty(java.lang.Class<T> annotationType, MethodDescription.InDefinedShape property)
Creates a factory for binding an annotation property.- Parameters:
annotationType
- The annotation type.property
- The annotation property.
-
-
Method Detail
-
of
public static <S extends java.lang.annotation.Annotation> Advice.OffsetMapping.Factory<S> of(java.lang.Class<S> annotationType, java.lang.String property)
Creates a factory for an offset mapping that binds an annotation property.- Type Parameters:
S
- The annotation type.- Parameters:
annotationType
- The annotation type to bind.property
- The property to bind.- Returns:
- A factory for binding a property of the annotation type.
-
getAnnotationType
public java.lang.Class<T> getAnnotationType()
Returns the annotation type of this factory.- Specified by:
getAnnotationType
in interfaceAdvice.OffsetMapping.Factory<T extends java.lang.annotation.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:
make
in interfaceAdvice.OffsetMapping.Factory<T extends java.lang.annotation.Annotation>
- Parameters:
target
- The parameter description for which to resolve an offset mapping.annotation
- The annotation that triggered this factory.adviceType
-true
if the binding is applied using advice method delegation.- Returns:
- A resolved offset mapping or
null
if no mapping can be resolved for this parameter.
-
-