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 java.lang.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
Fields Modifier and Type Field Description private java.util.List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper>
fieldVisitorWrappers
The field visitor wrapper to be applied if the given matcher is matched.private ElementMatcher<? super FieldDescription.InDefinedShape>
matcher
The matcher to identify fields to be wrapped.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Entry(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, java.util.List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappers)
Creates a new entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(FieldDescription.InDefinedShape target)
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 Detail
-
matcher
private final ElementMatcher<? super FieldDescription.InDefinedShape> matcher
The matcher to identify fields to be wrapped.
-
fieldVisitorWrappers
private final java.util.List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappers
The field visitor wrapper to be applied if the given matcher is matched.
-
-
Constructor Detail
-
Entry
protected Entry(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, java.util.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 Detail
-
matches
public boolean matches(FieldDescription.InDefinedShape target)
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<FieldDescription.InDefinedShape>
- Parameters:
target
- The instance to be matched.- 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.
-
-