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 classMethodRegistry.Default.Compiled.EntryAn 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>implementationsA map of all method descriptions mapped to their handling entries.private TypeDescriptioninstrumentedTypeThe instrumented type.private LoadedTypeInitializerloadedTypeInitializerThe loaded type initializer of the instrumented type.private MethodList<?>methodsThe declared or virtually inherited methods of this type.private booleansupportsBridgestrueif the created type supports bridge methods.private TypeInitializertypeInitializerThe type initializer of the instrumented type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCompiled(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.TypeDescriptiongetInstrumentedType()Returns the instrumented type that is to be created.LoadedTypeInitializergetLoadedTypeInitializer()Returns the loaded type initializer of the instrumented type.MethodList<?>getMethods()Returns the declared or virtually inherited methods of this type.TypeInitializergetTypeInitializer()The type initializer of the instrumented type.TypeWriter.MethodPool.Recordtarget(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
trueif 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-trueif the created type supports bridge methods.
-
-
Method Detail
-
getInstrumentedType
public TypeDescription getInstrumentedType()
Returns the instrumented type that is to be created.- Specified by:
getInstrumentedTypein 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:
getLoadedTypeInitializerin interfaceMethodRegistry.Compiled- Returns:
- The loaded type initializer of the instrumented type.
-
getTypeInitializer
public TypeInitializer getTypeInitializer()
The type initializer of the instrumented type.- Specified by:
getTypeInitializerin 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:
getMethodsin 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:
getInstrumentedMethodsin 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:
targetin interfaceTypeWriter.MethodPool- Parameters:
methodDescription- The method being processed.- Returns:
- A handler entry for the given method.
-
-