All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleframework.util.FormatException Maven / Gradle / Ivy

Go to download

Simple is a high performance asynchronous HTTP server for Java

There is a newer version: 5.1.6
Show newest version
/*
 * FormatException.java May 2007
 *
 * Copyright (C) 2007, Niall Gallagher 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General 
 * Public License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 * Boston, MA  02111-1307  USA
 */

package org.simpleframework.util;

/**
 * The FormatException is used to create exceptions that
 * can use a template string for the message. Each format exception
 * will accept a string and an ordered list of variables which can 
 * be used to complete the exception message.
 * 
 * @author Niall Gallagher
 */
public class FormatException extends Exception {

   /**
    * Constructor for the FormatException this requires
    * a template message and an ordered list of values that are to
    * be inserted in to the provided template to form the error.
    * 
    * @param template this is the template string to be modified
    * @param list this is the list of values that are to be inserted
    */
   public FormatException(String template, Object... list) {
      super(String.format(template, list));
   }
   
   /**
    * Constructor for the FormatException this requires
    * a template message and an ordered list of values that are to
    * be inserted in to the provided template to form the error.
    * 
    * @param cause this is the original cause of the exception
    * @param template this is the template string to be modified
    * @param list this is the list of values that are to be inserted
    */
   public FormatException(Throwable cause, String template, Object... list) {
      super(String.format(template, list), cause);
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy