Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.Simple.Resolution
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.Simple.Resolution
-
- All Implemented Interfaces:
AgentBuilder.Default.Transformation.Resolution,AgentBuilder.Default.Transformation.Resolution.Decoratable
- Enclosing class:
- AgentBuilder.Default.Transformation.Simple
@Enhance protected static class AgentBuilder.Default.Transformation.Simple.Resolution extends java.lang.Object implements AgentBuilder.Default.Transformation.Resolution.Decoratable
A resolution that performs a type transformation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.Resolution
AgentBuilder.Default.Transformation.Resolution.Decoratable, AgentBuilder.Default.Transformation.Resolution.Sort, AgentBuilder.Default.Transformation.Resolution.Unresolved
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderThe class loader of the transformed type.private booleandecoratortrueif this transformer serves as a decorator.private booleanloadedtrueif the transformed type is already loaded.private JavaModulemoduleThe transformed type's module ornullif the current VM does not support modules.private java.security.ProtectionDomainprotectionDomainThe protection domain of the transformed type.private AgentBuilder.TransformertransformerThe transformer to be applied.private TypeDescriptiontypeDescriptionA description of the transformed type.private TypePooltypePoolThe type pool to apply during type creation.
-
Constructor Summary
Constructors Modifier Constructor Description protectedResolution(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.security.ProtectionDomain protectionDomain, boolean loaded, TypePool typePool, AgentBuilder.Transformer transformer, boolean decorator)Creates a new active transformation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentBuilder.Default.Transformation.Resolutionappend(AgentBuilder.Transformer transformer)Appends the supplied transformer to this resolution.byte[]apply(AgentBuilder.InitializationStrategy initializationStrategy, ClassFileLocator classFileLocator, AgentBuilder.TypeStrategy typeStrategy, ByteBuddy byteBuddy, AgentBuilder.Default.NativeMethodStrategy methodNameTransformer, AgentBuilder.InjectionStrategy injectionStrategy, java.security.AccessControlContext accessControlContext, AgentBuilder.Listener listener)Transforms a type or returnsnullif a type is not to be transformed.AgentBuilder.Default.Transformation.ResolutionasDecoratorOf(AgentBuilder.Default.Transformation.Resolution resolution)Resolves this resolution as a decorator of the supplied resolution.AgentBuilder.Default.Transformation.Resolution.SortgetSort()Returns the sort of this resolution.AgentBuilder.Default.Transformation.Resolutionprepend(AgentBuilder.Default.Transformation.Resolution.Decoratable resolution)Resolves this resolution as a decorator of the supplied resolution.
-
-
-
Field Detail
-
typeDescription
private final TypeDescription typeDescription
A description of the transformed type.
-
classLoader
private final java.lang.ClassLoader classLoader
The class loader of the transformed type.
-
module
private final JavaModule module
The transformed type's module ornullif the current VM does not support modules.
-
protectionDomain
private final java.security.ProtectionDomain protectionDomain
The protection domain of the transformed type.
-
loaded
private final boolean loaded
trueif the transformed type is already loaded.
-
typePool
private final TypePool typePool
The type pool to apply during type creation.
-
transformer
private final AgentBuilder.Transformer transformer
The transformer to be applied.
-
decorator
private final boolean decorator
trueif this transformer serves as a decorator.
-
-
Constructor Detail
-
Resolution
protected Resolution(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.security.ProtectionDomain protectionDomain, boolean loaded, TypePool typePool, AgentBuilder.Transformer transformer, boolean decorator)
Creates a new active transformation.- Parameters:
typeDescription- A description of the transformed type.classLoader- The class loader of the transformed type.module- The transformed type's module ornullif the current VM does not support modules.protectionDomain- The protection domain of the transformed type.loaded-trueif the transformed type is already loaded.typePool- The type pool to apply during type creation.transformer- The transformer to be applied.decorator-trueif this transformer serves as a decorator.
-
-
Method Detail
-
getSort
public AgentBuilder.Default.Transformation.Resolution.Sort getSort()
Returns the sort of this resolution.- Specified by:
getSortin interfaceAgentBuilder.Default.Transformation.Resolution- Returns:
- The sort of this resolution.
-
asDecoratorOf
public AgentBuilder.Default.Transformation.Resolution asDecoratorOf(AgentBuilder.Default.Transformation.Resolution resolution)
Resolves this resolution as a decorator of the supplied resolution.- Specified by:
asDecoratorOfin interfaceAgentBuilder.Default.Transformation.Resolution- Parameters:
resolution- The resolution for which this resolution should serve as a decorator.- Returns:
- A resolution where this resolution is applied as a decorator if this resolution is alive.
-
prepend
public AgentBuilder.Default.Transformation.Resolution prepend(AgentBuilder.Default.Transformation.Resolution.Decoratable resolution)
Resolves this resolution as a decorator of the supplied resolution.- Specified by:
prependin interfaceAgentBuilder.Default.Transformation.Resolution- Parameters:
resolution- The resolution for which this resolution should serve as a decorator.- Returns:
- A resolution where this resolution is applied as a decorator if this resolution is alive.
-
append
public AgentBuilder.Default.Transformation.Resolution append(AgentBuilder.Transformer transformer)
Appends the supplied transformer to this resolution.- Specified by:
appendin interfaceAgentBuilder.Default.Transformation.Resolution.Decoratable- Parameters:
transformer- The transformer to append to the transformer that is represented bz this instance.- Returns:
- A new resolution with the supplied transformer appended to this transformer.
-
apply
public byte[] apply(AgentBuilder.InitializationStrategy initializationStrategy, ClassFileLocator classFileLocator, AgentBuilder.TypeStrategy typeStrategy, ByteBuddy byteBuddy, AgentBuilder.Default.NativeMethodStrategy methodNameTransformer, AgentBuilder.InjectionStrategy injectionStrategy, java.security.AccessControlContext accessControlContext, AgentBuilder.Listener listener)
Transforms a type or returnsnullif a type is not to be transformed.- Specified by:
applyin interfaceAgentBuilder.Default.Transformation.Resolution- Parameters:
initializationStrategy- The initialization strategy to use.classFileLocator- The class file locator to use.typeStrategy- The definition handler to use.byteBuddy- The Byte Buddy instance to use.methodNameTransformer- The method name transformer to be used.injectionStrategy- The injection strategy to be used.accessControlContext- The access control context to be used.listener- The listener to be invoked to inform about an applied or non-applied transformation.- Returns:
- The class file of the transformed class or
nullif no transformation is attempted.
-
-