001/*
002 * Copyright (c) 2006-2015 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Bogdan Stefanescu
011 *     Florent Guillaume
012 */
013package org.nuxeo.ecm.core.api.model;
014
015/**
016 * Exception thrown when trying to convert a property value to an incompatible type during read or write.
017 */
018public class PropertyConversionException extends InvalidPropertyValueException {
019
020    private static final long serialVersionUID = 1L;
021
022    public PropertyConversionException() {
023        super();
024    }
025
026    public PropertyConversionException(String message) {
027        super(message);
028    }
029
030    public PropertyConversionException(String message, Throwable cause) {
031        super(message, cause);
032    }
033
034    public PropertyConversionException(Throwable cause) {
035        super(cause);
036    }
037
038    public PropertyConversionException(Class<?> fromClass, Class<?> toClass) {
039        this("Property Conversion failed from " + fromClass + " to " + toClass);
040    }
041
042    public PropertyConversionException(Class<?> fromClass, Class<?> toClass, String message) {
043        this("Property Conversion failed from " + fromClass + " to " + toClass + ": " + message);
044    }
045
046}