Package 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.
-
Interface Summary Interface Description ClassFileLocator Locates a class file or its byte array representation when it is given its type description.ClassFileLocator.AgentBased.ClassLoadingDelegate A delegate that is queried for loading a class.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher Representation of a JavaField
.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Initializable An uninitialized version of a dispatcher for extracting a class loader's loaded classes.ClassFileLocator.AgentBased.Dispatcher A dispatcher to interact with theInstrumentation
API.ClassFileLocator.Resolution Represents a class file as binary data.DynamicType A dynamic type that is created at runtime, usually as the result of applying aDynamicType.Builder
or as the result of anAuxiliaryType
.DynamicType.Builder<T> A builder for creating a dynamic type.DynamicType.Builder.FieldDefinition<S> A builder for a field definition.DynamicType.Builder.FieldDefinition.Optional<U> A builder for an optional field definition.DynamicType.Builder.FieldDefinition.Optional.Valuable<V> A builder for an optional field definition that allows for defining a value.DynamicType.Builder.FieldDefinition.Valuable<U> A builder for a field definition that allows for defining a value.DynamicType.Builder.InnerTypeDefinition<S> An inner type definition for defining a type that is contained within another type, method or constructor.DynamicType.Builder.InnerTypeDefinition.ForType<U> An inner type definition for defining a type that is contained within another type.DynamicType.Builder.MethodDefinition<S> A builder for a method definition.DynamicType.Builder.MethodDefinition.ExceptionDefinition<U> A builder for defining an implementation of a method and optionally defining a type variable or thrown exception.DynamicType.Builder.MethodDefinition.ImplementationDefinition<U> A builder for defining an implementation of a method.DynamicType.Builder.MethodDefinition.ImplementationDefinition.Optional<V> A builder for optionally defining an implementation of a method.DynamicType.Builder.MethodDefinition.ParameterDefinition<U> A builder for defining an implementation of a method and optionally defining a type variable, thrown exception or method parameter.DynamicType.Builder.MethodDefinition.ParameterDefinition.Annotatable<V> A builder for optionally defining an annotation on a parameter.DynamicType.Builder.MethodDefinition.ParameterDefinition.Initial<V> A builder for defining an implementation of a method and optionally defining a type variable, thrown exception or method parameter.DynamicType.Builder.MethodDefinition.ParameterDefinition.Simple<V> A builder for defining an implementation of a method and optionally defining a type variable, thrown exception or a parameter type.DynamicType.Builder.MethodDefinition.ParameterDefinition.Simple.Annotatable<V> A builder for optionally defining an annotation on a parameter.DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<U> A builder for a method definition with a receiver type.DynamicType.Builder.MethodDefinition.TypeVariableDefinition<U> A builder for defining an implementation of a method and optionally defining a type variable.DynamicType.Builder.MethodDefinition.TypeVariableDefinition.Annotatable<V> A builder for optionally defining an annotation for a type variable.DynamicType.Builder.RecordComponentDefinition<S> A builder for a record component definition.DynamicType.Builder.RecordComponentDefinition.Optional<U> ADynamicType.Builder.RecordComponentDefinition
as an optional build step.DynamicType.Builder.TypeVariableDefinition<S> A builder for a type variable definition.DynamicType.Default.Dispatcher A dispatcher that allows for file copy operations based on NIO2 if available.DynamicType.Loaded<T> A dynamic type that has been loaded into the running instance of the Java virtual machine.DynamicType.Unloaded<T> A dynamic type that has not yet been loaded by a givenClassLoader
.NexusAccessor.Dispatcher A dispatcher for registering type initializers in theNexus
.Transformer<T> A transformer is responsible for transforming an object into a compatible instance of the same type.TypeResolutionStrategy A type resolution strategy is responsible for loading a class and for initializing itsLoadedTypeInitializer
s.TypeResolutionStrategy.Resolved A resolvedTypeResolutionStrategy
.VisibilityBridgeStrategy Implements a strategy for deciding if a visibility bridge should be generated. -
Class Summary Class Description ClassFileLocator.AgentBased A Java agent that allows the location of class files by emulating a retransformation.ClassFileLocator.AgentBased.ClassLoadingDelegate.Default A default implementation of a class loading delegate.ClassFileLocator.AgentBased.ClassLoadingDelegate.Explicit A class loading delegate that allows the location of explicitly registered classes that cannot be located by a class loader directly.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader A class loading delegate that accounts for asun.reflect.DelegatingClassLoader
which cannot load its own classes by name.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Resolved Represents a field that could be located.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Unresolved Represents a field that could not be located.ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm A dispatcher for a Java 6 capable VM.ClassFileLocator.AgentBased.ExtractionClassFileTransformer A non-operational class file transformer that remembers the binary format of a given class.ClassFileLocator.Compound A compoundClassFileLocator
that chains several locators.ClassFileLocator.ForClassLoader A class file locator that queries a class loader for binary representations of class files.ClassFileLocator.ForClassLoader.WeaklyReferenced A class file locator that queries a class loader for binary representations of class files.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.ClassFileLocator.ForJarFile A class file locator that locates classes within a Java jar file.ClassFileLocator.ForModule A class file locator that locates class files by querying a Java module'sgetResourceAsStream
method.ClassFileLocator.ForModule.WeaklyReferenced A class file locator for a Java module that only references this module weakly.ClassFileLocator.ForModuleFile A class file locator that locates classes within a Java jmod file.ClassFileLocator.ForUrl A class file locator that reads class files from one or several URLs.ClassFileLocator.ForUrl.ClassLoaderCreationAction An action to create a class loader with the purpose of locating classes from an URL location.ClassFileLocator.PackageDiscriminating A class file locator that discriminates by a type's package.ClassFileLocator.Resolution.Explicit Represents a byte array as binary data.ClassFileLocator.Resolution.Illegal A canonical representation of an illegal binary representation.ClassFileLocator.Simple A simple class file locator that returns class files from a selection of given types.DynamicType.Builder.AbstractBase<S> An abstract base implementation of a dynamic type builder.DynamicType.Builder.AbstractBase.Adapter<U> An adapter implementation of a dynamic type builder.DynamicType.Builder.AbstractBase.Delegator<U> A delegator for a dynamic type builder delegating all invocations to another dynamic type builder.DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U> An abstract base implementation for an optional field definition.DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U> An abstract base implementation of an optional field definition that allows for defining a value.DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter<V> An adapter for an optional field definition that allows for defining a value.DynamicType.Builder.MethodDefinition.AbstractBase<U> An abstract base implementation of a method definition.DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<V> An adapter implementation of a method definition.DynamicType.Builder.MethodDefinition.ExceptionDefinition.AbstractBase<V> An abstract base implementation for defining an implementation of a method and optionally defining a type variable or thrown exception.DynamicType.Builder.MethodDefinition.ImplementationDefinition.AbstractBase<V> An abstract base implementation for a builder optionally defining an implementation of a method.DynamicType.Builder.MethodDefinition.ParameterDefinition.AbstractBase<V> An abstract base implementation for defining an implementation of a method and optionally defining a type variable, thrown exception or parameter type.DynamicType.Builder.MethodDefinition.ParameterDefinition.Annotatable.AbstractBase<W> An abstract base implementation for defining an annotation on a parameter.DynamicType.Builder.MethodDefinition.ParameterDefinition.Annotatable.AbstractBase.Adapter<X> An adapter implementation for defining an annotation on a parameter.DynamicType.Builder.MethodDefinition.ParameterDefinition.Initial.AbstractBase<W> An abstract base implementation for an initial parameter definition.DynamicType.Builder.MethodDefinition.ParameterDefinition.Simple.AbstractBase<W> An abstract base implementation of an exception definition.DynamicType.Builder.MethodDefinition.ParameterDefinition.Simple.Annotatable.AbstractBase<W> An abstract base implementation of a simple parameter definition.DynamicType.Builder.MethodDefinition.ParameterDefinition.Simple.Annotatable.AbstractBase.Adapter<X> An adapter implementation of a simple parameter definition.DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase<V> An abstract base implementation of a method definition that can accept a receiver type.DynamicType.Builder.MethodDefinition.TypeVariableDefinition.AbstractBase<V> An abstract base implementation for defining an implementation of a method and optionally defining a type variable.DynamicType.Builder.MethodDefinition.TypeVariableDefinition.Annotatable.AbstractBase<W> An abstract base implementation for defining an annotation on a parameter.DynamicType.Builder.MethodDefinition.TypeVariableDefinition.Annotatable.AbstractBase.Adapter<X> An adapter implementation for an annotatable type variable definition.DynamicType.Builder.RecordComponentDefinition.Optional.AbstractBase<U> An abstract base implementation of a record definition.DynamicType.Builder.TypeVariableDefinition.AbstractBase<U> An abstract base implementation of a type variable definition.DynamicType.Default A default implementation of a dynamic type.DynamicType.Default.Dispatcher.ForJava7CapableVm A dispatcher for VMs that are capable of NIO2.DynamicType.Default.Loaded<T> A default implementation of a loaded dynamic type.DynamicType.Default.Unloaded<T> A default implementation of an unloaded dynamic type.Nexus This nexus is a global dispatcher for initializing classes withLoadedTypeInitializer
s.NexusAccessor The Nexus accessor is creating a VM-global singletonNexus
such that it can be seen by all class loaders of a virtual machine.NexusAccessor.Dispatcher.Available An enabled dispatcher for registering a type initializer in aNexus
.NexusAccessor.Dispatcher.Unavailable A disabled dispatcher where aNexus
is not available.NexusAccessor.InitializationAppender An initialization appender that looks up a loaded type initializer from Byte Buddy'sNexus
.TargetType This type is used as a place holder for creating methods or fields that refer to the type that currently subject of creation within aDynamicType.Builder
.Transformer.Compound<S> A compound transformer.Transformer.ForField A transformer for a field that delegates to another transformer that transforms aFieldDescription.Token
.Transformer.ForField.FieldModifierTransformer A transformer for a field's modifiers.Transformer.ForField.TransformedField An implementation of a transformed field.Transformer.ForMethod A transformer for a field that delegates to another transformer that transforms aMethodDescription.Token
.Transformer.ForMethod.MethodModifierTransformer A transformer for a method's modifiers.Transformer.ForMethod.TransformedMethod The transformed method.TypeResolutionStrategy.Active A type resolution strategy that applies allLoadedTypeInitializer
as a part of class loading using reflection.TypeResolutionStrategy.Active.Resolved A resolved version of an active type resolution strategy. -
Enum Summary Enum Description ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.CreationAction An action for creating a dispatcher.ClassFileLocator.AgentBased.Dispatcher.CreationAction An action to create aClassFileLocator.AgentBased.Dispatcher
.ClassFileLocator.AgentBased.Dispatcher.ForLegacyVm A dispatcher for a VM that does not support retransformation.ClassFileLocator.ForClassLoader.BootLoaderProxyCreationAction A privileged action for creating a proxy class loader for the boot class loader.ClassFileLocator.NoOp A class file locator that cannot locate any class files.DynamicType.Default.Dispatcher.CreationAction An action for creating a dispatcher.DynamicType.Default.Dispatcher.ForLegacyVm A legacy dispatcher that is not capable of NIO.NexusAccessor.Dispatcher.CreationAction Creates a new dispatcher for accessing aNexus
.Transformer.NoOp A non-operational transformer that returns the received instance.TypeResolutionStrategy.Disabled A type resolution strategy that does not allow for explicit loading of a class and that does not inject any code into the type initializer.TypeResolutionStrategy.Lazy A type resolution strategy that does not apply anyLoadedTypeInitializer
s but only loads all types.TypeResolutionStrategy.Passive A type resolution strategy that applies allLoadedTypeInitializer
after class loading using reflection.VisibilityBridgeStrategy.Default Default implementations of visibility bridge strategies.