@HashCodeAndEqualsPlugin.Enhance public static class MemberSubstitution.Substitution.ForElementMatchers extends Object implements MemberSubstitution.Substitution
MemberSubstitution.Substitution.Compound, MemberSubstitution.Substitution.ForElementMatchers, MemberSubstitution.Substitution.InvocationType, MemberSubstitution.Substitution.NoOp, MemberSubstitution.Substitution.Resolver
Modifier | Constructor and Description |
---|---|
protected |
ForElementMatchers(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher,
ElementMatcher<? super MethodDescription> methodMatcher,
boolean matchFieldRead,
boolean matchFieldWrite,
boolean includeVirtualCalls,
boolean includeSuperCalls,
MemberSubstitution.Substitution.Resolver resolver)
Creates a new substitution that applies element matchers to determine what byte code elements to substitute.
|
Modifier and Type | Method and Description |
---|---|
protected static MemberSubstitution.Substitution |
of(ElementMatcher<? super ByteCodeElement> matcher,
MemberSubstitution.Substitution.Resolver resolver)
Creates a substitution for any byte code element that matches the supplied matcher.
|
protected static MemberSubstitution.Substitution |
ofField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher,
boolean matchFieldRead,
boolean matchFieldWrite,
MemberSubstitution.Substitution.Resolver resolver)
Creates a substitution for any method that matches the supplied matcher.
|
protected static MemberSubstitution.Substitution |
ofMethod(ElementMatcher<? super MethodDescription> matcher,
boolean includeVirtualCalls,
boolean includeSuperCalls,
MemberSubstitution.Substitution.Resolver resolver)
Creates a substitution for any method that matches the supplied matcher.
|
MemberSubstitution.Substitution.Resolver |
resolve(FieldDescription.InDefinedShape fieldDescription,
boolean writeAccess)
Resolves a field access within a method body.
|
MemberSubstitution.Substitution.Resolver |
resolve(MethodDescription methodDescription,
MemberSubstitution.Substitution.InvocationType invocationType)
Resolves a method invocation within a method body.
|
protected ForElementMatchers(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher, ElementMatcher<? super MethodDescription> methodMatcher, boolean matchFieldRead, boolean matchFieldWrite, boolean includeVirtualCalls, boolean includeSuperCalls, MemberSubstitution.Substitution.Resolver resolver)
fieldMatcher
- The field matcher to determine fields to substitute.methodMatcher
- The method matcher to determine methods to substitute.matchFieldRead
- true
if field read access should be substituted.matchFieldWrite
- true
if field write access should be substituted.includeVirtualCalls
- true
if virtual method calls should be substituted.includeSuperCalls
- true
if super method calls should be substituted.resolver
- The resolver to apply on elements to substitute.protected static MemberSubstitution.Substitution of(ElementMatcher<? super ByteCodeElement> matcher, MemberSubstitution.Substitution.Resolver resolver)
matcher
- The matcher to determine the substituted byte code elements.resolver
- The resolver to apply on elements to substitute.protected static MemberSubstitution.Substitution ofField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, boolean matchFieldRead, boolean matchFieldWrite, MemberSubstitution.Substitution.Resolver resolver)
matcher
- The matcher to determine the substituted fields.matchFieldRead
- true
if field read access should be substituted.matchFieldWrite
- true
if field write access should be substituted.resolver
- The resolver to apply on fields to substitute.protected static MemberSubstitution.Substitution ofMethod(ElementMatcher<? super MethodDescription> matcher, boolean includeVirtualCalls, boolean includeSuperCalls, MemberSubstitution.Substitution.Resolver resolver)
matcher
- The matcher to determine the substituted fields.includeVirtualCalls
- true
if virtual method calls should be substituted.includeSuperCalls
- true
if super method calls should be substituted.resolver
- The resolver to apply on fields to substitute.public MemberSubstitution.Substitution.Resolver resolve(FieldDescription.InDefinedShape fieldDescription, boolean writeAccess)
MemberSubstitution.Substitution
resolve
in interface MemberSubstitution.Substitution
fieldDescription
- The field being accessed.writeAccess
- true
if the access is for writing to the field, false
if the field is read.public MemberSubstitution.Substitution.Resolver resolve(MethodDescription methodDescription, MemberSubstitution.Substitution.InvocationType invocationType)
MemberSubstitution.Substitution
resolve
in interface MemberSubstitution.Substitution
methodDescription
- The method being invoked.invocationType
- The method's invocation type.Copyright © 2014–2018. All rights reserved.