Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transformation.Resolution.Unresolved
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.Resolution.Unresolved
-
- All Implemented Interfaces:
AgentBuilder.Default.Transformation.Resolution
- Enclosing interface:
- AgentBuilder.Default.Transformation.Resolution
@Enhance public static class AgentBuilder.Default.Transformation.Resolution.Unresolved extends java.lang.Object implements AgentBuilder.Default.Transformation.Resolution
A canonical implementation of a non-resolved resolution.
-
-
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.ClassLoader
classLoader
The unresolved type's class loader.private boolean
loaded
true
if the type is already loaded.private JavaModule
module
The non-transformed type's module ornull
if the current VM does not support modules.private TypeDescription
typeDescription
The type that is not transformed.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Unresolved(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, boolean loaded)
Creates a new unresolved resolution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 returnsnull
if a type is not to be transformed.AgentBuilder.Default.Transformation.Resolution
asDecoratorOf(AgentBuilder.Default.Transformation.Resolution resolution)
Resolves this resolution as a decorator of the supplied resolution.AgentBuilder.Default.Transformation.Resolution.Sort
getSort()
Returns the sort of this resolution.AgentBuilder.Default.Transformation.Resolution
prepend(AgentBuilder.Default.Transformation.Resolution.Decoratable resolution)
Resolves this resolution as a decorator of the supplied resolution.
-
-
-
Field Detail
-
typeDescription
private final TypeDescription typeDescription
The type that is not transformed.
-
classLoader
private final java.lang.ClassLoader classLoader
The unresolved type's class loader.
-
module
private final JavaModule module
The non-transformed type's module ornull
if the current VM does not support modules.
-
loaded
private final boolean loaded
true
if the type is already loaded.
-
-
Constructor Detail
-
Unresolved
protected Unresolved(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, boolean loaded)
Creates a new unresolved resolution.- Parameters:
typeDescription
- The type that is not transformed.classLoader
- The unresolved type's class loader.module
- The non-transformed type's module ornull
if the current VM does not support modules.loaded
-true
if the type is already loaded.
-
-
Method Detail
-
getSort
public AgentBuilder.Default.Transformation.Resolution.Sort getSort()
Returns the sort of this resolution.- Specified by:
getSort
in 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:
asDecoratorOf
in 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:
prepend
in 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.
-
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 returnsnull
if a type is not to be transformed.- Specified by:
apply
in 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
null
if no transformation is attempted.
-
-