Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForLocalValue.Factory
- java.lang.Object
-
- net.bytebuddy.asm.Advice.OffsetMapping.ForLocalValue.Factory
-
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<Advice.Local>
- Enclosing class:
- Advice.OffsetMapping.ForLocalValue
@Enhance protected static class Advice.OffsetMapping.ForLocalValue.Factory extends java.lang.Object implements Advice.OffsetMapping.Factory<Advice.Local>
A factory for an offset mapping for a local variable that is declared by the advice methods viaAdvice.Local
.
-
-
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.util.Map<java.lang.String,TypeDefinition>
namedTypes
The mapping of type names to their type that are available.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Factory(java.util.Map<java.lang.String,TypeDefinition> namedTypes)
Creates a factory for aAdvice.Local
variable mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<Advice.Local>
getAnnotationType()
Returns the annotation type of this factory.Advice.OffsetMapping
make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<Advice.Local> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType)
Creates a new offset mapping for the supplied parameter if possible.
-
-
-
Field Detail
-
namedTypes
private final java.util.Map<java.lang.String,TypeDefinition> namedTypes
The mapping of type names to their type that are available.
-
-
Constructor Detail
-
Factory
protected Factory(java.util.Map<java.lang.String,TypeDefinition> namedTypes)
Creates a factory for aAdvice.Local
variable mapping.- Parameters:
namedTypes
- The mapping of type names to their type that are available.
-
-
Method Detail
-
getAnnotationType
public java.lang.Class<Advice.Local> getAnnotationType()
Returns the annotation type of this factory.- Specified by:
getAnnotationType
in interfaceAdvice.OffsetMapping.Factory<Advice.Local>
- Returns:
- The factory's annotation type.
-
make
public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<Advice.Local> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType)
Creates a new offset mapping for the supplied parameter if possible.- Specified by:
make
in interfaceAdvice.OffsetMapping.Factory<Advice.Local>
- 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.
-
-