1 35 package groovy.lang; 36 37 import org.codehaus.groovy.runtime.InvokerHelper; 38 39 46 public class IncorrectClosureArgumentsException extends GroovyRuntimeException { 47 48 private Closure closure; 49 private Object arguments; 50 private Class [] expected; 51 52 public IncorrectClosureArgumentsException(Closure closure, Object arguments, Class [] expected) { 53 super( 54 "Incorrect arguments to closure: " 55 + closure 56 + ". Expected: " 57 + InvokerHelper.toString(expected) 58 + ", actual: " 59 + InvokerHelper.toString(arguments)); 60 this.closure = closure; 61 this.arguments = arguments; 62 this.expected = expected; 63 } 64 65 public Object getArguments() { 66 return arguments; 67 } 68 69 public Closure getClosure() { 70 return closure; 71 } 72 73 public Class [] getExpected() { 74 return expected; 75 } 76 77 } 78 | Popular Tags |