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.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. |
Modifier and Type | Method and Description |
---|---|
<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 | Method and Description |
---|---|
ClassFileLocator |
AgentBuilder.BinaryLocator.classFileLocator(ClassLoader classLoader)
Creates a class file locator for the given class loader.
|
ClassFileLocator |
AgentBuilder.BinaryLocator.Default.classFileLocator(ClassLoader classLoader) |
ClassFileLocator |
AgentBuilder.BinaryLocator.ClassLoading.classFileLocator(ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
byte[] |
AgentBuilder.Default.Transformation.Resolution.apply(AgentBuilder.InitializationStrategy initializationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.TypeStrategy typeStrategy,
ByteBuddy byteBuddy,
AgentBuilder.Default.NativeMethodStrategy methodNameTransformer,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
AccessControlContext accessControlContext,
AgentBuilder.Listener listener)
Transforms a type or returns
null if a type is not to be transformed. |
byte[] |
AgentBuilder.Default.Transformation.Resolution.Unresolved.apply(AgentBuilder.InitializationStrategy initializationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.TypeStrategy typeStrategy,
ByteBuddy byteBuddy,
AgentBuilder.Default.NativeMethodStrategy methodNameTransformer,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
AccessControlContext accessControlContext,
AgentBuilder.Listener listener) |
byte[] |
AgentBuilder.Default.Transformation.Simple.Resolution.apply(AgentBuilder.InitializationStrategy initializationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.TypeStrategy typeStrategy,
ByteBuddy byteBuddy,
AgentBuilder.Default.NativeMethodStrategy methodNameTransformer,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
AccessControlContext accessControlContext,
AgentBuilder.Listener listener) |
DynamicType.Builder<?> |
AgentBuilder.TypeStrategy.builder(TypeDescription typeDescription,
ByteBuddy byteBuddy,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Creates a type builder for a given type.
|
protected ClassDefinition |
AgentBuilder.RedefinitionStrategy.Collector.ForRedefinition.Entry.resolve(AgentBuilder.InitializationStrategy initializationStrategy,
ClassFileLocator classFileLocator,
AgentBuilder.TypeStrategy typeStrategy,
ByteBuddy byteBuddy,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
AccessControlContext accessControlContext,
AgentBuilder.Listener listener)
Resolves this entry into a fully defined class redefinition.
|
TypePool |
AgentBuilder.BinaryLocator.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
TypePool |
AgentBuilder.BinaryLocator.Default.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader) |
TypePool |
AgentBuilder.BinaryLocator.ClassLoading.typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader) |
Modifier and Type | Class and Description |
---|---|
static class |
ClassFileLocator.AgentBased
A Java agent that allows the location of class files by emulating a retransformation.
|
static class |
ClassFileLocator.Compound
A compound
ClassFileLocator that chains several locators. |
static class |
ClassFileLocator.ForClassLoader
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.ForJarFile
A class file locator that locates classes within a Java jar file.
|
static class |
ClassFileLocator.NoOp
A class file locator that cannot locate any class files.
|
static class |
ClassFileLocator.Simple
A simple class file locator that returns class files from a selection of given types.
|
Modifier and Type | Method and Description |
---|---|
static ClassFileLocator |
ClassFileLocator.AgentBased.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.AgentBased.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.Simple.of(String typeName,
byte[] binaryRepresentation)
Creates a class file locator for a single known type.
|
static ClassFileLocator |
ClassFileLocator.Simple.of(String typeName,
byte[] binaryRepresentation,
ClassFileLocator fallback)
Creates a class file locator for a single known type with an additional fallback locator.
|
static ClassFileLocator |
ClassFileLocator.ForClassLoader.ofClassPath()
Creates a class file locator that queries the system class loader.
|
Modifier and Type | Method and Description |
---|---|
static ClassFileLocator |
ClassFileLocator.Simple.of(String typeName,
byte[] binaryRepresentation,
ClassFileLocator fallback)
Creates a class file locator for a single known type with an additional fallback locator.
|
Constructor and Description |
---|
Compound(ClassFileLocator... classFileLocator)
Creates a new compound 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 | Method and Description |
---|---|
static <U> TypeWriter<U> |
TypeWriter.Default.forRebasing(MethodRegistry.Compiled methodRegistry,
TypeWriter.FieldPool fieldPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRebaseResolver methodRebaseResolver)
Creates a type writer for rebasing a type.
|
static <U> TypeWriter<U> |
TypeWriter.Default.forRedefinition(MethodRegistry.Compiled methodRegistry,
TypeWriter.FieldPool fieldPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a type writer for redefining a type.
|
protected static ClassWriter |
TypeWriter.Default.FrameComputingClassWriter.of(ClassReader classReader,
int flags,
ClassFileLocator classFileLocator) |
Constructor and Description |
---|
ForInlining(TypeDescription instrumentedType,
TypeWriter.FieldPool fieldPool,
TypeWriter.MethodPool methodPool,
List<DynamicType> explicitAuxiliaryTypes,
MethodList<?> instrumentedMethods,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRebaseResolver methodRebaseResolver)
Creates a new default type writer for creating a new type that is not based on an existing class file.
|
Constructor and Description |
---|
RebaseDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
LatentMatcher<? super MethodDescription> ignoredMethods,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodNameTransformer methodNameTransformer)
Creates a rebase dynamic type builder.
|
RebaseDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
FieldRegistry fieldRegistry,
MethodRegistry methodRegistry,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
LatentMatcher<? super MethodDescription> ignoredMethods,
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,
LatentMatcher<? super MethodDescription> ignoredMethods,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a redefinition dynamic type builder.
|
RedefinitionDynamicTypeBuilder(InstrumentedType.WithFlexibleName instrumentedType,
FieldRegistry fieldRegistry,
MethodRegistry methodRegistry,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
Implementation.Context.Factory implementationContextFactory,
MethodGraph.Compiler methodGraphCompiler,
TypeValidation typeValidation,
LatentMatcher<? super MethodDescription> ignoredMethods,
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.ClassLoading.of(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Returns a class loading type pool that uses a simple cache.
|
static TypePool |
TypePool.Default.Precomputed.withObjectType(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode)
Creates a new precomputed type pool with the
Object type being precomputed. |
Constructor and Description |
---|
ClassLoading(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a class loading type pool.
|
Default(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode)
Creates a new default type pool.
|
Precomputed(TypePool.CacheProvider cacheProvider,
ClassFileLocator classFileLocator,
TypePool.Default.ReaderMode readerMode,
Map<String,TypeDescription> precomputed)
Creates a new precomputed type pool.
|
Copyright © 2014–2016. All rights reserved.