Class MethodInvocationFailResult
java.lang.Object
org.apache.tapestry5.internal.services.MethodInvocationFailResult
- All Implemented Interfaces:
MethodInvocationResult
Implementation of
MethodInvocationResult for failed
invocations (where a checked exception was thrown).- Since:
- 5.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe return value from the method invocation.<T extends Throwable>
TIfMethodInvocationResult.isFail()is true, this method provides access to the actual checked exception that was thrown.booleanisFail()If true, then the method invocation ended with a checked exception being thrown.voidrethrow()If the invocation threw a checked exception, this method will wrap that exception in a RuntimeException and throw that.
-
Constructor Details
-
MethodInvocationFailResult
-
-
Method Details
-
getReturnValue
Description copied from interface:MethodInvocationResultThe return value from the method invocation. This will be null if the method returns null, is a void method, or if a checked exception was thrown by the method.- Specified by:
getReturnValuein interfaceMethodInvocationResult
-
getThrown
Description copied from interface:MethodInvocationResultIfMethodInvocationResult.isFail()is true, this method provides access to the actual checked exception that was thrown.- Specified by:
getThrownin interfaceMethodInvocationResult- Parameters:
throwableClass- the type of exception to match- Returns:
- the exception, if the method invocation threw a checked exception, and the exception is assignable to the provided type. In other cases, null is returned.
-
isFail
Description copied from interface:MethodInvocationResultIf true, then the method invocation ended with a checked exception being thrown.- Specified by:
isFailin interfaceMethodInvocationResult
-
rethrow
Description copied from interface:MethodInvocationResultIf the invocation threw a checked exception, this method will wrap that exception in a RuntimeException and throw that. For most code that doesn't specifically care about the thrown exception, this method should be invoked before continuing on to examineMethodInvocationResult.getReturnValue().- Specified by:
rethrowin interfaceMethodInvocationResult
-