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 java.lang.Object implements MethodRegistry.Compiled
A compiled version of a default method registry.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MethodRegistry.Default.Compiled.Entry
An entry of a compiled method registry.-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool
TypeWriter.MethodPool.Record
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedHashMap<MethodDescription,MethodRegistry.Default.Compiled.Entry>
implementations
A map of all method descriptions mapped to their handling entries.private TypeDescription
instrumentedType
The instrumented type.private LoadedTypeInitializer
loadedTypeInitializer
The loaded type initializer of the instrumented type.private MethodList<?>
methods
The declared or virtually inherited methods of this type.private boolean
supportsBridges
true
if the created type supports bridge methods.private TypeInitializer
typeInitializer
The type initializer of the instrumented type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Compiled(TypeDescription instrumentedType, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, MethodList<?> methods, java.util.LinkedHashMap<MethodDescription,MethodRegistry.Default.Compiled.Entry> implementations, boolean supportsBridges)
Creates a new compiled version of a default method registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodList<?>
getInstrumentedMethods()
Returns a list of all methods that should be instrumented.TypeDescription
getInstrumentedType()
Returns the instrumented type that is to be created.LoadedTypeInitializer
getLoadedTypeInitializer()
Returns the loaded type initializer of the instrumented type.MethodList<?>
getMethods()
Returns the declared or virtually inherited methods of this type.TypeInitializer
getTypeInitializer()
The type initializer of the instrumented type.TypeWriter.MethodPool.Record
target(MethodDescription methodDescription)
Looks up a handler entry for a given method.
-
-
-
Field Detail
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type.
-
loadedTypeInitializer
private final LoadedTypeInitializer loadedTypeInitializer
The loaded type initializer of the instrumented type.
-
typeInitializer
private final TypeInitializer typeInitializer
The type initializer of the instrumented type.
-
methods
private final MethodList<?> methods
The declared or virtually inherited methods of this type.
-
implementations
private final java.util.LinkedHashMap<MethodDescription,MethodRegistry.Default.Compiled.Entry> implementations
A map of all method descriptions mapped to their handling entries.
-
supportsBridges
private final boolean supportsBridges
true
if the created type supports bridge methods.
-
-
Constructor Detail
-
Compiled
protected Compiled(TypeDescription instrumentedType, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, MethodList<?> methods, java.util.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 Detail
-
getInstrumentedType
public TypeDescription 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
public LoadedTypeInitializer 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
public TypeInitializer getTypeInitializer()
The type initializer of the instrumented type.- Specified by:
getTypeInitializer
in interfaceMethodRegistry.Compiled
- Returns:
- The type initializer of the instrumented type.
-
getMethods
public MethodList<?> 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
public MethodList<?> 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
public TypeWriter.MethodPool.Record target(MethodDescription methodDescription)
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.
-
-