-
public class Pine.CallFrameA Holder that holds the method, "this" object, arguments, result or exception of a method call.
-
-
Constructor Summary
Constructors Constructor Description Pine.CallFrame(Pine.HookRecord hookRecord, Object thisObject, Array<Object> args)
-
Method Summary
Modifier and Type Method Description ObjectgetResult()Get the result that will be returned in this method call. voidsetResult(Object result)Set a result that will be returned in this method call. ThrowablegetThrowable()Get the exception that will be thrown in this method call. voidsetThrowable(Throwable throwable)Set the exception that will be thrown in this method call. voidsetResultIfNoException(Object result)Like setResult but only set the return value if no exception will be thrown. booleanhasThrowable()Return whether an exception will be thrown as the result of this method call. ObjectgetResultOrThrowable()Like getResult but throwing an exception if there is an exception set. voidresetResult()Reset any previous result or exception, and allows the original method to be executed. ObjectinvokeOriginalMethod()Invoke the original implementation of the method with current {@code thisObject}and{@code args}.ObjectinvokeOriginalMethod(Object thisObject, Array<Object> args)Like invokeOriginalMethod but use the passed {@code thisObject}and{@code args}.-
-
Constructor Detail
-
Pine.CallFrame
Pine.CallFrame(Pine.HookRecord hookRecord, Object thisObject, Array<Object> args)
-
-
Method Detail
-
setResult
void setResult(Object result)
Set a result that will be returned in this method call.If you call it
{@code beforeCall}, the original method call will be prevented, and nexthooks will not be called.- Parameters:
result- The return value you want to set.
-
getThrowable
Throwable getThrowable()
Get the exception that will be thrown in this method call.
-
setThrowable
void setThrowable(Throwable throwable)
Set the exception that will be thrown in this method call.If you call it
{@code beforeCall}, the original method call will be prevented, and nexthooks will not be called.- Parameters:
throwable- The exception you want to throw.
-
setResultIfNoException
void setResultIfNoException(Object result)
Like setResult but only set the return value if no exception will be thrown.
- Parameters:
result- The return value you want to set.
-
hasThrowable
boolean hasThrowable()
Return whether an exception will be thrown as the result of this method call.
-
getResultOrThrowable
Object getResultOrThrowable()
Like getResult but throwing an exception if there is an exception set.
-
resetResult
void resetResult()
Reset any previous result or exception, and allows the original method to be executed.
-
invokeOriginalMethod
Object invokeOriginalMethod()
Invoke the original implementation of the method with current
{@code thisObject}and{@code args}.
-
invokeOriginalMethod
Object invokeOriginalMethod(Object thisObject, Array<Object> args)
Like invokeOriginalMethod but use the passed
{@code thisObject}and{@code args}.- Parameters:
thisObject- The "this" object of this method call.args- The arguments of this method call.
-
-
-
-