Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.Compound
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.Compound
-
- All Implemented Interfaces:
AgentBuilder.Default.Transformation
,AgentBuilder.RawMatcher
- Enclosing interface:
- AgentBuilder.Default.Transformation
public static class AgentBuilder.Default.Transformation.Compound extends java.lang.Object implements AgentBuilder.Default.Transformation
A compound transformation that applied several transformation in the given order and applies the first active transformation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation
AgentBuilder.Default.Transformation.Compound, AgentBuilder.Default.Transformation.Ignored, AgentBuilder.Default.Transformation.Resolution, AgentBuilder.Default.Transformation.Simple
-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Compound(java.util.List<? extends AgentBuilder.Default.Transformation> transformations)
Creates a new compound transformation.protected
Compound(AgentBuilder.Default.Transformation... transformation)
Creates a new compound transformation.
-
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.AgentBuilder.Default.Transformation.Resolution
resolve(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, boolean loaded, java.security.ProtectionDomain protectionDomain, TypePool typePool)
Resolves an attempted transformation to a specific transformation.
-
-
-
Constructor Detail
-
Compound
protected Compound(AgentBuilder.Default.Transformation... transformation)
Creates a new compound transformation.- Parameters:
transformation
- An array of transformations to apply in their application order.
-
Compound
protected Compound(java.util.List<? extends AgentBuilder.Default.Transformation> transformations)
Creates a new compound transformation.- Parameters:
transformations
- A list of transformations to apply in their application order.
-
-
Method Detail
-
matches
public boolean matches(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain)
Description copied from interface:AgentBuilder.RawMatcher
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
.
-
resolve
public AgentBuilder.Default.Transformation.Resolution resolve(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, boolean loaded, java.security.ProtectionDomain protectionDomain, TypePool typePool)
Description copied from interface:AgentBuilder.Default.Transformation
Resolves an attempted transformation to a specific transformation.- Specified by:
resolve
in interfaceAgentBuilder.Default.Transformation
- Parameters:
typeDescription
- A description of the type that is to be transformed.classLoader
- The class loader of the type being transformed.module
- The transformed type's module ornull
if the current VM does not support modules.classBeingRedefined
- In case of a type redefinition, the loaded type being transformed ornull
if that is not the case.loaded
-true
if the instrumented type is loaded.protectionDomain
- The protection domain of the type being transformed.typePool
- The type pool to apply during type creation.- Returns:
- A resolution for the given type.
-
-