01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2004, Institut de Recherche pour le Développement
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.util;
18:
19: // Geotools implementation
20: import org.geotools.resources.Utilities;
21:
22: /**
23: * Throws when an operation can't use arbitrary implementation of an interface, and
24: * a given instance doesn't meet the requirement. For example this exception may be
25: * thrown when an operation requires a Geotools implementation of a
26: * <A HREF="http://geoapi.sourceforge.net">GeoAPI</A> interface.
27: *
28: * @since 2.0
29: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/util/UnsupportedImplementationException.java $
30: * @version $Id: UnsupportedImplementationException.java 22443 2006-10-27 20:47:22Z desruisseaux $
31: * @author Martin Desruisseaux
32: */
33: public class UnsupportedImplementationException extends
34: UnsupportedOperationException {
35: /**
36: * Constructs an exception with the specified detail message.
37: *
38: * @param message The detail message.
39: */
40: public UnsupportedImplementationException(final String message) {
41: super (message);
42: }
43:
44: /**
45: * Constructs an exception with an error message formatted for the specified class.
46: *
47: * @param classe The unexpected implementation class.
48: */
49: public UnsupportedImplementationException(final Class classe) {
50: // TODO: Provides a localized message.
51: super (Utilities.getShortName(classe));
52: }
53:
54: /**
55: * Constructs an exception with an error message formatted for the specified class
56: * and a cause.
57: *
58: * @param classe The unexpected implementation class.
59: * @param cause The cause for the exception.
60: */
61: public UnsupportedImplementationException(final Class classe,
62: final Exception cause) {
63: // TODO: Provides a localized message.
64: super (Utilities.getShortName(classe));
65: initCause(cause); // TODO: use the constructor with cause arg. in J2E 1.5.
66: }
67: }
|