Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.SimpleMatcher
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.SimpleMatcher
- All Implemented Interfaces:
AgentBuilder.RawMatcher
- Enclosing class:
AgentBuilder.Default.Transformation
@Enhance
protected static class AgentBuilder.Default.Transformation.SimpleMatcher
extends Object
implements AgentBuilder.RawMatcher
A matcher that matches any type that is touched by a transformer without being ignored.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RawMatcher
AgentBuilder.RawMatcher.Conjunction, AgentBuilder.RawMatcher.Disjunction, AgentBuilder.RawMatcher.ForElementMatchers, AgentBuilder.RawMatcher.ForLoadState, AgentBuilder.RawMatcher.ForResolvableTypes, AgentBuilder.RawMatcher.Inversion, AgentBuilder.RawMatcher.Trivial
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AgentBuilder.RawMatcher
Identifies types that should not be instrumented.private final List
<AgentBuilder.Default.Transformation> The transformations to apply on non-ignored types. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleMatcher
(AgentBuilder.RawMatcher ignoreMatcher, List<AgentBuilder.Default.Transformation> transformations) Creates a new simple matcher. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, Class<?> classBeingRedefined, ProtectionDomain protectionDomain) Decides if the giventypeDescription
should be instrumented with the entailedAgentBuilder.Transformer
s.
-
Field Details
-
ignoreMatcher
Identifies types that should not be instrumented. -
transformations
The transformations to apply on non-ignored types.
-
-
Constructor Details
-
SimpleMatcher
protected SimpleMatcher(AgentBuilder.RawMatcher ignoreMatcher, List<AgentBuilder.Default.Transformation> transformations) Creates a new simple matcher.- Parameters:
ignoreMatcher
- Identifies types that should not be instrumented.transformations
- The transformations to apply on non-ignored types.
-
-
Method Details
-
matches
public boolean matches(TypeDescription typeDescription, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull Class<?> classBeingRedefined, ProtectionDomain protectionDomain) Decides if the giventypeDescription
should be instrumented with the entailedAgentBuilder.Transformer
s.- Specified by:
matches
in interfaceAgentBuilder.RawMatcher
- Parameters:
typeDescription
- A description of the type to be instrumented.classLoader
- The class loader of the instrumented type. Might benull
if this class loader represents the bootstrap class loader.module
- The transformed type's module ornull
if the current VM does not support modules.classBeingRedefined
- The class being redefined which is only notnull
if a retransformation is applied.protectionDomain
- The protection domain of the type being transformed.- Returns:
true
if the entailedAgentBuilder.Transformer
s should be applied for the giventypeDescription
.
-