Author: desruisseaux Date: Sat Dec 30 05:18:01 2017 New Revision: 1819569 URL: http://svn.apache.org/viewvc?rev=1819569&view=rev Log: Upgrade JAXB bindings of some more classes to ISO 19115-3. This is part of commit e780d66b4d7d59368e742ba01777a151d8827ea8 from Image Matter.
The project at this revision can be built but is known to have test failure. Tests will pass only after we completed the port of all ISO 19115-3 work. Removed: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_LinearMeasure.java Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -243,7 +243,7 @@ public class DefaultCoverageResult exten * @return data file containing the result coverage data, or {@code null}. */ @Override - @XmlElement(name = "resultFile", namespace = Namespaces.GMX, required = true) + @XmlElement(name = "resultFile", namespace = Namespaces.GCX, required = true) public DataFile getResultFile() { return resultFile; } Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -109,14 +109,16 @@ * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) - * @version 0.3 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmx", namespaceURI = Namespaces.GMX), - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), +@XmlSchema(location=Schemas.METADATA_XSD_QUALITY, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.DQC, xmlns = { + @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC), + @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT), + @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC), + @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD), @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) }) Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -83,14 +83,17 @@ * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), +@XmlSchema(location=Schemas.METADATA_XSD_SPATIAL, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MSR, xmlns = { + @XmlNs(prefix = "msr", namespaceURI = Namespaces.MSR), + @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC), + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), + @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW), @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) }) @XmlAccessorType(XmlAccessType.NONE) Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -119,9 +119,9 @@ public final strictfp class DefaultMetad @Test public void testEmptyCollection() throws JAXBException { final DefaultMetadata metadata = unmarshal( - "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + "\">\n" + - " <gmd:contact/>\n" + - "</gmd:MD_Metadata>"); + "<mdb:MD_Metadata xmlns:mdb=\"" + Namespaces.MDB + "\">\n" + + " <mdb:contact/>\n" + + "</mdb:MD_Metadata>"); /* * Verify metadata property. */ Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -39,13 +39,14 @@ import static java.util.Collections.sing * Tests {@link DefaultBrowseGraphic}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.4 * @module */ public final strictfp class DefaultBrowseGraphicTest extends TestCase { /** - * Tests XML marshalling of {@code <gmx:MimeFileType>} inside {@code <gmd:MD_BrowseGraphic>}. + * Tests XML marshalling of {@code <gcx:MimeFileType>} inside {@code <gmd:MD_BrowseGraphic>}. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @@ -56,9 +57,9 @@ public final strictfp class DefaultBrows final String xml = XML.marshal(browse); assertXmlEquals( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + "\">\n" + + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <gmd:fileType>\n" + - " <gmx:MimeFileType type=\"image/tiff\">image/tiff</gmx:MimeFileType>\n" + + " <gcx:MimeFileType type=\"image/tiff\">image/tiff</gcx:MimeFileType>\n" + " </gmd:fileType>\n" + "</gmd:MD_BrowseGraphic>", xml, "xmlns:*"); /* @@ -68,7 +69,7 @@ public final strictfp class DefaultBrows } /** - * Tests XML marshalling of {@code <gmx:FileName>} inside {@code <gmd:MD_BrowseGraphic>}. + * Tests XML marshalling of {@code <gcx:FileName>} inside {@code <gmd:MD_BrowseGraphic>}. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @@ -79,9 +80,9 @@ public final strictfp class DefaultBrows final String xml = XML.marshal(browse); assertXmlEquals( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + "\">\n" + + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <gmd:fileName>\n" + - " <gmx:FileName src=\"file:/catalog/image.png\">image.png</gmx:FileName>\n" + + " <gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>\n" + " </gmd:fileName>\n" + "</gmd:MD_BrowseGraphic>", xml, "xmlns:*"); /* @@ -91,7 +92,7 @@ public final strictfp class DefaultBrows } /** - * Tests unmarshalling of {@code <gmx:FileName>} without {@code src} attribute. + * Tests unmarshalling of {@code <gcx:FileName>} without {@code src} attribute. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @@ -100,9 +101,9 @@ public final strictfp class DefaultBrows public void testFileNameWithoutSrc() throws JAXBException { final DefaultBrowseGraphic browse = (DefaultBrowseGraphic) XML.unmarshal( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + "\">\n" + + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <gmd:fileName>\n" + - " <gmx:FileName>file:/catalog/image.png</gmx:FileName>\n" + + " <gcx:FileName>file:/catalog/image.png</gcx:FileName>\n" + " </gmd:fileName>\n" + "</gmd:MD_BrowseGraphic>"); @@ -110,7 +111,7 @@ public final strictfp class DefaultBrows } /** - * Tests XML marshalling of {@code <gmx:FileName>} and {@code <gmx:MimeFileType>} together. + * Tests XML marshalling of {@code <gcx:FileName>} and {@code <gcx:MimeFileType>} together. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @@ -123,12 +124,12 @@ public final strictfp class DefaultBrows final String xml = XML.marshal(browse); assertXmlEquals( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + "\">\n" + + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <gmd:fileName>\n" + - " <gmx:FileName src=\"file:/catalog/image.png\">image.png</gmx:FileName>\n" + + " <gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>\n" + " </gmd:fileName>\n" + " <gmd:fileType>\n" + - " <gmx:MimeFileType type=\"image/tiff\">image/tiff</gmx:MimeFileType>\n" + + " <gcx:MimeFileType type=\"image/tiff\">image/tiff</gcx:MimeFileType>\n" + " </gmd:fileType>\n" + "</gmd:MD_BrowseGraphic>", xml, "xmlns:*"); /* @@ -170,7 +171,7 @@ public final strictfp class DefaultBrows } /** - * Tests the unmarshaller with the same URI in both {@code <gco:CharacterString>} and {@code <gmx:FileName>}. + * Tests the unmarshaller with the same URI in both {@code <gco:CharacterString>} and {@code <gcx:FileName>}. * Since the URI is the same, the unmarshaller should not produce any warning since there is no ambiguity. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. @@ -181,10 +182,10 @@ public final strictfp class DefaultBrows final Warning listener = new Warning(); final DefaultBrowseGraphic browse = listener.unmarshal( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + '"' + + " xmlns:gcx=\"" + Namespaces.GCX + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + " <gmd:fileName>\n" + - " <gmx:FileName src=\"file:/catalog/image.png\">image.png</gmx:FileName>\n" + + " <gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>\n" + " <gco:CharacterString>file:/catalog/image.png</gco:CharacterString>\n" + " </gmd:fileName>\n" + "</gmd:MD_BrowseGraphic>"); @@ -195,21 +196,21 @@ public final strictfp class DefaultBrows /** * Ensures that the unmarshaller produces a warning when {@code <gco:CharacterString>} and - * {@code <gmx:FileName>} both exist inside the same {@code <gmd:MD_BrowseGraphic>}. + * {@code <gcx:FileName>} both exist inside the same {@code <gmd:MD_BrowseGraphic>}. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @Test @DependsOnMethod("testStringSubstitution") public void testWarnings() throws JAXBException { - testWarnings("<gmx:FileName src=\"file:/catalog/image.png\">image.png</gmx:FileName>", + testWarnings("<gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>", "<gco:CharacterString>file:/catalog/image2.png</gco:CharacterString>"); /* * Test again with the same element value, but in reverse order. * We do that for ensuring that FileName still has precedence. */ testWarnings("<gco:CharacterString>file:/catalog/image2.png</gco:CharacterString>", - "<gmx:FileName src=\"file:/catalog/image.png\">image.png</gmx:FileName>"); + "<gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>"); } /** @@ -219,7 +220,7 @@ public final strictfp class DefaultBrows final Warning listener = new Warning(); final DefaultBrowseGraphic browse = listener.unmarshal( "<gmd:MD_BrowseGraphic xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmx=\"" + Namespaces.GMX + '"' + + " xmlns:gcx=\"" + Namespaces.GCX + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + " <gmd:fileName>\n" + " " + first + "\n" + Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -132,7 +132,7 @@ public final strictfp class DefaultResol "<gmd:MD_Resolution xmlns:gmd=\"" + Namespaces.GMD + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + " <gmd:distance>\n" + - " <gco:Distance uom=\"" + Schemas.METADATA_ROOT + Schemas.UOM_PATH + "#xpointer(//*[@gml:id='m'])\">1000.0</gco:Distance>\n" + + " <gco:Distance uom=\"" + Schemas.METADATA_ROOT_OLD + Schemas.UOM_PATH + "#xpointer(//*[@gml:id='m'])\">1000.0</gco:Distance>\n" + " </gmd:distance>\n" + "</gmd:MD_Resolution>", xml, "xmlns:*"); /* Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -35,7 +35,8 @@ import static org.apache.sis.test.Assert * Tests the XML marshalling of {@code Anchor} and {@code CodeList} as substitution of {@code <gco:CharacterSequence>}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -50,12 +51,12 @@ public final strictfp class CharSequence @DependsOnMethod("testAnchor") public void testAnchorForString() throws JAXBException { final String expected = - "<gmd:RS_Identifier xmlns:gmx=\"" + Namespaces.GMX + '"' + + "<gmd:RS_Identifier xmlns:gcx=\"" + Namespaces.GCX + '"' + " xmlns:gmd=\"" + Namespaces.GMD + '"' + " xmlns:gco=\"" + Namespaces.GCO + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + " <gmd:code>\n" + - " <gmx:Anchor xlink:href=\"SDN:L101:2:4326\">EPSG:4326</gmx:Anchor>\n" + + " <gcx:Anchor xlink:href=\"SDN:L101:2:4326\">EPSG:4326</gcx:Anchor>\n" + " </gmd:code>\n" + " <gmd:codeSpace>\n" + " <gco:CharacterString>L101</gco:CharacterString>\n" + @@ -76,7 +77,7 @@ public final strictfp class CharSequence @Test public void testAnchor() throws JAXBException { final String expected = - "<gmd:CI_Address xmlns:gmx=\"" + Namespaces.GMX + '"' + + "<gmd:CI_Address xmlns:gcx=\"" + Namespaces.GCX + '"' + " xmlns:gmd=\"" + Namespaces.GMD + '"' + " xmlns:gco=\"" + Namespaces.GCO + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + @@ -90,7 +91,7 @@ public final strictfp class CharSequence " <gco:CharacterString>29280</gco:CharacterString>\n" + " </gmd:postalCode>\n" + " <gmd:country>\n" + - " <gmx:Anchor xlink:href=\"SDN:C320:2:FR\">France</gmx:Anchor>\n" + + " <gcx:Anchor xlink:href=\"SDN:C320:2:FR\">France</gcx:Anchor>\n" + " </gmd:country>\n" + " <gmd:electronicMailAddress>\n" + " <gco:CharacterString>(hiden)@ifremer.fr</gco:CharacterString>\n" + Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -36,7 +36,8 @@ public final class LegacyNamespaces { * @deprecated to be replaced by {@code VERSION_1_0}, which is the version declared in XML schemas. */ @Deprecated - public static final Version ISO_19115_3 = new Version("2014"); + public static final Version ISO_19115_3 = new Version("2014"), + ISO_19139 = new Version("2003"); /** * Miscellaneous version constants. Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlAdapter; import org.apache.sis.internal.jaxb.gml.Measure; +import org.apache.sis.measure.Units; /** @@ -31,13 +32,12 @@ import org.apache.sis.internal.jaxb.gml. * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @author Cullen Rombach (Image Matters) - * @version 1.0 + * @version 0.8 * @since 0.3 * @module */ @XmlType(name = "Measure_PropertyType") -public final class GO_Measure extends XmlAdapter<GO_Measure, Measure> { +public final class GO_Measure extends XmlAdapter<GO_Measure, Double> { /** * A proxy representation of the {@code <gco:Measure>} element. */ @@ -54,32 +54,42 @@ public final class GO_Measure extends Xm * Constructs an adapter for the given value before marshalling. * * @param value the value. + * + * @todo The unit of measurement is fixed to metres for now because we do not have this information + * in current metadata interface. This will need to be revisited in a future SIS version if we + * replace the Double type by some quantity type. */ - private GO_Measure(final Measure value) { - measure = value; + private GO_Measure(final Double value) { + measure = new Measure(value, Units.METRE); measure.asXPointer = true; } /** - * Allows JAXB to generate a Measure object using the value found in the adapter. + * Allows JAXB to generate a Double object using the value found in the adapter. * * @param value the value wrapped in an adapter. - * @return the Measure object extracted from the adapter. + * @return the double value extracted from the adapter. */ @Override - public Measure unmarshal(final GO_Measure value) { - return (value != null) ? value.measure : null; + public Double unmarshal(final GO_Measure value) { + if (value != null) { + final Measure measure = value.measure; + if (measure != null) { + return measure.value; + } + } + return null; } /** * Allows JAXB to change the result of the marshalling process, according to the * ISO-19139 standard and its requirements about {@code measures}. * - * @param value the Measure value we want to integrate into a {@code <gco:Measure>} element. - * @return a {@code <gco:Measure>} element, with an {@code uom} attribute. + * @param value the double value we want to wrap into a {@code <gco:Measure>} element. + * @return a double value wrapped by {@code <gco:Measure>} element with an {@code uom} attribute. */ @Override - public GO_Measure marshal(final Measure value) { + public GO_Measure marshal(final Double value) { return (value != null) ? new GO_Measure(value) : null; } } Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java?rev=1819569&r1=1819568&r2=1819569&view=diff ============================================================================== --- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java [UTF-8] Sat Dec 30 05:18:01 2017 @@ -135,8 +135,6 @@ final class FilteredStreamResolver exten /** * The mapping from attribute names to types where such attribute is declared. * An attribute of the same name may be declared in many types. - * - * @see #declaringTypes(String) */ private static final Map<String, Set<String>> DECLARING_TYPES; static { @@ -169,8 +167,6 @@ final class FilteredStreamResolver exten * <li>key: old element name</li> * <li>value: new element name</li> * </ul> - * - * @see #newName(String) */ private static final Map<String,String> NAME_CHANGES = Collections.singletonMap("URL", "CharacterString");