1 /* 2 * CSVeed (https://github.com/42BV/CSVeed) 3 * 4 * Copyright 2013-2023 CSVeed. 5 * 6 * All rights reserved. This program and the accompanying materials 7 * are made available under the terms of The Apache Software License, 8 * Version 2.0 which accompanies this distribution, and is available at 9 * https://www.apache.org/licenses/LICENSE-2.0.txt 10 */ 11 package org.csveed.bean.conversion; 12 13 /** 14 * The Class ConversionException. 15 */ 16 public abstract class ConversionException extends Exception { 17 18 /** The Constant serialVersionUID. */ 19 private static final long serialVersionUID = 1L; 20 21 /** The type description. */ 22 private String typeDescription; 23 24 /** 25 * Instantiates a new conversion exception. 26 * 27 * @param message 28 * the message 29 * @param clazz 30 * the clazz 31 */ 32 protected ConversionException(String message, Class clazz) { 33 this(message, clazz.getName(), null); 34 } 35 36 /** 37 * Instantiates a new conversion exception. 38 * 39 * @param message 40 * the message 41 * @param typeDescription 42 * the type description 43 * @param exception 44 * the exception 45 */ 46 protected ConversionException(String message, String typeDescription, Throwable exception) { 47 super(message, exception); 48 this.typeDescription = typeDescription; 49 } 50 51 /** 52 * Gets the type description. 53 * 54 * @return the type description 55 */ 56 public String getTypeDescription() { 57 return typeDescription; 58 } 59 }