View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2013 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  /**
16   * An exception translator for all exception thrown by the guard
17   * during runtime when performing constraint validations on guarded objects.
18   *
19   * @author Sebastian Thomschke
20   */
21  public interface ExceptionTranslator
22  {
23  	/**
24  	 * If this method returns null, the original exception is thrown.
25  	 *
26  	 * @param ex
27  	 * @return the exception to throw
28  	 */
29  	RuntimeException translateException(final OValException ex);
30  }