Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.ForElementMatcher
- java.lang.Object
-
- net.bytebuddy.asm.MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.ForElementMatcher
-
- All Implemented Interfaces:
MemberSubstitution.Substitution.ForFieldAccess.FieldResolver
- Enclosing interface:
- MemberSubstitution.Substitution.ForFieldAccess.FieldResolver
@Enhance public static class MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.ForElementMatcher extends java.lang.Object implements MemberSubstitution.Substitution.ForFieldAccess.FieldResolver
A field matcher that resolves a non-static field on the first parameter type of the substituted member usage.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution.ForFieldAccess.FieldResolver
MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.ForElementMatcher, MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.Simple
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
instrumentedType
The instrumented type.private ElementMatcher<? super FieldDescription>
matcher
The matcher to use for locating the field to substitute with.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? super FieldDescription> matcher)
Creates a new field resolver that locates a field on the receiver type using a matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDescription
resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result)
Resolves the field to substitute with.
-
-
-
Field Detail
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type.
-
matcher
private final ElementMatcher<? super FieldDescription> matcher
The matcher to use for locating the field to substitute with.
-
-
Constructor Detail
-
ForElementMatcher
protected ForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? super FieldDescription> matcher)
Creates a new field resolver that locates a field on the receiver type using a matcher.- Parameters:
instrumentedType
- The instrumented type.matcher
- The matcher to use for locating the field to substitute with.
-
-
Method Detail
-
resolve
public FieldDescription resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result)
Resolves the field to substitute with.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution.ForFieldAccess.FieldResolver
- Parameters:
targetType
- The target type on which a member is accessed.target
- The target field, method or constructor that is substituted,parameters
- All parameters that serve as input to this access.result
- The result that is expected from the interaction orvoid
if no result is expected.- Returns:
- The field to substitute with.
-
-