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