Package | Description |
---|---|
net.bytebuddy |
Byte Buddy is a library for creating Java classes at runtime of a Java program.
|
net.bytebuddy.agent.builder |
An agent builder is used to easily implement load-time class-transformations using a Java agent.
|
net.bytebuddy.asm |
The ASM package contains classes that are meant for direct interaction with the ASM API.
|
net.bytebuddy.build |
A package for types that allow for applying Byte Buddy transformation during a build process.
|
net.bytebuddy.dynamic |
This package contains classes and interfaces that are connected to writing the byte stream that represents a Java
type that is dynamically created and for loading this type into a running JVM process.
|
net.bytebuddy.dynamic.loading |
This package contains classes that are responsible for class loading of classes that are represented by
byte arrays. |
net.bytebuddy.dynamic.scaffold |
This package contains helper types and implementations that are responsible for the actual writing of a byte array
representing a Java class.
|
net.bytebuddy.dynamic.scaffold.inline |
All classes and types in this package are related to creating a
DynamicType by
enhancing a given type. |
net.bytebuddy.pool |
Classes of this package allow for the creating
TypeDescription s without
loading any classes. |
net.bytebuddy.utility |
This package contains utility classes for common use within any Byte Buddy logic.
|
Modifier and Type | Method and Description |
---|---|
<T> DynamicType.Builder<T> |
ByteBuddy.decorate(Class<T> type,
ClassFileLocator classFileLocator)
Decorates a type with
AsmVisitorWrapper and allows adding attributes and annotations. |
<T> DynamicType.Builder<T> |
ByteBuddy.decorate(TypeDescription type,
ClassFileLocator classFileLocator)
Decorates a type with
AsmVisitorWrapper and allows adding attributes and annotations. |
static ClassFileVersion |
ClassFileVersion.of(Class<?> type,
ClassFileLocator classFileLocator)
Extracts a class' class version.
|
static ClassFileVersion |
ClassFileVersion.of(TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Extracts a class' class version.
|
<T> DynamicType.Builder<T> |
ByteBuddy.rebase(Class<T> type,
ClassFileLocator classFileLocator)
Rebases the given type where any intercepted method that is declared by the redefined type is preserved within the
rebased type's class such that the class's original can be invoked from the new method implementations.
|
<T> DynamicType.Builder<T> |
ByteBuddy.rebase(Class<T> type,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Rebases the given type where any intercepted method that is declared by the redefined type is preserved within the
rebased type's class such that the class's original can be invoked from the new method implementations.
|
DynamicType.Builder<?> |
ByteBuddy.rebase(Package aPackage,
ClassFileLocator classFileLocator)
Rebases a package.
|
DynamicType.Builder<?> |
ByteBuddy.rebase(PackageDescription aPackage,
ClassFileLocator classFileLocator)
Rebases a package.
|
<T> DynamicType.Builder<T> |
ByteBuddy.rebase(TypeDescription type,
ClassFileLocator classFileLocator)
Rebases the given type where any intercepted method that is declared by the redefined type is preserved within the
rebased type's class such that the class's original can be invoked from the new method implementations.
|
<T> DynamicType.Builder<T> |
ByteBuddy.rebase(TypeDescription type,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Rebases the given type where any intercepted method that is declared by the redefined type is preserved within the
rebased type's class such that the class's original can be invoked from the new method implementations.
|
<T> DynamicType.Builder<T> |
ByteBuddy.redefine(Class<T> type,
ClassFileLocator classFileLocator)
Redefines the given type where any intercepted method that is declared by the redefined type is fully replaced
by the new implementation.
|
<T> DynamicType.Builder<T> |
ByteBuddy.redefine(TypeDescription type,
ClassFileLocator classFileLocator)
Redefines the given type where any intercepted method that is declared by the redefined type is fully replaced
by the new implementation.
|
Modifier and Type | Field and Description |
---|---|
protected ClassFileLocator |
AgentBuilder.Default.classFileLocator
A class file locator to be used for additional lookup of globally available types.
|
Modifier and Type | Method and Description |
---|---|
ClassFileLocator |
AgentBuilder.LocationStrategy.classFileLocator(ClassLoader classLoader,
JavaModule module)
Creates a class file locator for a given class loader and module combination.
|
ClassFileLocator |
AgentBuilder.LocationStrategy.NoOp.classFileLocator(ClassLoader classLoader,
JavaModule module)
Creates a class file locator for a given class loader and module combination.
|
ClassFileLocator |
AgentBuilder.LocationStrategy.Simple.classFileLocator(ClassLoader classLoader,
JavaModule module)
Creates a class file locator for a given class loader and module combination.
|
ClassFileLocator |
AgentBuilder.LocationStrategy.Compound.classFileLocator(ClassLoader classLoader,
JavaModule module)
Creates a class file locator for a given class loader and module combination.
|
ClassFileLocator |
AgentBuilder.ClassFileBufferStrategy.resolve(String name,
byte[] binaryRepresentation,
ClassLoader classLoader,
JavaModule module,
ProtectionDomain protectionDomain)
Resolves a class file locator for the class file buffer that is provided to the class file transformer.
|
Modifier and Type | Method and Description |
---|---|
DynamicType.Builder<?> |
AgentBuilder.TypeStrategy.builder(TypeDescription typeDescription,
ByteBuddy byteBuddy,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer,
ClassLoader classLoader,
JavaModule module,
ProtectionDomain protectionDomain)
Creates a type builder for a given type.
|
DynamicType.Builder<?> |
AgentBuilder.TypeStrategy.ForBuildEntryPoint.builder(TypeDescription typeDescription,
ByteBuddy byteBuddy,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer,
ClassLoader classLoader,
JavaModule module,
ProtectionDomain protectionDomain)
Creates a type builder for a given type.
|
AgentBuilder.Transformer.ForAdvice |
AgentBuilder.Transformer.ForAdvice.include(ClassFileLocator... classFileLocator)
Includes the supplied class file locators as a source for looking up an advice class or its dependencies.
|
protected AgentBuilder.Transformer.ForAdvice |
AgentBuilder.Transformer.ForAdvice.make(Advice.WithCustomMapping advice,
Advice.ExceptionHandler exceptionHandler,
Assigner assigner,
ClassFileLocator classFileLocator,
AgentBuilder.PoolStrategy poolStrategy,
AgentBuilder.LocationStrategy locationStrategy,
List<AgentBuilder.Transformer.ForAdvice.Entry> entries)
Creates an advice transformer.
|
ResettableClassFileTransformer |
AgentBuilder.Default.ExecutingTransformer.Factory.make(ByteBuddy byteBuddy,
AgentBuilder.Listener listener,
AgentBuilder.PoolStrategy poolStrategy,
AgentBuilder.TypeStrategy typeStrategy,
AgentBuilder.LocationStrategy locationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AgentBuilder.InitializationStrategy initializationStrategy,
AgentBuilder.InjectionStrategy injectionStrategy,
AgentBuilder.LambdaInstrumentationStrategy lambdaInstrumentationStrategy,
AgentBuilder.DescriptionStrategy descriptionStrategy,
AgentBuilder.FallbackStrategy fallbackStrategy,
AgentBuilder.ClassFileBufferStrategy classFileBufferStrategy,
AgentBuilder.InstallationListener installationListener,
AgentBuilder.RawMatcher ignoreMatcher,
AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer resubmissionEnforcer,
List<AgentBuilder.Default.Transformation> transformations,
AgentBuilder.CircularityLock circularityLock)
Creates a new class file transformer for the current VM.
|
ResettableClassFileTransformer |
AgentBuilder.Default.ExecutingTransformer.Factory.ForJava9CapableVm.make(ByteBuddy byteBuddy,
AgentBuilder.Listener listener,
AgentBuilder.PoolStrategy poolStrategy,
AgentBuilder.TypeStrategy typeStrategy,
AgentBuilder.LocationStrategy locationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AgentBuilder.InitializationStrategy initializationStrategy,
AgentBuilder.InjectionStrategy injectionStrategy,
AgentBuilder.LambdaInstrumentationStrategy lambdaInstrumentationStrategy,
AgentBuilder.DescriptionStrategy descriptionStrategy,
AgentBuilder.FallbackStrategy fallbackStrategy,
AgentBuilder.ClassFileBufferStrategy classFileBufferStrategy,
AgentBuilder.InstallationListener installationListener,
AgentBuilder.RawMatcher ignoreMatcher,
AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer resubmissionEnforcer,
List<AgentBuilder.Default.Transformation> transformations,
AgentBuilder.CircularityLock circularityLock)
Creates a new class file transformer for the current VM.
|
ResettableClassFileTransformer |
AgentBuilder.Default.ExecutingTransformer.Factory.ForLegacyVm.make(ByteBuddy byteBuddy,
AgentBuilder.Listener listener,
AgentBuilder.PoolStrategy poolStrategy,
AgentBuilder.TypeStrategy typeStrategy,
AgentBuilder.LocationStrategy locationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AgentBuilder.InitializationStrategy initializationStrategy,
AgentBuilder.InjectionStrategy injectionStrategy,
AgentBuilder.LambdaInstrumentationStrategy lambdaInstrumentationStrategy,
AgentBuilder.DescriptionStrategy descriptionStrategy,
AgentBuilder.FallbackStrategy fallbackStrategy,
AgentBuilder.ClassFileBufferStrategy classFileBufferStrategy,
AgentBuilder.InstallationListener installationListener,
AgentBuilder.RawMatcher ignoreMatcher,
AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer resubmissionEnforcer,
List<AgentBuilder.Default.Transformation> transformations,
AgentBuilder.CircularityLock circularityLock)
Creates a new class file transformer for the current VM.
|
protected abstract Advice |
AgentBuilder.Transformer.ForAdvice.Entry.resolve(Advice.WithCustomMapping advice,
TypePool typePool,
ClassFileLocator classFileLocator)
Resolves the advice for this entry.
|
protected Advice |
AgentBuilder.Transformer.ForAdvice.Entry.ForUnifiedAdvice.resolve(Advice.WithCustomMapping advice,
TypePool typePool,
ClassFileLocator classFileLocator) |
protected Advice |
AgentBuilder.Transformer.ForAdvice.Entry.ForSplitAdvice.resolve(Advice.WithCustomMapping advice,
TypePool typePool,
ClassFileLocator classFileLocator) |
TypePool |
AgentBuilder.ClassFileBufferStrategy.typePool(AgentBuilder.PoolStrategy poolStrategy,
ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Resolves the type pool for a given type name by the supplied
AgentBuilder.PoolStrategy . |
TypePool |
AgentBuilder.PoolStrategy.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.Default.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.Eager.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.ClassLoading.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.WithTypePoolCache.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.Default.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.Eager.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.ClassLoading.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.PoolStrategy.WithTypePoolCache.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader,
String name)
Creates a type pool for a given class file locator.
|
AgentBuilder |
AgentBuilder.with(ClassFileLocator classFileLocator)
Registers an additional class file locator for types that are globally available but cannot be located
otherwise.
|
AgentBuilder |
AgentBuilder.Default.with(ClassFileLocator classFileLocator)
Registers an additional class file locator for types that are globally available but cannot be located
otherwise.
|
AgentBuilder |
AgentBuilder.Default.Delegator.with(ClassFileLocator classFileLocator)
Registers an additional class file locator for types that are globally available but cannot be located
otherwise.
|
AgentBuilder.LocationStrategy |
AgentBuilder.LocationStrategy.ForClassLoader.withFallbackTo(ClassFileLocator... classFileLocator)
Adds additional location strategies as fallbacks to this location strategy.
|
Modifier and Type | Method and Description |
---|---|
AgentBuilder.Transformer.ForAdvice |
AgentBuilder.Transformer.ForAdvice.include(List<? extends ClassFileLocator> classFileLocators)
Includes the supplied class file locators as a source for looking up an advice class or its dependencies.
|
AgentBuilder.LocationStrategy |
AgentBuilder.LocationStrategy.ForClassLoader.withFallbackTo(Collection<? extends ClassFileLocator> classFileLocators)
Adds additional location strategies as fallbacks to this location strategy.
|
Modifier and Type | Method and Description |
---|---|
static Advice |
Advice.to(Class<?> enterAdvice,
Class<?> exitAdvice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
Advice |
Advice.WithCustomMapping.to(Class<?> enterAdvice,
Class<?> exitAdvice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
static Advice |
Advice.to(Class<?> advice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
Advice |
Advice.WithCustomMapping.to(Class<?> advice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
protected static Advice |
Advice.to(TypeDescription advice,
Advice.PostProcessor.Factory postProcessorFactory,
ClassFileLocator classFileLocator,
List<? extends Advice.OffsetMapping.Factory<?>> userFactories,
Advice.Delegator.Factory delegatorFactory)
Creates a new advice.
|
static Advice |
Advice.to(TypeDescription advice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
Advice |
Advice.WithCustomMapping.to(TypeDescription advice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
protected static Advice |
Advice.to(TypeDescription enterAdvice,
TypeDescription exitAdvice,
Advice.PostProcessor.Factory postProcessorFactory,
ClassFileLocator classFileLocator,
List<? extends Advice.OffsetMapping.Factory<?>> userFactories,
Advice.Delegator.Factory delegatorFactory)
Creates a new advice.
|
static Advice |
Advice.to(TypeDescription enterAdvice,
TypeDescription exitAdvice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
Advice |
Advice.WithCustomMapping.to(TypeDescription enterAdvice,
TypeDescription exitAdvice,
ClassFileLocator classFileLocator)
Implements advice where every matched method is advised by the given type's advisory methods.
|
Constructor and Description |
---|
ForClassFileLocator(ClassFileLocator classFileLocator)
Creates a new type pool resolver for a class file locator as a supplement of the implicit type pool.
|
ForClassFileLocator(ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode)
Creates a new type pool resolver for a class file locator as a supplement of the implicit type pool.
|
Modifier and Type | Method and Description |
---|---|
ClassFileLocator |
Plugin.Engine.Source.Origin.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.Origin.ForJarFile.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.Origin.Filtering.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.Empty.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.Compound.Origin.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.InMemory.getClassFileLocator()
Returns a class file locator for the represented source.
|
ClassFileLocator |
Plugin.Engine.Source.ForFolder.getClassFileLocator()
Returns a class file locator for the represented source.
|
Modifier and Type | Method and Description |
---|---|
DynamicType.Builder<?> |
ToStringPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
RepeatedAnnotationPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
RenamingPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
Plugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
Plugin.NoOp.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
HashCodeAndEqualsPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
DispatcherAnnotationPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
CachedReturnPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
AccessControllerPlugin.apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
DynamicType.Builder<?> |
Plugin.Engine.TypeStrategy.builder(ByteBuddy byteBuddy,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Creates a builder for a given type.
|
DynamicType.Builder<?> |
Plugin.Engine.TypeStrategy.ForEntryPoint.builder(ByteBuddy byteBuddy,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Creates a builder for a given type.
|
Map<TypeDescription,byte[]> |
Plugin.WithInitialization.initialize(ClassFileLocator classFileLocator)
Returns a mapping of classes that should be created before discovering any types.
|
void |
Plugin.WithPreprocessor.onPreprocess(TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Invoked upon the discovery of a type that is not explicitly ignored.
|
DynamicType.Builder<?> |
EntryPoint.transform(TypeDescription typeDescription,
ByteBuddy byteBuddy,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Applies a transformation.
|
DynamicType.Builder<?> |
EntryPoint.Unvalidated.transform(TypeDescription typeDescription,
ByteBuddy byteBuddy,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Applies a transformation.
|
TypePool |
Plugin.Engine.PoolStrategy.typePool(ClassFileLocator classFileLocator)
Creates a type pool.
|
TypePool |
Plugin.Engine.PoolStrategy.Default.typePool(ClassFileLocator classFileLocator)
Creates a type pool.
|
TypePool |
Plugin.Engine.PoolStrategy.Eager.typePool(ClassFileLocator classFileLocator)
Creates a type pool.
|
Plugin.Engine |
Plugin.Engine.with(ClassFileLocator classFileLocator)
Appends the supplied class file locator to be queried for class files additionally to any previously registered
class file locators.
|
Plugin.Engine |
Plugin.Engine.Default.with(ClassFileLocator classFileLocator)
Appends the supplied class file locator to be queried for class files additionally to any previously registered
class file locators.
|
Constructor and Description |
---|
Default(ByteBuddy byteBuddy,
Plugin.Engine.TypeStrategy typeStrategy,
Plugin.Engine.PoolStrategy poolStrategy,
ClassFileLocator classFileLocator,
Plugin.Engine.Listener listener,
Plugin.Engine.ErrorHandler errorHandler,
Plugin.Engine.Dispatcher.Factory dispatcherFactory,
ElementMatcher.Junction<? super TypeDescription> ignoredTypeMatcher)
Creates a new default plugin engine.
|
Modifier and Type | Interface and Description |
---|---|
interface |
DynamicType
A dynamic type that is created at runtime, usually as the result of applying a
DynamicType.Builder or as the result of an
AuxiliaryType . |
static interface |
DynamicType.Loaded<T>
A dynamic type that has been loaded into the running instance of the Java virtual machine.
|
static interface |
DynamicType.Unloaded<T>
A dynamic type that has not yet been loaded by a given
ClassLoader . |
Modifier and Type | Class and Description |
---|---|
static class |
ClassFileLocator.Compound
A compound
ClassFileLocator that chains several locators. |
static class |
ClassFileLocator.Filtering
A class file locator that only applies for matched names.
|
static class |
ClassFileLocator.ForClassLoader
A class file locator that queries a class loader for binary representations of class files.
|
static class |
ClassFileLocator.ForClassLoader.WeaklyReferenced
A class file locator that queries a class loader for binary representations of class files.
|
static class |
ClassFileLocator.ForFolder
A class file locator that finds files from a standardized Java folder structure with
folders donating packages and class files being saved as
<classname>.class files
within their package folder. |
static class |
ClassFileLocator.ForInstrumentation
A Java agent that allows the location of class files by emulating a retransformation.
|
static class |
ClassFileLocator.ForJarFile
A class file locator that locates classes within a Java jar file.
|
static class |
ClassFileLocator.ForModule
A class file locator that locates class files by querying a Java module's
getResourceAsStream method. |
static class |
ClassFileLocator.ForModule.WeaklyReferenced
A class file locator for a Java module that only references this module weakly.
|
static class |
ClassFileLocator.ForModuleFile
A class file locator that locates classes within a Java jmod file.
|
static class |
ClassFileLocator.ForUrl
A class file locator that reads class files from one or several URLs.
|
static class |
ClassFileLocator.NoOp
A class file locator that cannot locate any class files.
|
static class |
ClassFileLocator.PackageDiscriminating
A class file locator that discriminates by a type's package.
|
static class |
ClassFileLocator.Simple
A simple class file locator that returns class files from a selection of given types.
|
static class |
DynamicType.Default
A default implementation of a dynamic type.
|
protected static class |
DynamicType.Default.Loaded<T>
A default implementation of a loaded dynamic type.
|
static class |
DynamicType.Default.Unloaded<T>
A default implementation of an unloaded dynamic type.
|
Modifier and Type | Method and Description |
---|---|
static ClassFileLocator |
ClassFileLocator.ForInstrumentation.fromInstalledAgent(ClassLoader classLoader)
Returns an agent-based class file locator for the given class loader and an already installed
Byte Buddy-agent.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.of(ClassLoader classLoader)
Creates a class file locator for a given class loader.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.WeaklyReferenced.of(ClassLoader classLoader)
Creates a class file locator for a given class loader.
|
static ClassFileLocator |
ClassFileLocator.Simple.of(DynamicType dynamicType)
Creates a class file locator that represents all types of a dynamic type.
|
static ClassFileLocator |
ClassFileLocator.ForJarFile.of(File file)
Creates a new class file locator for the given jar file.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.of(File file)
Returns a class file locator for the given module file.
|
static ClassFileLocator |
ClassFileLocator.ForInstrumentation.of(Instrumentation instrumentation,
Class<?> type)
Returns a class file locator that is capable of locating a class file for the given type using the given instrumentation instance.
|
static ClassFileLocator |
ClassFileLocator.ForModule.of(JavaModule module)
Returns a class file locator for the provided module.
|
static ClassFileLocator |
ClassFileLocator.ForModule.WeaklyReferenced.of(JavaModule module)
Creates a class file locator for a Java module where the module is referenced weakly.
|
static ClassFileLocator |
ClassFileLocator.Simple.of(Map<TypeDescription,byte[]> binaryRepresentations)
Creates a class file locator that represents all types of a dynamic type.
|
static ClassFileLocator |
ClassFileLocator.Simple.of(String typeName,
byte[] binaryRepresentation)
Creates a class file locator for a single known type.
|
static ClassFileLocator |
ClassFileLocator.ForModule.ofBootLayer()
Returns a class file locator that exposes all class files of the boot module layer.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.ofBootLoader()
Creates a class file locator that queries the boot loader.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.ofBootPath()
Creates a new class file locator for this VM's boot module path.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.ofBootPath(File bootPath)
Creates a new class file locator for a Java boot module path.
|
static ClassFileLocator |
ClassFileLocator.ForJarFile.ofClassPath()
Resolves a class file locator for the class path that reads class files directly from the file system.
|
static ClassFileLocator |
ClassFileLocator.ForJarFile.ofClassPath(String classPath)
Resolves a class file locator for the class path that reads class files directly from the file system.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.ofModulePath()
Resolves a class file locator for this VM's Java module path that reads class files directly from the file system.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.ofModulePath(String modulePath)
Resolves a class file locator for a Java module path that reads class files directly from the file system.
|
static ClassFileLocator |
ClassFileLocator.ForModuleFile.ofModulePath(String modulePath,
String baseFolder)
Resolves a class file locator for a Java module path that reads class files directly from the file system.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.ofPlatformLoader()
Creates a class file locator that queries the plaform class loader or the extension class loader if the
current VM is not at least of version 9.
|
static ClassFileLocator |
ClassFileLocator.Simple.ofResources(Map<String,byte[]> binaryRepresentations)
Creates a class file locator of a map of resources where class files are mapped by their path and file extension.
|
static ClassFileLocator |
ClassFileLocator.ForJarFile.ofRuntimeJar()
Resolves a class file locator for the runtime jar.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.ofSystemLoader()
Creates a class file locator that queries the system class loader.
|
Constructor and Description |
---|
Compound(ClassFileLocator... classFileLocator)
Creates a new compound class file locator.
|
Filtering(ElementMatcher<? super String> matcher,
ClassFileLocator delegate)
Creates a new filtering class file locator.
|
Constructor and Description |
---|
Compound(List<? extends ClassFileLocator> classFileLocators)
Creates a new compound class file locator.
|
PackageDiscriminating(Map<String,ClassFileLocator> classFileLocators)
Creates a new package-discriminating class file locator.
|
Modifier and Type | Method and Description |
---|---|
ClassReloadingStrategy |
ClassReloadingStrategy.reset(ClassFileLocator classFileLocator,
Class<?>... type)
Resets all classes to their original definition.
|
abstract void |
ClassReloadingStrategy.Strategy.reset(Instrumentation instrumentation,
ClassFileLocator classFileLocator,
List<Class<?>> types)
Resets the provided types to their original format.
|
Modifier and Type | Field and Description |
---|---|
protected ClassFileLocator |
TypeWriter.Default.ForInlining.classFileLocator
The class file locator for locating the original type's class file.
|
Modifier and Type | Method and Description |
---|---|
static <U> TypeWriter<U> |
TypeWriter.Default.forDecoration(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
List<? extends DynamicType> auxiliaryTypes,
List<? extends MethodDescription> methods,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
ClassFileLocator classFileLocator)
Creates a type writer for decorating a type.
|
static <U> TypeWriter<U> |
TypeWriter.Default.forRebasing(MethodRegistry.Prepared methodRegistry,
List<? extends DynamicType> auxiliaryTypes,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRebaseResolver methodRebaseResolver)
Creates a type writer for rebasing a type.
|
static <U> TypeWriter<U> |
TypeWriter.Default.forRedefinition(MethodRegistry.Prepared methodRegistry,
List<? extends DynamicType> auxiliaryTypes,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a type writer for redefining a type.
|
Constructor and Description |
---|
ForInlining(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a new inlining type writer.
|
WithDecorationOnly(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
List<? extends DynamicType> auxiliaryTypes,
MethodList<?> methods,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
ClassFileLocator classFileLocator)
Creates a new inlining type writer that only applies a decoration.
|
WithFullProcessing(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
TypeWriter.FieldPool fieldPool,
TypeWriter.RecordComponentPool recordComponentPool,
List<? extends DynamicType> auxiliaryTypes,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
MethodList<?> instrumentedMethods,
RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
TypePool typePool,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRegistry.Prepared methodRegistry,
Implementation.Target.Factory implementationTargetFactory,
MethodRebaseResolver methodRebaseResolver)
Creates a new inlining type writer that fully reprocesses a type.
|
Modifier and Type | Field and Description |
---|---|
protected ClassFileLocator |
AbstractInliningDynamicTypeBuilder.classFileLocator
The class file locator for locating the original type's class file.
|
Constructor and Description |
---|
AbstractInliningDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
FieldRegistry fieldRegistry,
MethodRegistry methodRegistry,
RecordComponentRegistry recordComponentRegistry,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
VisibilityBridgeStrategy visibilityBridgeStrategy,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
List<? extends DynamicType> auxiliaryTypes,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates an inlining dynamic type builder.
|
DecoratingDynamicTypeBuilder(TypeDescription instrumentedType,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
ClassFileLocator classFileLocator)
Creates a new decorating dynamic type builder.
|
DecoratingDynamicTypeBuilder(TypeDescription instrumentedType,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
List<DynamicType> auxiliaryTypes,
ClassFileLocator classFileLocator)
Creates a new decorating dynamic type builder.
|
RebaseDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
VisibilityBridgeStrategy visibilityBridgeStrategy,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Creates a rebase dynamic type builder.
|
RebaseDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
FieldRegistry fieldRegistry,
MethodRegistry methodRegistry,
RecordComponentRegistry recordComponentRegistry,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
VisibilityBridgeStrategy visibilityBridgeStrategy,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
List<? extends DynamicType> auxiliaryTypes,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Creates a rebase dynamic type builder.
|
RedefinitionDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
VisibilityBridgeStrategy visibilityBridgeStrategy,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a redefinition dynamic type builder.
|
RedefinitionDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
FieldRegistry fieldRegistry,
MethodRegistry methodRegistry,
RecordComponentRegistry recordComponentRegistry,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
VisibilityBridgeStrategy visibilityBridgeStrategy,
ClassWriterStrategy classWriterStrategy,
LatentMatcher<? super MethodDescription> ignoredMethods,
List<? extends DynamicType> auxiliaryTypes,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a redefinition dynamic type builder.
|
Modifier and Type | Field and Description |
---|---|
protected ClassFileLocator |
TypePool.Default.classFileLocator
The locator to query for finding binary data of a type.
|
Modifier and Type | Method and Description |
---|---|
static TypePool |
TypePool.Default.of(ClassFileLocator classFileLocator)
Creates a default
TypePool that looks up data by querying the supplied class
file locator. |
static TypePool |
TypePool.Default.WithLazyResolution.of(ClassFileLocator classFileLocator)
Creates a default
TypePool with lazy resolution that looks up data by querying the supplied class
file locator. |
Constructor and Description |
---|
Default(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode)
Creates a new default type pool without a parent pool.
|
Default(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode,
TypePool parentPool)
Creates a new default type pool.
|
WithLazyResolution(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode)
Creates a new default type pool with lazy resolution and without a parent pool.
|
WithLazyResolution(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode,
TypePool parentPool)
Creates a new default type pool with lazy resolution.
|
Modifier and Type | Method and Description |
---|---|
static JavaConstant |
JavaConstant.Simple.ofDescription(Object value,
ClassFileLocator classFileLocator)
Creates a Java constant value from a
java.lang.constant.ConstantDesc . |
Copyright © 2014–2024. All rights reserved.