Package net.bytebuddy.dynamic.scaffold
Class MethodRegistry.Default.Compiled
java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodRegistry.Default.Compiled
- All Implemented Interfaces:
MethodRegistry.Compiled
,TypeWriter.MethodPool
- Enclosing class:
MethodRegistry.Default
@Enhance
protected static class MethodRegistry.Default.Compiled
extends Object
implements MethodRegistry.Compiled
A compiled version of a default method registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An entry of a compiled method registry.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool
TypeWriter.MethodPool.Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinkedHashMap
<MethodDescription, MethodRegistry.Default.Compiled.Entry> A map of all method descriptions mapped to their handling entries.private final TypeDescription
The instrumented type.private final LoadedTypeInitializer
The loaded type initializer of the instrumented type.private final MethodList
<?> The declared or virtually inherited methods of this type.private final boolean
true
if the created type supports bridge methods.private final TypeInitializer
The type initializer of the instrumented type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Compiled
(TypeDescription instrumentedType, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, MethodList<?> methods, LinkedHashMap<MethodDescription, MethodRegistry.Default.Compiled.Entry> implementations, boolean supportsBridges) Creates a new compiled version of a default method registry. -
Method Summary
Modifier and TypeMethodDescriptionMethodList
<?> Returns a list of all methods that should be instrumented.Returns the instrumented type that is to be created.Returns the loaded type initializer of the instrumented type.MethodList
<?> Returns the declared or virtually inherited methods of this type.The type initializer of the instrumented type.target
(MethodDescription methodDescription) Looks up a handler entry for a given method.
-
Field Details
-
instrumentedType
The instrumented type. -
loadedTypeInitializer
The loaded type initializer of the instrumented type. -
typeInitializer
The type initializer of the instrumented type. -
methods
The declared or virtually inherited methods of this type. -
implementations
private final LinkedHashMap<MethodDescription,MethodRegistry.Default.Compiled.Entry> implementationsA map of all method descriptions mapped to their handling entries. -
supportsBridges
private final boolean supportsBridgestrue
if the created type supports bridge methods.
-
-
Constructor Details
-
Compiled
protected Compiled(TypeDescription instrumentedType, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, MethodList<?> methods, LinkedHashMap<MethodDescription, MethodRegistry.Default.Compiled.Entry> implementations, boolean supportsBridges) Creates a new compiled version of a default method registry.- Parameters:
instrumentedType
- The instrumented type.loadedTypeInitializer
- The loaded type initializer of the instrumented type.typeInitializer
- The type initializer of the instrumented type.methods
- The declared or virtually inherited methods of this type.implementations
- A map of all method descriptions mapped to their handling entries.supportsBridges
-true
if the created type supports bridge methods.
-
-
Method Details
-
getInstrumentedType
Returns the instrumented type that is to be created.- Specified by:
getInstrumentedType
in interfaceMethodRegistry.Compiled
- Returns:
- The instrumented type that is to be created.
-
getLoadedTypeInitializer
Returns the loaded type initializer of the instrumented type.- Specified by:
getLoadedTypeInitializer
in interfaceMethodRegistry.Compiled
- Returns:
- The loaded type initializer of the instrumented type.
-
getTypeInitializer
The type initializer of the instrumented type.- Specified by:
getTypeInitializer
in interfaceMethodRegistry.Compiled
- Returns:
- The type initializer of the instrumented type.
-
getMethods
Returns the declared or virtually inherited methods of this type.- Specified by:
getMethods
in interfaceMethodRegistry.Compiled
- Returns:
- The declared or virtually inherited methods of this type.
-
getInstrumentedMethods
Returns a list of all methods that should be instrumented.- Specified by:
getInstrumentedMethods
in interfaceMethodRegistry.Compiled
- Returns:
- A list of all methods that should be instrumented.
-
target
Looks up a handler entry for a given method.- Specified by:
target
in interfaceTypeWriter.MethodPool
- Parameters:
methodDescription
- The method being processed.- Returns:
- A handler entry for the given method.
-