01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.exception;
13:
14: import net.sf.oval.context.OValContext;
15: import net.sf.oval.internal.MessageRenderer;
16:
17: /**
18: * @author Sebastian Thomschke
19: */
20: public class InvokingMethodFailedException extends ReflectionException {
21: private static final long serialVersionUID = 1L;
22:
23: private final OValContext context;
24: private final Object validatedObject;
25:
26: public InvokingMethodFailedException(final String methodName,
27: final Object validatedObject, final OValContext context,
28: final Throwable cause) {
29: super (
30: MessageRenderer
31: .renderMessage(
32: "net.sf.oval.exception.InvokingMethodFailedException.message",
33: new String[][] { { "methodName",
34: methodName } }), cause);
35: this .context = context;
36: this .validatedObject = validatedObject;
37: }
38:
39: /**
40: * @return Returns the context.
41: */
42: public OValContext getContext() {
43: return context;
44: }
45:
46: /**
47: * @return the validatedObject
48: */
49: public Object getValidatedObject() {
50: return validatedObject;
51: }
52: }
|