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 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 MemberSubstitution.Substitution.ForFieldAccess.FieldResolver
MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.ForElementMatcher, MemberSubstitution.Substitution.ForFieldAccess.FieldResolver.Simple -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescriptionThe instrumented type.private final ElementMatcher<? super FieldDescription> The matcher to use for locating the field to substitute with. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? super FieldDescription> matcher) Creates a new field resolver that locates a field on the receiver type using a matcher. -
Method Summary
Modifier and TypeMethodDescriptionresolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result) Resolves the field to substitute with.
-
Field Details
-
instrumentedType
The instrumented type. -
matcher
The matcher to use for locating the field to substitute with.
-
-
Constructor Details
-
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 Details
-
resolve
public FieldDescription resolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result) Resolves the field to substitute with.- Specified by:
resolvein interfaceMemberSubstitution.Substitution.ForFieldAccess.FieldResolver- Parameters:
target- The target member of invokedynamic invocation.parameters- All parameters that serve as input to this access.result- The result that is expected from the interaction orvoidif no result is expected.- Returns:
- The field to substitute with.
-