Package net.bytebuddy.asm
Class AsmVisitorWrapper.ForDeclaredFields.Entry
java.lang.Object
net.bytebuddy.asm.AsmVisitorWrapper.ForDeclaredFields.Entry
- All Implemented Interfaces:
AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper
,ElementMatcher<FieldDescription.InDefinedShape>
- Enclosing class:
AsmVisitorWrapper.ForDeclaredFields
@Enhance
protected static class AsmVisitorWrapper.ForDeclaredFields.Entry
extends Object
implements ElementMatcher<FieldDescription.InDefinedShape>, AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper
An entry describing a field visitor wrapper paired with a matcher for fields to be wrapped.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> The field visitor wrapper to be applied if the given matcher is matched.private final ElementMatcher
<? super FieldDescription.InDefinedShape> The matcher to identify fields to be wrapped. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Entry
(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappers) Creates a new entry. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Matches a target against this element matcher.org.objectweb.asm.FieldVisitor
wrap
(TypeDescription instrumentedType, FieldDescription.InDefinedShape fieldDescription, org.objectweb.asm.FieldVisitor fieldVisitor) Wraps a field visitor.
-
Field Details
-
matcher
The matcher to identify fields to be wrapped. -
fieldVisitorWrappers
private final List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappersThe field visitor wrapper to be applied if the given matcher is matched.
-
-
Constructor Details
-
Entry
protected Entry(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappers) Creates a new entry.- Parameters:
matcher
- The matcher to identify fields to be wrapped.fieldVisitorWrappers
- The field visitor wrapper to be applied if the given matcher is matched.
-
-
Method Details
-
matches
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<FieldDescription.InDefinedShape>
- Parameters:
target
- The instance to be matched ornull
.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
wrap
public org.objectweb.asm.FieldVisitor wrap(TypeDescription instrumentedType, FieldDescription.InDefinedShape fieldDescription, org.objectweb.asm.FieldVisitor fieldVisitor) Wraps a field visitor.- Specified by:
wrap
in interfaceAsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper
- Parameters:
instrumentedType
- The instrumented type.fieldDescription
- The field that is currently being defined.fieldVisitor
- The original field visitor that defines the given field.- Returns:
- The wrapped field visitor.
-