1 16 package org.springframework.binding.method; 17 18 import java.lang.reflect.InvocationTargetException ; 19 20 import org.springframework.core.NestedRuntimeException; 21 import org.springframework.core.style.StylerUtils; 22 23 27 public class MethodInvocationException extends NestedRuntimeException { 28 29 32 private ClassMethodKey methodKey; 33 34 37 private Object [] arguments; 38 39 46 public MethodInvocationException(ClassMethodKey methodKey, Object [] arguments, Exception cause) { 47 super("Unable to invoke method " + methodKey + " with arguments " + StylerUtils.style(arguments), cause); 48 } 49 50 53 public ClassMethodKey getMethodKey() { 54 return methodKey; 55 } 56 57 60 public Object [] getArguments() { 61 return arguments; 62 } 63 64 68 public Throwable getTargetException() { 69 if (getCause() instanceof InvocationTargetException ) { 70 return ((InvocationTargetException )getCause()).getTargetException(); 71 } 72 else { 73 return getCause(); 74 } 75 } 76 } | Popular Tags |