001/* 002 * InvalidFormatException.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 021/** 022 * The <code>InvalidFormatException</code> is thrown when there is 023 * a format exception. This exception this will be thrown from the 024 * <code>Transformer</code> should serialization or deserialization 025 * of an object fail. Error messages provided to this exception are 026 * formatted similar to the <code>PrintStream.printf</code> method. 027 * 028 * @author Niall Gallagher 029 */ 030public class InvalidFormatException extends TransformException { 031 032 /** 033 * Constructor for the <code>InvalidFormatException</code> object. 034 * This constructor takes a format string an a variable number of 035 * object arguments, which can be inserted into the format string. 036 * 037 * @param text a format string used to present the error message 038 * @param list a list of arguments to insert into the string 039 */ 040 public InvalidFormatException(String text, Object... list) { 041 super(String.format(text, list)); 042 } 043 044 /** 045 * Constructor for the <code>InvalidFormatException</code> object. 046 * This constructor takes a format string an a variable number of 047 * object arguments, which can be inserted into the format string. 048 * 049 * @param cause the source exception this is used to represent 050 * @param text a format string used to present the error message 051 * @param list a list of arguments to insert into the stri 052 */ 053 public InvalidFormatException(Throwable cause, String text, Object... list) { 054 super(String.format(text, list), cause); 055 } 056}