Author: desruisseaux
Date: Fri Jun 28 22:03:47 2013
New Revision: 1497943
URL: http://svn.apache.org/r1497943
Log:
Merge from the JDK7 branch.
Added:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java
- copied unchanged from r1497942,
sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
- copied, changed from r1497942,
sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
sis/branches/JDK6/core/sis-metadata/src/test/resources/
- copied from r1497942,
sis/branches/JDK7/core/sis-metadata/src/test/resources/
sis/branches/JDK6/ide-project/resources-links/org/apache/sis/xml
- copied unchanged from r1497942,
sis/branches/JDK7/ide-project/resources-links/org/apache/sis/xml
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/README
sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
Merged /sis/branches/JDK7:r1497862-1497942
Modified: sis/branches/JDK6/README
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/README?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
--- sis/branches/JDK6/README (original)
+++ sis/branches/JDK6/README Fri Jun 28 22:03:47 2013
@@ -2,15 +2,27 @@
Welcome to Apache SIS <http://sis.apache.org>
=============================================
-Apache SIS(TM) is a spatial framework that enables better representation
-of coordinates for searching, data clustering, archiving, or any other
-relevant spatial needs.
+SIS is a free software, Java language library for developing geospatial
+applications. The library can be used for desktop or server applications.
+SIS is an implementation of GeoAPI 3.0 interfaces. SIS provides data structures
+for geographic data and associated metadata along with methods to manipulate
+those data structures. The SIS metadata module forms the base of the library
+and enables the creation of metadata objects which comply with the ISO 19115
+metadata model and which can be read from or written to ISO 19139 compliant
+XML documents. The SIS referencing module will enable the construction of
+geodetic data structures for geospatial referencing based on the ISO 19111
+model such as axis, projection and coordinate reference system definitions,
+along with the associated operations which enable the mathematical conversion
+of coordinates between different systems of reference. The SIS storage modules
+will provide a common approach to the reading and writing of grid coverages
+applicable to simple imagery as to many dimensional data structures.
SIS is a project of the Apache Software Foundation <http://www.apache.org/>.
Apache SIS, SIS, Apache, the Apache feather logo, and the Apache SIS
project logo are trademarks of The Apache Software Foundation.
+
Getting Started
===============
@@ -19,56 +31,14 @@ build system. To build SIS, use the foll
mvn clean install
+Information for running the application can be found on the wiki
+(<http://cwiki.apache.org/confluence/display/SIS/>)
-Tomcat Server (See much simpler Jetty integration below)
-========================================================
-The build consists of a number of components, including a web-based application
-file (WAR) you can use to try out SISfeatures. You can run it on top of Apache
Tomcat like this:
-
- /usr/local/tomcat/bin/shutdown.sh
- mkdir /usr/local/sis
- cd /usr/local/sis
- cp -R /path/to/apache-sis-X.Y-src/sis-webapp/target/sis-webapp-X.Y.war ./
- cp -R
/path/to/apache-sis-X.Y-src/sis-webapp/src/main/webapp/META-INF/context.xml
./sis.xml
- edit sis.xml (set the docBase to /usr/local/sis/sis-webapp-X.Y.war and the
property
- org.apache.sis.services.config.filePath to
/usr/local/sis/sis-location-config.xml,
- org.apache.sis.services.config.qIndexPath to /usr/local/sis/qtree,
- org.apache.sis.services.config.geodataPath to /usr/local/sis/geodata)
- cp -R
/path/to/apache-sis-X.Y-src/sis-webapp/src/main/resources/sis-location-config.xml
./
- edit sis-location-config.xml (add or delete GeoRSS URLs)
- ln -s /usr/local/sis/sis.xml
/usr/local/tomcat/conf/Catalina/localhost/sis.xml
- /usr/local/tomcat/bin/startup.sh
- Visit http://localhost:8080/sis/demo.jsp and checkout the demo!
- Try some queries:
-
- Bounding Box:
- 0, 50, 50, 100
-
- Point Raidus:
- 0, 80, 400km
-
-Jetty Server
-============
-Jetty is now supported too (as of 02/11/2012). Simply build the project at the
root level
-
- mvn clean install
-
-Then browse to the sis-webapp directory. To run the built-in Jetty server,
type the command:
-
- mvn jetty:run
-
-Visit http://localhost:8080/sis-webapp/demp.jsp and run the same queries as
noted above.
-
- Bounding Box:
- 0, 50, 50, 100
-
- Point Raidus:
- 0, 80, 400km
License (see also LICENSE)
==========================
-Collective work: Copyright 2010 The Apache Software Foundation.
+Collective work: Copyright 2010-2013 The Apache Software Foundation.
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Modified:
sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -47,7 +47,7 @@ public final strictfp class MetadataSCTe
assertNotNull(IOTestCase.NCEP, url);
final MetadataSC test = new MetadataSC(0, SubCommand.TEST,
url.toString());
test.run();
- verifyNetCDF("DefaultMetadata", test.outputBuffer.toString());
+ verifyNetCDF("Metadata", test.outputBuffer.toString());
}
/**
Modified:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -206,7 +206,8 @@ class TreeNode implements Node {
* <p>The default implementation is suitable only for the root node -
subclasses must override.</p>
*/
CharSequence getName() {
- return Classes.getShortClassName(metadata);
+ return CharSequences.camelCaseToSentence(Classes.getShortName(
+ table.standard.getInterface(metadata.getClass()))).toString();
}
/**
Modified:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -54,7 +54,7 @@ public final strictfp class AbstractMeta
*
* <p>The tree formatted by this test is:</p>
* {@preformat text
- * DefaultPlatform
+ * Platform
* ├─Description……………………… A platform.
* └─Instrument
* ├─Type……………………………… An instrument type.
@@ -69,7 +69,7 @@ public final strictfp class AbstractMeta
* We can not perform a full comparison of the string, since it is
locale-dependent.
* Compare only the tree structure. The full tree is English is shown
in javadoc.
*/
- assertTrue(text, text.startsWith("DefaultPlatform"));
+ assertTrue(text, text.startsWith("Platform"));
assertArrayEquals(new String[] {
"",
" ├─",
Modified:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -55,7 +55,7 @@ public final strictfp class TreeNodeTest
* This method creates the following metadata:
*
* {@preformat text
- * DefaultCitation
+ * Citation
* ├─Title…………………………………………………………………………………… Some title
* ├─Alternate title (1 of 2)………………………………… First alternate title
* ├─Alternate title (2 of 2)………………………………… Second alternate title
@@ -108,13 +108,13 @@ public final strictfp class TreeNodeTest
public void testRootNode() {
final DefaultCitation citation =
TreeNodeChildrenTest.metadataWithoutCollections();
final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
- assertEquals("getName()", "DefaultCitation", node.getName());
- assertEquals("getIdentifier()", "CI_Citation",
node.getIdentifier());
- assertEquals("getElementType()", Citation.class,
node.getElementType());
- assertSame ("getUserObject()", citation,
node.getUserObject());
- assertFalse ("isWritable()", node.isWritable());
- assertNull ("getParent()", node.getParent());
- assertFalse ("isLeaf()", node.isLeaf());
+ assertEquals("getName()", "Citation", node.getName());
+ assertEquals("getIdentifier()", "CI_Citation", node.getIdentifier());
+ assertEquals("getElementType()", Citation.class,
node.getElementType());
+ assertSame ("getUserObject()", citation, node.getUserObject());
+ assertFalse ("isWritable()", node.isWritable());
+ assertNull ("getParent()", node.getParent());
+ assertFalse ("isLeaf()", node.isLeaf());
final TreeNodeChildren children = (TreeNodeChildren)
node.getChildren();
assertSame ("children.metadata", citation, children.metadata);
@@ -131,7 +131,7 @@ public final strictfp class TreeNodeTest
public void testGetNameForSingleton() {
final DefaultCitation citation =
TreeNodeChildrenTest.metadataWithSingletonInCollections();
assertColumnContentEquals(create(citation,
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
- "DefaultCitation",
+ "Citation",
"Title",
"Alternate title",
"Edition",
@@ -148,7 +148,7 @@ public final strictfp class TreeNodeTest
public void testGetNameForMultiOccurrences() {
final DefaultCitation citation =
TreeNodeChildrenTest.metadataWithMultiOccurrences();
assertColumnContentEquals(create(citation,
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
- "DefaultCitation",
+ "Citation",
"Title",
"Alternate title (1 of 2)",
"Alternate title (2 of 2)",
@@ -166,7 +166,7 @@ public final strictfp class TreeNodeTest
public void testGetNameForHierarchy() {
final DefaultCitation citation = metadataWithHierarchy();
assertColumnContentEquals(create(citation,
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
- "DefaultCitation",
+ "Citation",
"Title",
"Alternate title (1 of 2)",
"Alternate title (2 of 2)",
Modified:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -105,7 +105,7 @@ public final strictfp class TreeTableFor
final DefaultCitation citation = createCitation();
final String text = format.format(citation.asTreeTable());
assertMultilinesEquals(
- "DefaultCitation\n" +
+ "Citation\n" +
" ├─Title……………………………………………………………………… Undercurrent\n" +
" ├─Alternate title (1 of 2)…………………… Alt A\n" +
" ├─Alternate title (2 of 2)…………………… Alt B\n" +
@@ -140,7 +140,7 @@ public final strictfp class TreeTableFor
processing.getDocumentations().add(untitled);
final String text = format.format(processing.asTreeTable());
assertMultilinesEquals(
- "DefaultProcessing\n" +
+ "Processing\n" +
" ├─Documentation (1 of 3)\n" +
" │ ├─Title……………………………………………… Some specification\n" +
" │ └─Presentation form……………… Document hardcopy\n" +
@@ -161,15 +161,15 @@ public final strictfp class TreeTableFor
image.getDimensions().add(createBand(0.28, 0.29));
final String text = format.format(image.asTreeTable());
assertMultilinesEquals(
- "DefaultImageDescription\n" +
+ "Image description\n" +
" ├─Dimension (1 of 2)\n" +
- " │ ├─Max value……………… 0.26\n" +
- " │ ├─Min value……………… 0.25\n" +
- " │ └─Units………………………… cm\n" +
+ " │ ├─Max value…………… 0.26\n" +
+ " │ ├─Min value…………… 0.25\n" +
+ " │ └─Units……………………… cm\n" +
" └─Dimension (2 of 2)\n" +
- " ├─Max value……………… 0.29\n" +
- " ├─Min value……………… 0.28\n" +
- " └─Units………………………… cm\n", text);
+ " ├─Max value…………… 0.29\n" +
+ " ├─Min value…………… 0.28\n" +
+ " └─Units……………………… cm\n", text);
}
/**
@@ -194,7 +194,7 @@ public final strictfp class TreeTableFor
final String text = format.format(identification.asTreeTable());
assertMultilinesEquals(
- "DefaultDataIdentification\n" +
+ "Data identification\n" +
" ├─Topic category (1 of 3)…… Health\n" +
" ├─Topic category (2 of 3)…… Oceans\n" +
" ├─Topic category (3 of 3)…… Test\n" +
Modified:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -53,23 +53,23 @@ public final strictfp class TreeTableVie
* with {@link ValueExistencePolicy#NON_EMPTY}.
*/
private static final String EXPECTED =
- "DefaultCitation\n" +
- " ├─Title…………………………………………………………………………………… Some title\n" +
- " ├─Alternate title (1 of 2)………………………………… First alternate
title\n" +
- " ├─Alternate title (2 of 2)………………………………… Second alternate
title\n" +
- " ├─Edition……………………………………………………………………………… Some edition\n" +
- " ├─Cited responsible party (1 of 2)\n" +
- " │ ├─Organisation name………………………………………… Some
organisation\n" +
- " │ └─Role…………………………………………………………………………… Distributor\n" +
- " ├─Cited responsible party (2 of 2)\n" +
- " │ ├─Individual name……………………………………………… Some person of
contact\n" +
- " │ ├─Contact info\n" +
- " │ │ └─Address\n" +
- " │ │ └─Electronic mail address…… Some email\n" +
- " │ └─Role…………………………………………………………………………… Point of contact\n"
+
- " ├─Presentation form (1 of 2)…………………………… Map digital\n" +
- " ├─Presentation form (2 of 2)…………………………… Map hardcopy\n" +
- " └─Other citation details……………………………………… Some other
details\n";
+ "Citation\n" +
+ " ├─Title…………………………………………………………………………………… Some title\n" +
+ " ├─Alternate title (1 of 2)………………………………… First alternate
title\n" +
+ " ├─Alternate title (2 of 2)………………………………… Second alternate
title\n" +
+ " ├─Edition……………………………………………………………………………… Some edition\n" +
+ " ├─Cited responsible party (1 of 2)\n" +
+ " │ ├─Organisation name………………………………………… Some organisation\n" +
+ " │ └─Role…………………………………………………………………………… Distributor\n" +
+ " ├─Cited responsible party (2 of 2)\n" +
+ " │ ├─Individual name……………………………………………… Some person of
contact\n" +
+ " │ ├─Contact info\n" +
+ " │ │ └─Address\n" +
+ " │ │ └─Electronic mail address…… Some email\n" +
+ " │ └─Role…………………………………………………………………………… Point of contact\n" +
+ " ├─Presentation form (1 of 2)…………………………… Map digital\n" +
+ " ├─Presentation form (2 of 2)…………………………… Map hardcopy\n" +
+ " └─Other citation details……………………………………… Some other details\n";
/**
* Tests {@link TreeTableView#toString()}.
Modified:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -63,7 +63,9 @@ import org.junit.BeforeClass;
org.apache.sis.xml.NilReasonMarshallingTest.class,
org.apache.sis.xml.AnchorMarshallingTest.class,
org.apache.sis.xml.ObjectReferenceMarshallingTest.class,
- org.apache.sis.xml.CustomMetadataTest.class
+ org.apache.sis.xml.CustomMetadataTest.class,
+ org.apache.sis.xml.ImageryMarshallingTest.class,
+ org.apache.sis.xml.MetadataMarshallingTest.class
})
public final strictfp class MetadataTestSuite extends TestSuite {
/**
Copied:
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
(from r1497942,
sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java)
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java?p2=sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&r1=1497942&r2=1497943&rev=1497943&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -68,7 +68,7 @@ public final strictfp class MetadataMars
*/
@BeforeClass
public static void createMarshallerPool() throws JAXBException {
- final Map<String,Object> properties = new HashMap<>(4);
+ final Map<String,Object> properties = new HashMap<String,Object>(4);
assertNull(properties.put(XML.LOCALE, Locale.ENGLISH));
assertNull(properties.put(XML.TIMEZONE, "CET"));
pool = new MarshallerPool(properties);
Modified:
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
[UTF-8] (original)
+++
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Locale;
import java.util.TimeZone;
import java.util.logging.LogRecord; // For javadoc
+import java.net.URL;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
@@ -35,6 +36,8 @@ import org.apache.sis.internal.system.Mo
import org.apache.sis.internal.system.SystemListener;
import org.apache.sis.internal.jaxb.TypeRegistration;
+import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
+
/**
* Provides convenience methods for marshalling and unmarshalling SIS objects.
@@ -331,6 +334,7 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the marshalling.
*/
public static String marshal(final Object object) throws JAXBException {
+ ensureNonNull("object", object);
final StringWriter output = new StringWriter();
final MarshallerPool pool = getPool();
final Marshaller marshaller = pool.acquireMarshaller();
@@ -347,6 +351,8 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the marshalling.
*/
public static void marshal(final Object object, final OutputStream output)
throws JAXBException {
+ ensureNonNull("object", object);
+ ensureNonNull("output", output);
final MarshallerPool pool = getPool();
final Marshaller marshaller = pool.acquireMarshaller();
marshaller.marshal(object, output);
@@ -361,6 +367,8 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the marshalling.
*/
public static void marshal(final Object object, final File output) throws
JAXBException {
+ ensureNonNull("object", object);
+ ensureNonNull("output", output);
final MarshallerPool pool = getPool();
final Marshaller marshaller = pool.acquireMarshaller();
marshaller.marshal(object, output);
@@ -375,6 +383,7 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the unmarshalling.
*/
public static Object unmarshal(final String input) throws JAXBException {
+ ensureNonNull("input", input);
final StringReader in = new StringReader(input);
final MarshallerPool pool = getPool();
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
@@ -391,6 +400,23 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the unmarshalling.
*/
public static Object unmarshal(final InputStream input) throws
JAXBException {
+ ensureNonNull("input", input);
+ final MarshallerPool pool = getPool();
+ final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
+ final Object object = unmarshaller.unmarshal(input);
+ pool.recycle(unmarshaller);
+ return object;
+ }
+
+ /**
+ * Unmarshall an object from the given URL.
+ *
+ * @param input The URL from which to read a XML representation.
+ * @return The object unmarshalled from the given input.
+ * @throws JAXBException If an error occurred during the unmarshalling.
+ */
+ public static Object unmarshal(final URL input) throws JAXBException {
+ ensureNonNull("input", input);
final MarshallerPool pool = getPool();
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final Object object = unmarshaller.unmarshal(input);
@@ -406,6 +432,7 @@ public final class XML extends Static {
* @throws JAXBException If an error occurred during the unmarshalling.
*/
public static Object unmarshal(final File input) throws JAXBException {
+ ensureNonNull("input", input);
final MarshallerPool pool = getPool();
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final Object object = unmarshaller.unmarshal(input);
Modified:
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1497943&r1=1497942&r2=1497943&view=diff
==============================================================================
---
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
[UTF-8] (original)
+++
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
[UTF-8] Fri Jun 28 22:03:47 2013
@@ -88,7 +88,7 @@ public final strictfp class MetadataRead
*/
static void compareToExpected(final Metadata actual) {
assertMultilinesEquals(
- "DefaultMetadata\n" +
+ "Metadata\n" +
" ├─File identifier…………………………………………………………………………
edu.ucar.unidata:NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n"
+
" ├─Hierarchy level………………………………………………………………………… Dataset\n" +
" ├─Contact\n" +