public static class MemberSubstitution.WithoutSpecification.ForMatchedMethod extends MemberSubstitution.WithoutSpecification
MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement, MemberSubstitution.WithoutSpecification.ForMatchedField, MemberSubstitution.WithoutSpecification.ForMatchedMethod
methodGraphCompiler, strict, substitution, typePoolResolver
Modifier | Constructor and Description |
---|---|
protected |
ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
MemberSubstitution.Substitution substitution,
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.Substitution substitution,
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 |
---|---|
protected MemberSubstitution.Substitution |
doReplaceWith(FieldDescription fieldDescription)
Creates a substitution for replacing the byte code elements matched by this instance with an access of the specified field.
|
protected MemberSubstitution.Substitution |
doReplaceWith(MethodDescription methodDescription)
Creates a substitution for replacing the byte code elements matched by this instance with an invocation of the specified method.
|
protected MemberSubstitution.Substitution |
doStub()
Applies the stubbing for this instance.
|
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). |
replaceWith, replaceWith, replaceWith, replaceWith, stub
protected ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Substitution substitution, 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.substitution
- The substitution to apply.matcher
- A matcher for any method or constructor that should be substituted.protected ForMatchedMethod(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Substitution substitution, 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.substitution
- The substitution to apply.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.protected MemberSubstitution.Substitution doStub()
MemberSubstitution.WithoutSpecification
doStub
in class MemberSubstitution.WithoutSpecification
protected MemberSubstitution.Substitution doReplaceWith(FieldDescription fieldDescription)
MemberSubstitution.WithoutSpecification
doReplaceWith
in class MemberSubstitution.WithoutSpecification
fieldDescription
- The field to access.protected MemberSubstitution.Substitution doReplaceWith(MethodDescription methodDescription)
MemberSubstitution.WithoutSpecification
doReplaceWith
in class MemberSubstitution.WithoutSpecification
methodDescription
- The method to invoke.Copyright © 2014–2017. All rights reserved.