public static class MethodCall.WithoutSpecifiedTarget extends MethodCall
MethodCall
that invokes a method without specifying
an invocation method. Some methods can for example be invoked both virtually or as a super method invocation.
Similarly, interface methods can be invoked virtually or as an explicit invocation of a default method. If
no explicit invocation type is set, a method is always invoked virtually unless the method
represents a static methods or a constructor.MethodCall.Appender, MethodCall.ArgumentLoader, MethodCall.MethodInvoker, MethodCall.MethodLocator, MethodCall.TargetHandler, MethodCall.TerminationHandler, MethodCall.WithoutSpecifiedTarget
Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
argumentLoaders, assigner, dynamicallyTyped, methodInvoker, methodLocator, targetHandler, terminationHandler
Modifier | Constructor and Description |
---|---|
protected |
WithoutSpecifiedTarget(MethodCall.MethodLocator methodLocator)
Creates a new method call without a specified target.
|
Modifier and Type | Method and Description |
---|---|
MethodCall |
on(Object target)
Invokes the specified method on the given instance.
|
MethodCall |
onDefault()
Invokes the given method by a Java 8default method invocation on the instance of the instrumented type.
|
MethodCall |
onInstanceField(Class<?> type,
String fieldName)
Invokes the given method on an instance that is stored in an instance field.
|
MethodCall |
onInstanceField(TypeDescription typeDescription,
String fieldName)
Invokes the given method on an instance that is stored in an instance field.
|
MethodCall |
onSuper()
Invokes the given method by a super method invocation on the instance of the instrumented type.
|
String |
toString() |
andThen, appender, construct, construct, equals, hashCode, invoke, invoke, invoke, invoke, invokeSuper, prepare, with, with, with, withArgument, withAssigner, withField, withInstanceField, withInstanceField, withReference, withThis
protected WithoutSpecifiedTarget(MethodCall.MethodLocator methodLocator)
methodLocator
- The method locator to use.public MethodCall on(Object target)
target
- The object on which the method is to be invoked upon.public MethodCall onInstanceField(Class<?> type, String fieldName)
NullPointerException
.type
- The type of the field.fieldName
- The name of the field.public MethodCall onInstanceField(TypeDescription typeDescription, String fieldName)
NullPointerException
.typeDescription
- The type of the field.fieldName
- The name of the field.public MethodCall onSuper()
public MethodCall onDefault()
public String toString()
toString
in class MethodCall
Copyright © 2014–2015. All rights reserved.