org.metawidget.layout.iface.LayoutException Maven / Gradle / Ivy
// Metawidget
//
// This file is dual licensed under both the LGPL
// (http://www.gnu.org/licenses/lgpl-2.1.html) and the EPL
// (http://www.eclipse.org/org/documents/epl-v10.php). As a
// recipient of Metawidget, you may choose to receive it under either
// the LGPL or the EPL.
//
// Commercial licenses are also available. See http://metawidget.org
// for details.
package org.metawidget.layout.iface;
import org.metawidget.iface.MetawidgetException;
/**
* Any exception that occurs during layout.
*
* @author Richard Kennard
*/
public final class LayoutException
extends MetawidgetException {
//
// Public statics
//
/**
* Static constructor.
*
* Using static constructor methods prevents unnecessarily nesting LayoutExceptions within
* LayoutExceptions.
*/
public static LayoutException newException( Throwable cause ) {
if ( cause instanceof LayoutException ) {
return (LayoutException) cause;
}
return new LayoutException( cause );
}
/**
* Static constructor.
*
* For consistency with LayoutException.newException( Throwable )
.
*/
public static LayoutException newException( String message ) {
return new LayoutException( message );
}
/**
* Static constructor.
*
* For consistency with LayoutException.newException( Throwable )
.
*/
public static LayoutException newException( String message, Throwable cause ) {
return new LayoutException( message, cause );
}
//
// Constructor
//
private LayoutException( String message ) {
super( message );
}
private LayoutException( Throwable cause ) {
super( cause );
}
private LayoutException( String message, Throwable cause ) {
super( message, cause );
}
}