@HashCodeAndEqualsPlugin.Enhance public static class MemberSubstitution.WithoutSpecification.ForMatchedMethod extends MemberSubstitution.WithoutSpecification
MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement, MemberSubstitution.WithoutSpecification.ForMatchedField, MemberSubstitution.WithoutSpecification.ForMatchedMethod
Modifier and Type | Field and Description |
---|---|
private boolean |
includeSuperCalls
true if this specification includes super invocations. |
private boolean |
includeVirtualCalls
true if this specification includes virtual invocations. |
private ElementMatcher<? super MethodDescription> |
matcher
A matcher for any method or constructor that should be substituted.
|
methodGraphCompiler, replacementFactory, strict, typePoolResolver
Modifier | Constructor and Description |
---|---|
protected |
ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
MemberSubstitution.Replacement.Factory replacementFactory,
ElementMatcher<? super MethodDescription> matcher)
Creates a new member substitution for a matched method that requires a specification for how to perform a substitution.
|
protected |
ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
MemberSubstitution.Replacement.Factory replacementFactory,
ElementMatcher<? super MethodDescription> matcher,
boolean includeVirtualCalls,
boolean includeSuperCalls)
Creates a new member substitution for a matched method that requires a specification for how to perform a substitution.
|
Modifier and Type | Method and Description |
---|---|
MemberSubstitution.WithoutSpecification |
onSuperCall()
Limits the substituted method calls to method calls that invoke a method as a
super call. |
MemberSubstitution.WithoutSpecification |
onVirtualCall()
Limits the substituted method calls to method calls that invoke a method virtually (as opposed to a
super invocation). |
MemberSubstitution |
replaceWith(MemberSubstitution.Substitution.Factory substitutionFactory)
Replaces any interaction with the supplied substitution.
|
replaceWith, replaceWith, replaceWith, replaceWith, replaceWithChain, replaceWithChain, replaceWithField, replaceWithInstrumentedMethod, replaceWithMethod, replaceWithMethod, stub
private final ElementMatcher<? super MethodDescription> matcher
private final boolean includeVirtualCalls
true
if this specification includes virtual invocations.private final boolean includeSuperCalls
true
if this specification includes super
invocations.protected ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Replacement.Factory replacementFactory, ElementMatcher<? super MethodDescription> matcher)
methodGraphCompiler
- The method graph compiler to use.typePoolResolver
- The type pool resolver to use.strict
- true
if the method processing should be strict where an exception is raised if a member cannot be found.replacementFactory
- The replacement factory to use.matcher
- A matcher for any method or constructor that should be substituted.protected ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Replacement.Factory replacementFactory, ElementMatcher<? super MethodDescription> matcher, boolean includeVirtualCalls, boolean includeSuperCalls)
methodGraphCompiler
- The method graph compiler to use.typePoolResolver
- The type pool resolver to use.strict
- true
if the method processing should be strict where an exception is raised if a member cannot be found.replacementFactory
- The replacement factory to use.matcher
- A matcher for any method or constructor that should be substituted.includeVirtualCalls
- true
if this specification includes virtual invocations.includeSuperCalls
- true
if this specification includes super
invocations.public MemberSubstitution.WithoutSpecification onVirtualCall()
super
invocation).public MemberSubstitution.WithoutSpecification onSuperCall()
super
call.public MemberSubstitution replaceWith(MemberSubstitution.Substitution.Factory substitutionFactory)
replaceWith
in class MemberSubstitution.WithoutSpecification
substitutionFactory
- The substitution factory to use for creating the applied substitution.