Package net.bytebuddy.dynamic.scaffold
Class MethodRegistry.Default
java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodRegistry.Default
- All Implemented Interfaces:
MethodRegistry
- Enclosing interface:
MethodRegistry
A default implementation of a method registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A compiled version of a default method registry.protected static class
An entry of a default method registry.protected static class
A prepared version of a default method registry.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.MethodRegistry
MethodRegistry.Default, MethodRegistry.Handler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<MethodRegistry.Default.Entry> The list of currently registered entries in their application order. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault()
Creates a new default method registry without entries.private
Default
(List<MethodRegistry.Default.Entry> entries) Creates a new default method registry. -
Method Summary
Modifier and TypeMethodDescriptionappend
(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Appends the given method definition to this method registry, i.e.prepare
(InstrumentedType instrumentedType, MethodGraph.Compiler methodGraphCompiler, TypeValidation typeValidation, VisibilityBridgeStrategy visibilityBridgeStrategy, LatentMatcher<? super MethodDescription> ignoredMethods) Prepares this method registry.prepend
(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Prepends the given method definition to this method registry, i.e.
-
Field Details
-
entries
The list of currently registered entries in their application order.
-
-
Constructor Details
-
Default
public Default()Creates a new default method registry without entries. -
Default
Creates a new default method registry.- Parameters:
entries
- The currently registered entries.
-
-
Method Details
-
prepend
public MethodRegistry prepend(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Prepends the given method definition to this method registry, i.e. this configuration is applied first.- Specified by:
prepend
in interfaceMethodRegistry
- Parameters:
matcher
- A matcher to identify any method that this definition concerns.handler
- The handler to instrument any matched method.attributeAppenderFactory
- A method attribute appender to apply to any matched method.transformer
- The method transformer to be applied to implemented methods.- Returns:
- An adapted version of this method registry.
-
append
public MethodRegistry append(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Appends the given method definition to this method registry, i.e. this configuration is applied last.- Specified by:
append
in interfaceMethodRegistry
- Parameters:
matcher
- A matcher to identify all entries that are to be matched.handler
- The handler to instrument any matched method.attributeAppenderFactory
- A method attribute appender to apply to any matched method.transformer
- The method transformer to be applied to implemented methods.- Returns:
- An adapted version of this method registry.
-
prepare
public MethodRegistry.Prepared prepare(InstrumentedType instrumentedType, MethodGraph.Compiler methodGraphCompiler, TypeValidation typeValidation, VisibilityBridgeStrategy visibilityBridgeStrategy, LatentMatcher<? super MethodDescription> ignoredMethods) Prepares this method registry.- Specified by:
prepare
in interfaceMethodRegistry
- Parameters:
instrumentedType
- The instrumented type that should be created.methodGraphCompiler
- The method graph compiler to be used for analyzing the fully assembled instrumented type.typeValidation
- Determines if a type should be explicitly validated.visibilityBridgeStrategy
- The visibility bridge strategy to apply.ignoredMethods
- A filter that only matches methods that should be instrumented.- Returns:
- A prepared version of this method registry.
-