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 2013/01/06 05:48:22 UTC
svn commit: r1429461 [2/2] - in /sis/branches/JDK6: ./
sis-build-helper/src/main/java/org/apache/sis/internal/maven/
sis-build-helper/src/site/apt/ sis-utility/
sis-utility/src/main/java/org/apache/sis/internal/jaxb/
sis-utility/src/main/java/org/apach...
Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties Sun Jan 6 04:48:21 2013
@@ -14,16 +14,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-Angle = Angle
-Degrees = Degr\u00e9s
-MaximumValue = Valeur maximale
-MeanValue = Valeur moyenne
-MinimumValue = Valeur minimale
-Minutes = Minutes
-Name = Nom
-NumberOfValues = Nombre de valeurs
-NumberOfNaN = Nombre de \u2018NaN\u2019
-RootMeanSquare = Moyenne quadratique
-Seconds = Secondes
-StandardDeviation = \u00c9cart type
-Type = Type
+Angle = Angle
+AngularDegrees = Degr\u00e9s
+AngularMinutes = Minutes
+AngularSeconds = Secondes
+CharacterEncoding = Encodage des caract\u00e8res
+Classpath = Chemin de classes
+Code_1 = Code {0}
+CurrentDateTime = Date et heure courantes
+CurrentDirectory = R\u00e9pertoire courant
+DaylightTime = Heure normale
+Directory = R\u00e9pertoire
+JavaExtensions = Extensions du Java
+JavaHome = R\u00e9pertoire du Java
+Libraries = Biblioth\u00e8ques
+LocalConfiguration = Configuration locale
+Locale = Locale
+Localization = R\u00e9gionalisation
+MaximumValue = Valeur maximale
+MeanValue = Valeur moyenne
+MinimumValue = Valeur minimale
+Name = Nom
+NumberOfValues = Nombre de valeurs
+NumberOfNaN = Nombre de \u2018NaN\u2019
+Offset = D\u00e9calage
+OperatingSystem = Syst\u00e8me d'exploitation
+Others = Autres
+Paths = Chemins
+Root = Racine
+RootMeanSquare = Moyenne quadratique
+Scale = \u00c9chelle
+StandardDeviation = \u00c9cart type
+TemporaryFiles = Fichiers temporaires
+Timezone = Fuseau horaire
+Type = Type
+Untitled = Sans titre
+UserHome = R\u00e9pertoire de l'utilisateur
+Value = Valeur
+Versions = Versions
Copied: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java (from r1429460, sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java?p2=sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java&p1=sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java&r1=1429460&r2=1429461&rev=1429461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java Sun Jan 6 04:48:21 2013
@@ -88,13 +88,13 @@ public class MarshallerPool {
* The pool of marshaller. This pool is initially empty
* and will be filled with elements as needed.
*/
- private final Deque<Marshaller> marshallers = new LinkedList<>();
+ private final Deque<Marshaller> marshallers = new LinkedList<Marshaller>();
/**
* The pool of unmarshaller. This pool is initially empty
* and will be filled with elements as needed.
*/
- private final Deque<Unmarshaller> unmarshallers = new LinkedList<>();
+ private final Deque<Unmarshaller> unmarshallers = new LinkedList<Unmarshaller>();
/**
* Creates a new factory for the given class to be bound, with a default empty namespace.
@@ -177,7 +177,7 @@ public class MarshallerPool {
*/
try {
mapper = Class.forName(type).getConstructor(String.class).newInstance(rootNamespace);
- } catch (ReflectiveOperationException | NoClassDefFoundError exception) {
+ } catch (Throwable exception) { // (ReflectiveOperationException | NoClassDefFoundError) on JDK7 branch.
// The NoClassDefFoundError is because of our trick using "geotk-provided".
throw new JAXBException("Unsupported JAXB implementation.", exception);
}
Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ReferenceResolver.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ReferenceResolver.java?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ReferenceResolver.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ReferenceResolver.java Sun Jan 6 04:48:21 2013
@@ -22,6 +22,7 @@ import org.opengis.metadata.Identifier;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.LenientComparable;
import org.apache.sis.internal.jaxb.UUIDs;
+import org.apache.sis.internal.jaxb.gmx.Anchor;
import static org.apache.sis.util.ArgumentChecks.*;
@@ -43,9 +44,8 @@ import static org.apache.sis.util.Argume
*/
public class ReferenceResolver {
/**
- * The default and thread-safe instance. This instance is used at unmarshalling time
- * when no {@code ReferenceResolver} was explicitly set by the {@link XML#RESOLVER}
- * property.
+ * The default and thread-safe instance. This instance is used at unmarshalling time when
+ * no {@code ReferenceResolver} was explicitly set by the {@link XML#RESOLVER} property.
*/
public static final ReferenceResolver DEFAULT = new ReferenceResolver();
@@ -128,9 +128,9 @@ public class ReferenceResolver {
}
/**
- * Returns {@code true} if the marshaller can use a {@code xlink:href} reference to the given
- * metadata instead than writing the full element. This method is invoked when a metadata to be
- * marshalled has a {@link XLink} identifier. Because those metadata may be defined externally,
+ * Returns {@code true} if the marshaller can use a reference to the given metadata
+ * instead than writing the full element. This method is invoked when a metadata to
+ * be marshalled has a UUID identifier. Because those metadata may be defined externally,
* SIS can not know if the metadata shall be fully marshalled or not.
* Such information needs to be provided by the application.
*
@@ -143,18 +143,18 @@ public class ReferenceResolver {
* @param type The type of object to be marshalled as an <strong>interface</strong>.
* This is usually a <a href="http://www.geoapi.org">GeoAPI</a> interface.
* @param object The object to be marshalled.
- * @param link The reference of the object to be marshalled.
- * @return {@code true} if the marshaller can use the {@code xlink:href} attribute
+ * @param uuid The unique identifier of the object to be marshalled.
+ * @return {@code true} if the marshaller can use the {@code uuidref} attribute
* instead than marshalling the given metadata.
*/
- public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final XLink link) {
+ public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final UUID uuid) {
return false;
}
/**
- * Returns {@code true} if the marshaller can use a reference to the given metadata
- * instead than writing the full element. This method is invoked when a metadata to
- * be marshalled has a UUID identifier. Because those metadata may be defined externally,
+ * Returns {@code true} if the marshaller can use a {@code xlink:href} reference to the given
+ * metadata instead than writing the full element. This method is invoked when a metadata to be
+ * marshalled has a {@link XLink} identifier. Because those metadata may be defined externally,
* SIS can not know if the metadata shall be fully marshalled or not.
* Such information needs to be provided by the application.
*
@@ -167,11 +167,48 @@ public class ReferenceResolver {
* @param type The type of object to be marshalled as an <strong>interface</strong>.
* This is usually a <a href="http://www.geoapi.org">GeoAPI</a> interface.
* @param object The object to be marshalled.
- * @param uuid The unique identifier of the object to be marshalled.
- * @return {@code true} if the marshaller can use the {@code uuidref} attribute
+ * @param link The reference of the object to be marshalled.
+ * @return {@code true} if the marshaller can use the {@code xlink:href} attribute
* instead than marshalling the given metadata.
*/
- public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final UUID uuid) {
+ public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final XLink link) {
return false;
}
+
+ /**
+ * Returns the {@code <gmx:Anchor>} to use for the given text, or {@code null} if none.
+ * Anchors can appear in ISO 19139 documents where we would normally expect a character
+ * sequence. For example:
+ *
+ * <table class="sis">
+ * <tr>
+ * <th>As {@code <gco:CharacterString>}</th>
+ * <th>As {@code <gmx:Anchor>}</th>
+ * </tr><tr>
+ * <td>{@preformat xml
+ * <gmd:country>
+ * <gco:CharacterString>France</gco:CharacterString>
+ * </gmd:country>
+ * }</td>
+ * <td>{@preformat xml
+ * <gmd:country>
+ * <gmx:Anchor xlink:href="SDN:C320:2:FR">France</gmx:Anchor>
+ * </gmd:country>
+ * }</td>
+ * </tr>
+ * </table>
+ *
+ * Subclasses can override this method if they can provide a mapping from some text
+ * values to anchors.
+ *
+ * @param context Context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.
+ * @param object The object for which an anchor is requested. Often same than {@code text},
+ * but can also be the {@link java.net.URI} or {@link java.util.Locale} instance
+ * for which {@code text} is a string representation.
+ * @param text The textual representation of the object for which to get the anchor.
+ * @return The anchor for the given text, or {@code null} if none.
+ */
+ public XLink anchor(final MarshalContext context, final Object object, final CharSequence text) {
+ return (text instanceof Anchor) ? (Anchor) text : null;
+ }
}
Modified: sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions.properties?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions.properties (original)
+++ sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions.properties Sun Jan 6 04:48:21 2013
@@ -1,5 +1,6 @@
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
-supervisor = Provides information about the state of a running Apache SIS library.
-org.apache.sis.internal.util.Supervisor = Creates a new supervisor.
-locale = The language of supervisor messages.
-warnings = List of problems detected in the running Apache SIS library. If this list contains any item, then an application reboot is strongly recommended.
+supervisor=Provides information about the state of a running Apache SIS library.
+org.apache.sis.internal.util.Supervisor=Creates a new supervisor.
+locale=The language of supervisor messages.
+configuration=Tree of information about the Apache SIS running environment.
+warnings=List of problems detected in the running Apache SIS library. If this list contains any item, then an application reboot is strongly recommended.
Modified: sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions_fr.properties?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions_fr.properties (original)
+++ sis/branches/JDK6/sis-utility/src/main/resources/org/apache/sis/internal/util/Descriptions_fr.properties Sun Jan 6 04:48:21 2013
@@ -1,5 +1,6 @@
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
-supervisor = Fournit des informations \u00e0 propos de l\u2019\u00e9tat d\u2019une biblioth\u00e8que Apache SIS en cours d\u2019ex\u00e9cution.
-org.apache.sis.internal.util.Supervisor = Construit un nouveau superviseur.
-locale = La langue des messages produits par le superviseur.
-warnings = Liste des probl\u00e8mes d\u00e9tect\u00e9s dans la biblioth\u00e8que Apache SIS en cours d\u2019ex\u00e9cution. Si cette liste contient des items, alors un red\u00e9marrage de l\u2019application est fortement recommand\u00e9.
+supervisor=Fournit des informations \u00e0 propos de l\u2019\u00e9tat d\u2019une biblioth\u00e8que Apache SIS en cours d\u2019ex\u00e9cution.
+org.apache.sis.internal.util.Supervisor=Construit un nouveau superviseur.
+locale=La langue des messages produits par le superviseur.
+configuration=Arborescence d'information concernant l\u2019environnement d\u2019ex\u00e9cution de Apache SIS.
+warnings=Liste des probl\u00e8mes d\u00e9tect\u00e9s dans la biblioth\u00e8que Apache SIS en cours d\u2019ex\u00e9cution. Si cette liste contient des items, alors un red\u00e9marrage de l\u2019application est fortement recommand\u00e9.
Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java Sun Jan 6 04:48:21 2013
@@ -57,6 +57,7 @@ import org.junit.runners.Suite;
org.apache.sis.util.collection.DerivedMapTest.class,
org.apache.sis.util.collection.TableColumnTest.class,
org.apache.sis.util.collection.DefaultTreeTableTest.class,
+ org.apache.sis.util.collection.TreeTablesTest.class,
// GeoAPI most basic types.
org.apache.sis.util.iso.TypesTest.class,
Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java?rev=1429461&r1=1429460&r2=1429461&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java Sun Jan 6 04:48:21 2013
@@ -55,13 +55,6 @@ public final strictfp class DefaultTreeT
assertEquals("Index of first column:", Integer.valueOf(0), table.columnIndices.get(NAME));
assertEquals("Index of second column:", Integer.valueOf(1), table.columnIndices.get(TYPE));
assertArrayEquals(new TableColumn<?>[] {NAME, TYPE}, table.getColumns().toArray());
- try {
- assertNull(table.getRoot());
- fail("Expected an IllegalStateException.");
- } catch (IllegalStateException e) {
- // This is the expected exception.
- assertTrue(e.getMessage().contains("root"));
- }
return table;
}
@@ -89,7 +82,7 @@ public final strictfp class DefaultTreeT
* Create a first child node, which should be added automatically
* to the root list of children.
*/
- final DefaultTreeTable.Node node1 = new DefaultTreeTable.Node(root);
+ final DefaultTreeTable.Node node1 = root.newChild();
assertSame("Internal table sharing:", table.columnIndices, node1.columnIndices);
assertTrue("Initial children list:", node1.getChildren().isEmpty());
assertSame("Specified parent:", root, node1.getParent());
Copied: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java (from r1429460, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java?p2=sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java&p1=sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java&r1=1429460&r2=1429461&rev=1429461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java Sun Jan 6 04:48:21 2013
@@ -18,8 +18,6 @@ package org.apache.sis.util.collection;
import java.util.List;
import java.io.File;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
import java.text.ParseException;
import org.junit.Test;
import org.apache.sis.test.TestCase;
@@ -91,33 +89,6 @@ public final strictfp class TreeTablesTe
}
/**
- * Tests the {@link TreeTables#nodeForPath(TreeTable.Node, TableColumn, Path)} method.
- */
- @Test
- public void testNodeForPath() {
- final FileSystem fs = FileSystems.getDefault();
- final TreeTable table = new DefaultTreeTable(NAME, VALUE_AS_NUMBER);
- final TreeTable.Node files = table.getRoot();
- files.setValue(NAME, "Root");
- nodeForPath(files, NAME, fs.getPath("users","Alice","data")) .setValue(VALUE_AS_NUMBER, 10);
- nodeForPath(files, NAME, fs.getPath("users","Bob","data")) .setValue(VALUE_AS_NUMBER, 20);
- nodeForPath(files, NAME, fs.getPath("users","Bob")) .setValue(VALUE_AS_NUMBER, 30);
- nodeForPath(files, NAME, fs.getPath("lib")) .setValue(VALUE_AS_NUMBER, 40);
- nodeForPath(files, NAME, fs.getPath("users","Alice","document")) .setValue(VALUE_AS_NUMBER, 50);
- nodeForPath(files, NAME, fs.getPath("users","Alice","data","mercator")).setValue(VALUE_AS_NUMBER, 60);
- assertMultilinesEquals(
- "Root\n" +
- "ââââusers\n" +
- "â   ââââAlice\n" +
- "â   â   ââââdataâ¦â¦â¦â¦â¦â¦â¦â¦â¦â¦ 10\n" +
- "â   â   â   ââââmercatorâ¦â¦ 60\n" +
- "â   â   ââââdocumentâ¦â¦â¦â¦â¦â¦ 50\n" +
- "â   ââââBobâ¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦ 30\n" +
- "â       ââââdataâ¦â¦â¦â¦â¦â¦â¦â¦â¦â¦ 20\n" +
- "ââââlibâ¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦ 40\n", table.toString());
- }
-
- /**
* Tests the {@link TreeTables#nodeForPath(TreeTable.Node, TableColumn, File)} method.
*/
@Test