001/*
002 * TransformException.java May 2007
003 *
004 * Copyright (C) 2007, Niall Gallagher <niallg@users.sf.net>
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
015 * implied. See the License for the specific language governing 
016 * permissions and limitations under the License.
017 */
018
019package org.simpleframework.xml.transform;
020
021import org.simpleframework.xml.core.PersistenceException;
022
023/**
024 * The <code>TransformException</code> is thrown if a problem occurs
025 * during the transformation of an object. This can be thrown either
026 * because a transform could not be found for a specific type or
027 * because the format of the text value had an invalid structure.
028 * 
029 * @author Niall Gallagher
030 */
031public class TransformException extends PersistenceException {
032   
033   /**
034    * Constructor for the <code>TransformException</code> object. 
035    * This constructor takes a format string an a variable number of 
036    * object arguments, which can be inserted into the format string. 
037    * 
038    * @param text a format string used to present the error message
039    * @param list a list of arguments to insert into the string
040    */     
041   public TransformException(String text, Object... list) {
042      super(String.format(text, list));               
043   }       
044
045   /**
046    * Constructor for the <code>TransformException</code> object. 
047    * This constructor takes a format string an a variable number of 
048    * object arguments, which can be inserted into the format string. 
049    * 
050    * @param cause the source exception this is used to represent
051    * @param text a format string used to present the error message
052    * @param list a list of arguments to insert into the stri 
053    */
054   public TransformException(Throwable cause, String text, Object... list) {
055      super(String.format(text, list), cause);           
056   }  
057}