Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.Simple
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.Simple
-
- All Implemented Interfaces:
AgentBuilder.Default.Transformation,AgentBuilder.RawMatcher
- Enclosing interface:
- AgentBuilder.Default.Transformation
@Enhance public static class AgentBuilder.Default.Transformation.Simple extends java.lang.Object implements AgentBuilder.Default.Transformation
A simple, active transformation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAgentBuilder.Default.Transformation.Simple.ResolutionA resolution that performs a type transformation.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation
AgentBuilder.Default.Transformation.Compound, AgentBuilder.Default.Transformation.Ignored, 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
-
-
Field Summary
Fields Modifier and Type Field Description private booleandecoratortrueif this transformer serves as a decorator.private AgentBuilder.RawMatcherrawMatcherThe raw matcher that is represented by this transformation.private AgentBuilder.TransformertransformerThe transformer that is represented by this transformation.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimple(AgentBuilder.RawMatcher rawMatcher, AgentBuilder.Transformer transformer, boolean decorator)Creates a new transformation.
-
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.AgentBuilder.Default.Transformation.Resolutionresolve(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.
-
-
-
Field Detail
-
rawMatcher
private final AgentBuilder.RawMatcher rawMatcher
The raw matcher that is represented by this transformation.
-
transformer
private final AgentBuilder.Transformer transformer
The transformer that is represented by this transformation.
-
decorator
private final boolean decorator
trueif this transformer serves as a decorator.
-
-
Constructor Detail
-
Simple
protected Simple(AgentBuilder.RawMatcher rawMatcher, AgentBuilder.Transformer transformer, boolean decorator)
Creates a new transformation.- Parameters:
rawMatcher- The raw matcher that is represented by this transformation.transformer- The transformer that is represented by this transformation.decorator-trueif this transformer serves as a decorator.
-
-
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 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.- Returns:
trueif the entailedAgentBuilder.Transformers 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)
Resolves an attempted transformation to a specific transformation.- Specified by:
resolvein 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 ornullif the current VM does not support modules.classBeingRedefined- In case of a type redefinition, the loaded type being transformed ornullif that is not the case.loaded-trueif 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.
-
-