Package 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. These utilities allow to write a Java type in a more modular manner and take away
complexity from the actual implementations of
DynamicType.Builder
.-
Interface Summary Interface Description ClassWriterStrategy A class writer strategy is responsible for the creation of aClassWriter
when creating a type.FieldLocator A field locator offers an interface for locating a field that is declared by a specified type.FieldLocator.Factory A factory for creating aFieldLocator
.FieldLocator.Resolution A resolution for a field lookup.FieldRegistry A field registry represents an extendable collection of fields which are identified by their names that are mapped to a givenFieldAttributeAppender
.FieldRegistry.Compiled Represents a compiled field registry.InstrumentedType Implementations of this interface represent an instrumented type that is subject to change.InstrumentedType.Factory A factory for creating anInstrumentedType
.InstrumentedType.Prepareable Implementations are able to prepare anInstrumentedType
.InstrumentedType.WithFlexibleName Implementations represent anInstrumentedType
with a flexible name.MethodGraph A method graph represents a view on a set of methods as they are seen from a given type.MethodGraph.Compiler A compiler to produce aMethodGraph
from a given type.MethodGraph.Compiler.Default.Harmonizer<S> A harmonizer is responsible for creating a token that identifies a method's relevant attributes for considering two methods of being equal or not.MethodGraph.Compiler.Default.Key.Store.Entry<W> An entry of a key store.MethodGraph.Compiler.Default.Merger Implementations are responsible for identifying a representative method for aMethodGraph.Node
between several ambiguously resolved methods.MethodGraph.Linked A linked method graph represents a view that additionally exposes information of a given type's super type view and a view on this graph's directly implemented interfaces.MethodGraph.Node Represents a node within a method graph.MethodRegistry A method registry is responsible for storing information on how a method is intercepted.MethodRegistry.Compiled A compiled version of a method registry.MethodRegistry.Handler A handler for implementing a method.MethodRegistry.Handler.Compiled A compiled handler for implementing a method.MethodRegistry.Prepared A method registry that fully prepared the instrumented type.RecordComponentRegistry A record component registry represents an extendable collection of record components which are identified by their names that are mapped to a givenRecordComponentAttributeAppender
.RecordComponentRegistry.Compiled Represents a compiled record component registry.TypeInitializer A type initializer is responsible for defining a type's static initialization block.TypeInitializer.Drain A drain for writing a type initializer.TypeWriter<T> A type writer is a utility for writing an actual class file using the ASM library.TypeWriter.Default.ClassDumpAction.Dispatcher A dispatcher for dumping class files to the file system.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler An initialization handler is responsible for handling the creation of the type initializer.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter A frame writer is responsible for adding empty frames on jump instructions.TypeWriter.Default.ValidatingClassVisitor.Constraint A constraint for members that are legal for a given type.TypeWriter.FieldPool An field pool that allows a lookup for how to implement a field.TypeWriter.FieldPool.Record An entry of a field pool that describes how a field is implemented.TypeWriter.MethodPool An method pool that allows a lookup for how to implement a method.TypeWriter.MethodPool.Record An entry of a method pool that describes how a method is implemented.TypeWriter.RecordComponentPool An record component pool that allows a lookup for how to implement a record component.TypeWriter.RecordComponentPool.Record An entry of a record component pool that describes how a record component is implemented. -
Class Summary Class Description ClassWriterStrategy.FrameComputingClassWriter A class writer that piggy-backs on Byte Buddy'sTypePool
to avoid class loading or look-up errors when redefining a class.FieldLocator.AbstractBase An abstract base implementation of a field locator.FieldLocator.ForClassHierarchy A field locator that looks up fields that are declared within a class's class hierarchy.FieldLocator.ForExactType A field locator that only looks up fields that are declared by a specific type.FieldLocator.ForExactType.Factory A factory for creating aFieldLocator.ForExactType
.FieldLocator.ForTopLevelType A field locator that only locates fields in the top-level type.FieldLocator.Resolution.Simple A simple implementation for a field resolution.FieldRegistry.Default An immutable default implementation of a field registry.FieldRegistry.Default.Compiled A compiled default field registry.FieldRegistry.Default.Compiled.Entry An entry of a compiled field registry.FieldRegistry.Default.Entry An entry of the default field registry.InstrumentedType.Default A default implementation of an instrumented type.InstrumentedType.Frozen A frozen representation of an instrumented type of which the structure must not be modified.MethodGraph.Compiler.AbstractBase An abstract base implementation of a method graph compiler.MethodGraph.Compiler.Default<T> A default implementation of a method graph.MethodGraph.Compiler.Default.Harmonizer.ForJavaMethod.Token A token that identifies a Java method's type by its parameter types only.MethodGraph.Compiler.Default.Harmonizer.ForJVMMethod.Token A token that identifies a Java method's type by its parameter types and return type.MethodGraph.Compiler.Default.Key<S> A key represents a collection of methods within a method graph to later yield a node representing a collection of methods, i.e.MethodGraph.Compiler.Default.Key.Detached A detached version of a key that identifies methods by their JVM signature, i.e.MethodGraph.Compiler.Default.Key.Harmonized<V> A harmonized key represents a key where equality is decided based on tokens that are returned by aMethodGraph.Compiler.Default.Harmonizer
.MethodGraph.Compiler.Default.Key.Store<V> A store for collected methods that are identified by keys.MethodGraph.Compiler.Default.Key.Store.Entry.Ambiguous<U> An entry representing an ambiguous node resolution.MethodGraph.Compiler.Default.Key.Store.Entry.Ambiguous.Node A node implementation representing an ambiguous method resolution.MethodGraph.Compiler.Default.Key.Store.Entry.Initial<U> An entry in its initial state before registering any method as a representative.MethodGraph.Compiler.Default.Key.Store.Entry.Resolved<U> An entry representing a non-ambiguous node resolution.MethodGraph.Compiler.Default.Key.Store.Entry.Resolved.Node A node implementation representing a non-ambiguous method.MethodGraph.Compiler.Default.Key.Store.Graph A graph implementation based on a key store.MethodGraph.Linked.Delegation A simple implementation of a linked method graph that exposes views by delegation to given method graphs.MethodGraph.Node.Simple A simple implementation of a resolved node of a method without bridges.MethodGraph.NodeList A list of nodes.MethodGraph.Simple A simple implementation of a method graph.MethodRegistry.Default A default implementation of a method registry.MethodRegistry.Default.Compiled A compiled version of a default method registry.MethodRegistry.Default.Compiled.Entry An entry of a compiled method registry.MethodRegistry.Default.Entry An entry of a default method registry.MethodRegistry.Default.Prepared A prepared version of a default method registry.MethodRegistry.Default.Prepared.Entry An entry of a prepared method registry.MethodRegistry.Handler.ForAnnotationValue A handler for defining a default annotation value for a method.MethodRegistry.Handler.ForImplementation A handler for a method that is implemented as byte code.MethodRegistry.Handler.ForImplementation.Compiled A compiled handler for implementing a method.MethodRegistry.Handler.ForVisibilityBridge.Compiled A compiled handler for a visibility bridge handler.RecordComponentRegistry.Default An immutable default implementation of a record component registry.RecordComponentRegistry.Default.Compiled A compiled default record component registry.RecordComponentRegistry.Default.Compiled.Entry An entry of a compiled record component registry.RecordComponentRegistry.Default.Entry An entry of the default record component registry.TypeInitializer.Drain.Default A default implementation of a type initializer drain that creates a initializer method.TypeInitializer.Simple A simple, defined type initializer that executes a givenByteCodeAppender
.TypeWriter.Default<S> A default implementation of aTypeWriter
.TypeWriter.Default.ClassDumpAction An action to write a class file to the dumping location.TypeWriter.Default.ClassDumpAction.Dispatcher.Enabled An enabled dispatcher that dumps class files to a given folder.TypeWriter.Default.ForCreation<U> A type writer that creates a class file that is not based upon another, existing class.TypeWriter.Default.ForInlining<U> A type writer that inlines the created type into an existing class file.TypeWriter.Default.ForInlining.ContextRegistry A context registry allows to extract auxiliary types from a lazily created implementation context.TypeWriter.Default.ForInlining.WithDecorationOnly<V> A default type writer that only applies a type decoration.TypeWriter.Default.ForInlining.WithDecorationOnly.LazyFieldList A field list that only reads fields lazy to avoid an eager lookup since fields are often not required.TypeWriter.Default.ForInlining.WithFullProcessing<V> A default type writer that reprocesses a type completely.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending An initialization handler that appends code to a previously visited type initializer.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter.Active An active frame writer that creates the most efficient frame.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain An initialization handler that appends code to a previously visited type initializer with allowing activeTypeInitializer
registrations.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain.WithActiveRecord A code appending initialization handler with a drain that applies an explicit record.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain.WithoutActiveRecord A code appending initialization handler with a drain that does not apply an explicit record.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain An initialization handler that appends code to a previously visited type initializer without allowing activeTypeInitializer
registrations.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain.WithActiveRecord An initialization handler that appends code to a previously visited type initializer without allowing activeTypeInitializer
registrations and with an active record.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain.WithoutActiveRecord An initialization handler that appends code to a previously visited type initializer without allowing activeTypeInitializer
registrations and without an active record.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Creating An initialization handler that creates a new type initializer.TypeWriter.Default.ForInlining.WithFullProcessing.OpenedClassRemapper AClassRemapper
that uses the Byte Buddy-defined API version.TypeWriter.Default.ValidatingClassVisitor A class validator that validates that a class only defines members that are appropriate for the sort of the generated class.TypeWriter.Default.ValidatingClassVisitor.Constraint.Compound A constraint implementation that summarizes several constraints.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClassFileVersion Represents the constraint implied by a class file version.TypeWriter.FieldPool.Record.ForExplicitField A record for a rich field with attributes and a potential default value.TypeWriter.FieldPool.Record.ForImplicitField A record for a simple field without a default value where all of the field's declared annotations are appended.TypeWriter.MethodPool.Record.AccessBridgeWrapper A wrapper that appends accessor bridges for a method's implementation.TypeWriter.MethodPool.Record.AccessBridgeWrapper.AccessorBridge A method representing an accessor bridge method.TypeWriter.MethodPool.Record.AccessBridgeWrapper.BridgeTarget A method representing a bridge's target method in its defined shape.TypeWriter.MethodPool.Record.ForDefinedMethod A base implementation of an abstract entry that defines a method.TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge A record for a visibility bridge.TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge.VisibilityBridge A method describing a visibility bridge.TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue Describes an entry that defines a method with a default annotation value.TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody Describes an entry that defines a method as byte code.TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody Describes an entry that defines a method but without byte code and without an annotation value.TypeWriter.MethodPool.Record.ForNonImplementedMethod A canonical implementation of a method that is not declared but inherited by the instrumented type.TypeWriter.RecordComponentPool.Record.ForExplicitRecordComponent A record for a rich record component with attributes.TypeWriter.RecordComponentPool.Record.ForImplicitRecordComponent A record for a simple field without a default value where all of the record component's declared annotations are appended. -
Enum Summary Enum Description ClassWriterStrategy.Default Default implementations of class writer strategies.FieldLocator.ForClassHierarchy.Factory A factory for creating aFieldLocator.ForClassHierarchy
.FieldLocator.ForTopLevelType.Factory A factory for locating a field in a top-level type.FieldLocator.NoOp A field locator that never discovers a field.FieldLocator.Resolution.Illegal An illegal resolution.FieldRegistry.Compiled.NoOp A no-op field registry that does not register annotations for any field.InstrumentedType.Factory.Default Default implementations of instrumented type factories.MethodGraph.Compiler.Default.Harmonizer.ForJavaMethod A harmonizer for the Java programming language that identifies a method by its parameter types only.MethodGraph.Compiler.Default.Harmonizer.ForJVMMethod A harmonizer for the Java virtual machine's method dispatching rules that identifies a method by its parameter types and return type.MethodGraph.Compiler.Default.Merger.Directional A directional merger that always returns either the left or right method description.MethodGraph.Compiler.ForDeclaredMethods A flat compiler that simply returns the methods that are declared by the instrumented type.MethodGraph.Empty A canonical implementation of an empty method graph.MethodGraph.Node.Sort Represents aMethodGraph.Node
's state.MethodGraph.Node.Unresolved A canonical implementation of an unresolved node.MethodRegistry.Handler.ForAbstractMethod A handler for defining an abstract or native method.MethodRegistry.Handler.ForVisibilityBridge A handler for implementing a visibility bridge.RecordComponentRegistry.Compiled.NoOp A no-op record component registry that does not register annotations for any record component.TypeInitializer.None Canonical implementation of a non-defined type initializer.TypeValidation If type validation is enabled, Byte Buddy performs several checks to ensure that a generated class file is specified in a valid manner.TypeWriter.Default.ClassDumpAction.Dispatcher.Disabled A disabled dispatcher that does not dump any class files.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter.Expanding A frame writer that creates an expanded frame.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter.NoOp A non-operational frame writer.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForAnnotation Represents the constraint of an annotation type.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass Represents the constraint of a class type.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface Represents the constraint of an interface type.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForPackageType Represents the constraint of a package type.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForRecord Represents the constraint of a record type.TypeWriter.FieldPool.Disabled A field pool that does not allow any look ups.TypeWriter.MethodPool.Record.Sort The sort of an entry.TypeWriter.RecordComponentPool.Disabled A record component pool that does not allow any look ups.