Package net.bytebuddy.asm
Class MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement
- java.lang.Object
-
- net.bytebuddy.asm.MemberSubstitution.WithoutSpecification
-
- net.bytebuddy.asm.MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement
-
- Enclosing class:
- MemberSubstitution.WithoutSpecification
protected static class MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement extends MemberSubstitution.WithoutSpecification
Describes a member substitution that requires a specification for how to replace a byte code element.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.asm.MemberSubstitution.WithoutSpecification
MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement, MemberSubstitution.WithoutSpecification.ForMatchedField, MemberSubstitution.WithoutSpecification.ForMatchedMethod
-
-
Field Summary
-
Fields inherited from class net.bytebuddy.asm.MemberSubstitution.WithoutSpecification
methodGraphCompiler, strict, substitution, typePoolResolver
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForMatchedByteCodeElement(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Substitution substitution, ElementMatcher<? super ByteCodeElement> matcher)
Creates a new member substitution for a matched byte code element that requires a specification for how to perform a substitution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class net.bytebuddy.asm.MemberSubstitution.WithoutSpecification
replaceWith, replaceWith, replaceWith, replaceWith, stub
-
-
-
-
Constructor Detail
-
ForMatchedByteCodeElement
protected ForMatchedByteCodeElement(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Substitution substitution, ElementMatcher<? super ByteCodeElement> matcher)
Creates a new member substitution for a matched byte code element that requires a specification for how to perform a substitution.- Parameters:
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 byte code elements that should be substituted.
-
-
Method Detail
-
doStub
protected MemberSubstitution.Substitution doStub()
Description copied from class:MemberSubstitution.WithoutSpecification
Applies the stubbing for this instance.- Specified by:
doStub
in classMemberSubstitution.WithoutSpecification
- Returns:
- A suitable substitution.
-
doReplaceWith
protected MemberSubstitution.Substitution doReplaceWith(FieldDescription fieldDescription)
Description copied from class:MemberSubstitution.WithoutSpecification
Creates a substitution for replacing the byte code elements matched by this instance with an access of the specified field.- Specified by:
doReplaceWith
in classMemberSubstitution.WithoutSpecification
- Parameters:
fieldDescription
- The field to access.- Returns:
- A suitable substitution.
-
doReplaceWith
protected MemberSubstitution.Substitution doReplaceWith(MethodDescription methodDescription)
Description copied from class:MemberSubstitution.WithoutSpecification
Creates a substitution for replacing the byte code elements matched by this instance with an invocation of the specified method.- Specified by:
doReplaceWith
in classMemberSubstitution.WithoutSpecification
- Parameters:
methodDescription
- The method to invoke.- Returns:
- A suitable substitution.
-
-