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 Object implements AgentBuilder.RawMatcher
A matcher that considers the differential of two transformers' transformations.
  • Field Details

  • Constructor Details

    • DifferentialMatcher

      protected DifferentialMatcher(AgentBuilder.RawMatcher ignoreMatcher, 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 Details

    • matches

      public boolean matches(TypeDescription typeDescription, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull Class<?> classBeingRedefined, ProtectionDomain protectionDomain)
      Decides if the given typeDescription should be instrumented with the entailed AgentBuilder.Transformers.
      Specified by:
      matches in interface AgentBuilder.RawMatcher
      Parameters:
      typeDescription - A description of the type to be instrumented.
      classLoader - The class loader of the instrumented type. Might be null if this class loader represents the bootstrap class loader.
      module - The transformed type's module or null if the current VM does not support modules.
      classBeingRedefined - The class being redefined which is only not null if a retransformation is applied.
      protectionDomain - The protection domain of the type being transformed.
      Returns:
      true if the entailed AgentBuilder.Transformers should be applied for the given typeDescription.