You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2012/10/16 12:27:22 UTC
svn commit: r1398719 - in
/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util:
UnsupportedImplementationException.java resources/Errors.java
resources/Errors.properties resources/Errors_fr.properties
Author: desruisseaux
Date: Tue Oct 16 10:27:21 2012
New Revision: 1398719
URL: http://svn.apache.org/viewvc?rev=1398719&view=rev
Log:
Added UnsupportedImplementationException.
Added:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java (with props)
Modified:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
Added: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java?rev=1398719&view=auto
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java (added)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java Tue Oct 16 10:27:21 2012
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.util;
+
+import org.apache.sis.util.resources.Errors;
+
+
+/**
+ * Thrown when an operation can't use arbitrary implementation of an interface, and
+ * a given instance doesn't meet the requirement. For example this exception may be
+ * thrown when an operation requires an Apache SIS implementation of a
+ * <A HREF="http://www.geoapi.org">GeoAPI</A> interface.
+ *
+ * @author Martin Desruisseaux (IRD, Geomatys)
+ * @since 0.3 (derived from geotk-2.0)
+ * @version 0.3
+ * @module
+ */
+public class UnsupportedImplementationException extends UnsupportedOperationException {
+ /**
+ * For cross-version compatibility.
+ */
+ private static final long serialVersionUID = -649050339146622730L;
+
+ /**
+ * Constructs an exception with the specified detail message.
+ *
+ * @param message The detail message.
+ */
+ public UnsupportedImplementationException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs an exception with an error message formatted for the specified class.
+ *
+ * @param classe The unexpected implementation class.
+ */
+ public UnsupportedImplementationException(final Class<?> classe) {
+ super(Errors.format(Errors.Keys.UnsupportedImplementation_1, classe));
+ }
+
+ /**
+ * Constructs an exception with an error message formatted for the specified class
+ * and a cause.
+ *
+ * @param classe The unexpected implementation class.
+ * @param cause The cause for the exception.
+ */
+ public UnsupportedImplementationException(final Class<?> classe, final Exception cause) {
+ super(Errors.format(Errors.Keys.UnsupportedImplementation_1, classe), cause);
+ }
+}
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1398719&r1=1398718&r2=1398719&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java Tue Oct 16 10:27:21 2012
@@ -167,6 +167,11 @@ public final class Errors extends Indexe
public static final int UnmodifiableObject_1 = 26;
/**
+ * Can not handle instances of â{0}â because arbitrary implementations are not yet supported.
+ */
+ public static final int UnsupportedImplementation_1 = 28;
+
+ /**
* The â{0}â operation is unsupported.
*/
public static final int UnsupportedOperation_1 = 20;
Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1398719&r1=1398718&r2=1398719&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties Tue Oct 16 10:27:21 2012
@@ -38,6 +38,7 @@ UnmodifiableAffineTransform = This a
UnmodifiableGeometry = This geometry is unmodifiable.
UnmodifiableMetadata = This metadata is unmodifiable.
UnmodifiableObject_1 = Object \u2018{0}\u2019 is unmodifiable.
+UnsupportedImplementation_1 = Can not handle instances of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
UnsupportedOperation_1 = The \u2018{0}\u2019 operation is unsupported.
ValueAlreadyDefined_1 = A value is already defined for \u201c{0}\u201d.
ValueNotGreaterThanZero_2 = Value \u2018{0}\u2019={1} is invalid. Expected a number greater than 0.
Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1398719&r1=1398718&r2=1398719&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties Tue Oct 16 10:27:21 2012
@@ -38,6 +38,7 @@ UnmodifiableAffineTransform = Cette
UnmodifiableGeometry = Cette g\u00e9om\u00e9trie n\u2019est pas modifiable.
UnmodifiableMetadata = Cette m\u00e9ta-donn\u00e9e n\u2019est pas modifiable.
UnmodifiableObject_1 = L\u2019objet \u2018{0}\u2019 n\u2019est pas modifiable.
+UnsupportedImplementation_1 = Les instances de \u2018{0}\u2019 ne peuvent pas \u00eatre g\u00e9r\u00e9es parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
UnsupportedOperation_1 = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas support\u00e9e.
ValueAlreadyDefined_1 = Une valeur est d\u00e9j\u00e0 d\u00e9finie pour \u201c{0}\u201d.
ValueNotGreaterThanZero_2 = La valeur \u2018{0}\u2019={1} n\u2019est pas valide. On attendait un nombre positif non-nul.