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 java.lang.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
Fields Modifier and Type Field Description private MethodAttributeAppender.Factory
attributeAppenderFactory
A method attribute appender factory to apply to all entries.private MethodRegistry.Handler
handler
The handler to apply to all matched entries.private LatentMatcher<? super MethodDescription>
matcher
The latent method matcher that this entry represents.private Transformer<MethodDescription>
transformer
The method transformer to be applied to implemented methods.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Entry(LatentMatcher<? super MethodDescription> matcher, MethodRegistry.Handler handler, MethodAttributeAppender.Factory attributeAppenderFactory, Transformer<MethodDescription> transformer)
Creates a new entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MethodRegistry.Default.Prepared.Entry
asPreparedEntry(TypeDescription instrumentedType, MethodDescription methodDescription, java.util.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
getHandler()
Returns this entry's handler.ElementMatcher<? super MethodDescription>
resolve(TypeDescription typeDescription)
Resolves the element matcher this instance represents for the supplied type description.
-
-
-
Field Detail
-
matcher
private final LatentMatcher<? super MethodDescription> matcher
The latent method matcher that this entry represents.
-
handler
private final MethodRegistry.Handler handler
The handler to apply to all matched entries.
-
attributeAppenderFactory
private final MethodAttributeAppender.Factory attributeAppenderFactory
A method attribute appender factory to apply to all entries.
-
transformer
private final Transformer<MethodDescription> transformer
The method transformer to be applied to implemented methods.
-
-
Constructor Detail
-
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 Detail
-
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, java.util.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
protected MethodRegistry.Handler getHandler()
Returns this entry's handler.- Returns:
- The handler of this entry.
-
resolve
public ElementMatcher<? super MethodDescription> resolve(TypeDescription typeDescription)
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.
-
-