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 java.lang.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
Fields Modifier and Type Field Description private AgentBuilder.RawMatcherignoreMatcherIdentifies types that should not be instrumented.private java.util.List<AgentBuilder.Default.Transformation>transformationsThe transformations to apply on non-ignored types.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleMatcher(AgentBuilder.RawMatcher ignoreMatcher, java.util.List<AgentBuilder.Default.Transformation> transformations)Creates a new simple matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain)Decides if the giventypeDescriptionshould be instrumented with the entailedAgentBuilder.Transformers.
-
-
-
Field Detail
-
ignoreMatcher
private final AgentBuilder.RawMatcher ignoreMatcher
Identifies types that should not be instrumented.
-
transformations
private final java.util.List<AgentBuilder.Default.Transformation> transformations
The transformations to apply on non-ignored types.
-
-
Constructor Detail
-
SimpleMatcher
protected SimpleMatcher(AgentBuilder.RawMatcher ignoreMatcher, java.util.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 Detail
-
matches
public boolean matches(TypeDescription typeDescription, @MaybeNull java.lang.ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull java.lang.Class<?> classBeingRedefined, @MaybeNull java.security.ProtectionDomain protectionDomain)
Decides if the giventypeDescriptionshould be instrumented with the entailedAgentBuilder.Transformers.- Specified by:
matchesin interfaceAgentBuilder.RawMatcher- Parameters:
typeDescription- A description of the type to be instrumented.classLoader- The class loader of the instrumented type. Might benullif this class loader represents the bootstrap class loader.module- The transformed type's module ornullif the current VM does not support modules.classBeingRedefined- The class being redefined which is only notnullif a retransformation is applied.protectionDomain- The protection domain of the type being transformed ornullif none is available.- Returns:
trueif the entailedAgentBuilder.Transformers should be applied for the giventypeDescription.
-
-