javax.faces.convert.ConverterException Maven / Gradle / Ivy
/*
* $Id: ConverterException.java,v 1.11 2006/12/15 18:12:15 rlubke Exp $
*/
/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://javaserverfaces.dev.java.net/CDDL.html or
* legal/CDDLv1.0.txt.
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* [Name of File] [ver.__] [Date]
*
* Copyright 2005 Sun Microsystems Inc. All Rights Reserved
*/
package javax.faces.convert;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
/**
* ConverterException is an exception thrown by the
* getAsObject()
or getAsText()
method of a
* {@link Converter}, to indicate that the requested conversion cannot
* be performed.
*/
public class ConverterException extends FacesException {
// ----------------------------------------------------------- Constructors
/**
* Construct a new exception with no detail message or root cause.
*/
public ConverterException() {
super();
}
/**
* Construct a new exception with the specified detail message and
* no root cause.
*
* @param message The detail message for this exception
*/
public ConverterException(String message) {
super(message);
}
/**
* Construct a new exception with the specified root cause. The detail
* message will be set to (cause == null ? null :
* cause.toString()
*
* @param cause The root cause for this exception
*/
public ConverterException(Throwable cause) {
super(cause);
}
/**
*
Construct a new exception with the specified detail message and
* root cause.
*
* @param message The detail message for this exception
* @param cause The root cause for this exception
*/
public ConverterException(String message, Throwable cause) {
super(message, cause);
}
/**
* Construct a new exception with the specified detail message and
* no root cause.
*
* @param message The detail message for this exception
*/
public ConverterException(FacesMessage message) {
super(message.getSummary());
this.facesMessage = message;
}
/**
* Construct a new exception with the specified detail message and
* root cause.
*
* @param message The detail message for this exception
* @param cause The root cause for this exception
*/
public ConverterException(FacesMessage message, Throwable cause) {
super(message.getSummary(), cause);
this.facesMessage = message;
}
/**
* Returns the FacesMessage associated with this exception; this
* will only be available if the converter that thew this exception
* instance placed it there.
*/
public FacesMessage getFacesMessage() {
return facesMessage;
}
private FacesMessage facesMessage;
}