Package net.bytebuddy.asm
Enum MemberSubstitution.Substitution.Stubbing
java.lang.Object
java.lang.Enum<MemberSubstitution.Substitution.Stubbing>
net.bytebuddy.asm.MemberSubstitution.Substitution.Stubbing
- All Implemented Interfaces:
Serializable
,Comparable<MemberSubstitution.Substitution.Stubbing>
,java.lang.constant.Constable
,MemberSubstitution.Substitution
,MemberSubstitution.Substitution.Factory
- Enclosing interface:
MemberSubstitution.Substitution
public static enum MemberSubstitution.Substitution.Stubbing
extends Enum<MemberSubstitution.Substitution.Stubbing>
implements MemberSubstitution.Substitution, MemberSubstitution.Substitution.Factory
A substitution that drops any field or method access and returns the expected return
type's default value, i.e
null
or zero for primitive types.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution
MemberSubstitution.Substitution.Chain, MemberSubstitution.Substitution.Factory, MemberSubstitution.Substitution.ForFieldAccess, MemberSubstitution.Substitution.ForMethodInvocation, MemberSubstitution.Substitution.ForValue, MemberSubstitution.Substitution.Stubbing
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmake
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.resolve
(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset) Resolves this substitution into a stack manipulation.Returns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
Stubbing
private Stubbing()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
make
public MemberSubstitution.Substitution make(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.- Specified by:
make
in interfaceMemberSubstitution.Substitution.Factory
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typePool
- The type pool being used.- Returns:
- The substitution to apply within the instrumented method.
-
resolve
public StackManipulation resolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset) Resolves this substitution into a stack manipulation.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution
- Parameters:
target
- The target member of invokedynamic invocation.parameters
- All parameters that serve as input to this access.result
- The result that is expected from the interaction orvoid
if no result is expected.methodHandle
- A method handle describing the substituted expression.stackManipulation
- The original byte code expression that is being executed.freeOffset
- The first free offset of the local variable array that can be used for storing values.- Returns:
- A stack manipulation that represents the access.
-