Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.DifferentialMatcher
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.DifferentialMatcher
-
- All Implemented Interfaces:
AgentBuilder.RawMatcher
- Enclosing class:
- AgentBuilder.Default.Transformation
@Enhance protected static class AgentBuilder.Default.Transformation.DifferentialMatcher extends java.lang.Object implements AgentBuilder.RawMatcher
A matcher that considers the differential of two transformers' transformations.
-
-
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 ResettableClassFileTransformer
classFileTransformer
The class file transformer representing the differential.private AgentBuilder.RawMatcher
ignoreMatcher
Identifies types that should not be instrumented.private java.util.List<AgentBuilder.Default.Transformation>
transformations
The transformations to apply on non-ignored types.
-
Constructor Summary
Constructors Modifier Constructor Description protected
DifferentialMatcher(AgentBuilder.RawMatcher ignoreMatcher, java.util.List<AgentBuilder.Default.Transformation> transformations, ResettableClassFileTransformer classFileTransformer)
Creates a new differential matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain)
Decides if the giventypeDescription
should be instrumented with the entailedAgentBuilder.Transformer
s.
-
-
-
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.
-
classFileTransformer
private final ResettableClassFileTransformer classFileTransformer
The class file transformer representing the differential.
-
-
Constructor Detail
-
DifferentialMatcher
protected DifferentialMatcher(AgentBuilder.RawMatcher ignoreMatcher, java.util.List<AgentBuilder.Default.Transformation> transformations, ResettableClassFileTransformer classFileTransformer)
Creates a new differential matcher.- Parameters:
ignoreMatcher
- Identifies types that should not be instrumented.transformations
- The transformations to apply on non-ignored types.classFileTransformer
- The class file transformer representing the differential.
-
-
Method Detail
-
matches
public boolean matches(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, java.security.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
.
-
-