Package net.bytebuddy.dynamic.scaffold
Class MethodRegistry.Default.Entry
java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodRegistry.Default.Entry
- All Implemented Interfaces:
LatentMatcher<MethodDescription>
- Enclosing class:
MethodRegistry.Default
@Enhance
protected static class MethodRegistry.Default.Entry
extends Object
implements LatentMatcher<MethodDescription>
An entry of a default method registry.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.LatentMatcher
LatentMatcher.Conjunction<S>, LatentMatcher.Disjunction<S>, LatentMatcher.ForFieldToken, LatentMatcher.ForMethodToken, LatentMatcher.ForRecordComponentToken, LatentMatcher.ForSelfDeclaredMethod, LatentMatcher.Resolved<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodAttributeAppender.Factory
A method attribute appender factory to apply to all entries.private final MethodRegistry.Handler
The handler to apply to all matched entries.private final LatentMatcher
<? super MethodDescription> The latent method matcher that this entry represents.private final Transformer
<MethodDescription> The method transformer to be applied to implemented methods. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Entry
(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Creates a new entry. -
Method Summary
Modifier and TypeMethodDescriptionprotected MethodRegistry.Default.Prepared.Entry
asPreparedEntry
(TypeDescription instrumentedType, MethodDescription methodDescription, Set<MethodDescription.TypeToken> methodTypes, Visibility visibility) Transforms this entry into a prepared state.protected MethodRegistry.Default.Prepared.Entry
asPreparedEntry
(TypeDescription instrumentedType, MethodDescription methodDescription, Visibility visibility) Transforms this entry into a prepared state.protected MethodRegistry.Default.Prepared.Entry
asSupplementaryEntry
(MethodDescription methodDescription) Returns a prepared entry for a supplementary method.protected MethodRegistry.Handler
Returns this entry's handler.ElementMatcher
<? super MethodDescription> resolve
(TypeDescription typeDescription) Resolves the element matcher this instance represents for the supplied type description.
-
Field Details
-
matcher
The latent method matcher that this entry represents. -
handler
The handler to apply to all matched entries. -
attributeAppenderFactory
A method attribute appender factory to apply to all entries. -
transformer
The method transformer to be applied to implemented methods.
-
-
Constructor Details
-
Entry
protected Entry(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer) Creates a new entry.- Parameters:
matcher
- The latent method matcher that this entry represents.handler
- The handler to apply to all matched entries.attributeAppenderFactory
- A method attribute appender factory to apply to all entries.transformer
- The method transformer to be applied to implemented methods.
-
-
Method Details
-
asPreparedEntry
protected MethodRegistry.Default.Prepared.Entry asPreparedEntry(TypeDescription instrumentedType, MethodDescription methodDescription, Visibility visibility) Transforms this entry into a prepared state.- Parameters:
instrumentedType
- The instrumented type.methodDescription
- The non-transformed method to be implemented.visibility
- The represented method's minimum visibility.- Returns:
- A prepared version of this entry.
-
asPreparedEntry
protected MethodRegistry.Default.Prepared.Entry asPreparedEntry(TypeDescription instrumentedType, MethodDescription methodDescription, Set<MethodDescription.TypeToken> methodTypes, Visibility visibility) Transforms this entry into a prepared state.- Parameters:
instrumentedType
- The instrumented type.methodDescription
- The non-transformed method to be implemented.methodTypes
- The method types this method represents.visibility
- The represented method's minimum visibility.- Returns:
- A prepared version of this entry.
-
asSupplementaryEntry
protected MethodRegistry.Default.Prepared.Entry asSupplementaryEntry(MethodDescription methodDescription) Returns a prepared entry for a supplementary method.- Parameters:
methodDescription
- The method to be implemented.- Returns:
- An entry for a supplementary entry that is defined by a method implementation instance.
-
getHandler
Returns this entry's handler.- Returns:
- The handler of this entry.
-
resolve
Resolves the element matcher this instance represents for the supplied type description.- Specified by:
resolve
in interfaceLatentMatcher<MethodDescription>
- Parameters:
typeDescription
- The type description for which the represented matcher should be resolved.- Returns:
- An
ElementMatcher
that represents this matcher's resolved form.
-