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 AccessingFieldValueFailedException extends
21: ReflectionException {
22: private static final long serialVersionUID = 1L;
23:
24: private final OValContext context;
25: private final Object validatedObject;
26:
27: public AccessingFieldValueFailedException(final String fieldName,
28: final Object validatedObject, final OValContext context,
29: final Throwable cause) {
30: super (
31: MessageRenderer
32: .renderMessage(
33: "net.sf.oval.exception.AccessingFieldValueFailedException.message",
34: new String[][] { { "fieldName",
35: fieldName } }), cause);
36: this .context = context;
37: this .validatedObject = validatedObject;
38: }
39:
40: /**
41: * @return Returns the context.
42: */
43: public OValContext getContext() {
44: return context;
45: }
46:
47: /**
48: * @return the validatedObject
49: */
50: public Object getValidatedObject() {
51: return validatedObject;
52: }
53: }
|