Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_GeometricObjectTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_GeometricObjectTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_GeometricObjectTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_GeometricObjectTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.spatial.GeometricObjectType; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link GeometricObjectType}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about the - * handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link GeometricObjectType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -74,7 +75,7 @@ public final class MD_GeometricObjectTyp * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_GeometricObjectTypeCode") + @XmlElement(name = "MD_GeometricObjectTypeCode", namespace = Namespaces.MSR) public CodeListUID getElement() { return identifier; }
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ImagingConditionCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ImagingConditionCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ImagingConditionCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ImagingConditionCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.content.ImagingCondition; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link ImagingCondition}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about - * the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link ImagingCondition} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -74,7 +75,7 @@ public final class MD_ImagingConditionCo * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_ImagingConditionCode") + @XmlElement(name = "MD_ImagingConditionCode", namespace = Namespaces.MRC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_KeywordTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_KeywordTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_KeywordTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_KeywordTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.identification.KeywordType; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link KeywordType}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information - * about the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link KeywordType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +73,7 @@ public final class MD_KeywordTypeCode ex * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_KeywordTypeCode") + @XmlElement(name = "MD_KeywordTypeCode", namespace = Namespaces.MRI) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MaintenanceFrequencyCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MaintenanceFrequencyCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MaintenanceFrequencyCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MaintenanceFrequencyCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,17 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.maintenance.MaintenanceFrequency; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link MaintenanceFrequency}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about the - * handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link MaintenanceFrequency} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -74,7 +76,7 @@ public final class MD_MaintenanceFrequen * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_MaintenanceFrequencyCode") + @XmlElement(name = "MD_MaintenanceFrequencyCode", namespace = Namespaces.MMI) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumFormatCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumFormatCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumFormatCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumFormatCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.distribution.MediumFormat; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link MediumFormat}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about the - * handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link MediumFormat} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +73,7 @@ public final class MD_MediumFormatCode e * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_MediumFormatCode") + @XmlElement(name = "MD_MediumFormatCode", namespace = Namespaces.MRD) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumNameCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumNameCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumNameCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_MediumNameCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.distribution.MediumName; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.internal.jaxb.LegacyNamespaces; /** - * JAXB adapter for {@link MediumName}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information - * about the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link MediumName} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +73,7 @@ public final class MD_MediumNameCode ext * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_MediumNameCode") + @XmlElement(name = "MD_MediumNameCode", namespace = LegacyNamespaces.GMD) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ObligationCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ObligationCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ObligationCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ObligationCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -16,44 +16,59 @@ */ package org.apache.sis.internal.jaxb.code; -import javax.xml.bind.annotation.adapters.XmlAdapter; -import org.opengis.metadata.Obligation; -import org.apache.sis.util.iso.Types; +import javax.xml.bind.annotation.XmlElement; +import org.opengis.annotation.Obligation; +import org.apache.sis.internal.jaxb.gmd.EnumAdapter; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Obligation}, in order to wraps the value in an element - * complying with ISO-19139 standard. See package documentation for more information - * about the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Obligation} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.3 * @module */ -public final class MD_ObligationCode extends XmlAdapter<String, Obligation> { +public final class MD_ObligationCode extends EnumAdapter<MD_ObligationCode, Obligation> { /** - * Returns the obligation enumeration for the given name. + * The enumeration value. + */ + @XmlElement(name = "MD_ObligationCode", namespace = Namespaces.MEX) + private String value; + + /** + * Empty constructor for JAXB only. + */ + public MD_ObligationCode() { + } + + /** + * Returns the wrapped value. * - * @param value the obligation name. - * @return the obligation enumeration for the given name. + * @param wrapper the wrapper. + * @return the wrapped value. */ @Override - public Obligation unmarshal(String value) { - return Types.forCodeName(Obligation.class, value, true); + public final Obligation unmarshal(final MD_ObligationCode wrapper) { + return Obligation.valueOf(name(wrapper.value)); } /** - * Returns the name of the given obligation. + * Wraps the given value. * - * @param value the obligation enumeration. - * @return the name of the given obligation. + * @param e the value to wrap. + * @return the wrapped value. */ @Override - public String marshal(final Obligation value) { - if (value == null) { + public final MD_ObligationCode marshal(final Obligation e) { + if (e == null) { return null; } - return value.name(); + final MD_ObligationCode wrapper = new MD_ObligationCode(); + wrapper.value = value(e); + return wrapper; } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_PixelOrientationCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_PixelOrientationCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_PixelOrientationCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_PixelOrientationCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,17 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.spatial.PixelOrientation; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link PixelOrientation}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about - * the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link PixelOrientation} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -82,7 +84,7 @@ public final class MD_PixelOrientationCo * @return The value to be marshalled. */ @Override - @XmlElement(name = "MD_PixelOrientationCode") + @XmlElement(name = "MD_PixelOrientationCode", namespace = Namespaces.MSR) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ProgressCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ProgressCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ProgressCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ProgressCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.identification.Progress; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link MD_ProgressCode}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about - * the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Progress} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +73,7 @@ public final class MD_ProgressCode exten * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_ProgressCode") + @XmlElement(name = "MD_ProgressCode", namespace = Namespaces.MCC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_RestrictionCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_RestrictionCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_RestrictionCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_RestrictionCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.constraint.Restriction; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Restriction}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about - * the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Restriction} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -58,8 +59,10 @@ public final class MD_RestrictionCode ex */ @Override protected MD_RestrictionCode wrap(final CodeListUID value) { - if ("licence".equals(value.codeListValue)) { + if ("licence".equals(value.codeListValue) && !accept2014()) { value.codeListValue = "license"; + } else if ("license".equals(value.codeListValue) && accept2014()) { + value.codeListValue = "licence"; } return new MD_RestrictionCode(value); } @@ -80,7 +83,7 @@ public final class MD_RestrictionCode ex * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_RestrictionCode") + @XmlElement(name = "MD_RestrictionCode", namespace = Namespaces.MCO) public CodeListUID getElement() { return identifier; } @@ -91,6 +94,9 @@ public final class MD_RestrictionCode ex * @param value the unmarshalled value. */ public void setElement(final CodeListUID value) { + if (value != null && "licence".equalsIgnoreCase(value.codeListValue)) { + value.codeListValue = "license"; // For matching legacy spelling (ISO 19139:2007). + } identifier = value; } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ScopeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ScopeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ScopeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ScopeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,17 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.maintenance.ScopeCode; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link ScopeCode}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link ScopeCode} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +74,7 @@ public final class MD_ScopeCode extends * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_ScopeCode") + @XmlElement(name = "MD_ScopeCode", namespace = Namespaces.MCC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_SpatialRepresentationTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_SpatialRepresentationTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_SpatialRepresentationTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_SpatialRepresentationTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.spatial.SpatialRepresentationType; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link SpatialRepresentationType}, in order to integrate the value in an - * element respecting the ISO-19139 standard. See package documentation for more information - * about the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link SpatialRepresentationType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -74,7 +75,7 @@ public final class MD_SpatialRepresentat * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_SpatialRepresentationTypeCode") + @XmlElement(name = "MD_SpatialRepresentationTypeCode", namespace = Namespaces.MCC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopicCategoryCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopicCategoryCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopicCategoryCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopicCategoryCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,17 +20,18 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.identification.TopicCategory; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link TopicCategory}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information - * about the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link TopicCategory} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) * @author Guihem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.3 * @module */ @@ -82,7 +83,7 @@ public final class MD_TopicCategoryCode * @return The value to be marshalled. */ @Override - @XmlElement(name = "MD_TopicCategoryCode") + @XmlElement(name = "MD_TopicCategoryCode", namespace = Namespaces.MRI) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopologyLevelCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopologyLevelCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopologyLevelCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_TopologyLevelCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlElem import org.opengis.metadata.spatial.TopologyLevel; import org.apache.sis.internal.jaxb.gmd.CodeListAdapter; import org.apache.sis.internal.jaxb.gmd.CodeListUID; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link TopologyLevel}, in order to integrate the value in an element - * complying with ISO-19139 standard. See package documentation for more information about - * the handling of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link TopologyLevel} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -72,7 +73,7 @@ public final class MD_TopologyLevelCode * @return the value to be marshalled. */ @Override - @XmlElement(name = "MD_TopologyLevelCode") + @XmlElement(name = "MD_TopologyLevelCode", namespace = Namespaces.MSR) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_BandDefinition.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_BandDefinition.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_BandDefinition.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_BandDefinition.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link BandDefinition}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link BandDefinition} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_BandDefinition ext * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_BandDefinition", namespace = Namespaces.GMI) + @XmlElement(name = "MI_BandDefinition", namespace = Namespaces.MRC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ContextCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ContextCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ContextCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ContextCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Context}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Context} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_ContextCode extend * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_ContextCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_ContextCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_GeometryTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_GeometryTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_GeometryTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_GeometryTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link GeometryType}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link GeometryType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_GeometryTypeCode e * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_GeometryTypeCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_GeometryTypeCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ObjectiveTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ObjectiveTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ObjectiveTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_ObjectiveTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link ObjectiveType}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link ObjectiveType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_ObjectiveTypeCode * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_ObjectiveTypeCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_ObjectiveTypeCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_OperationTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_OperationTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_OperationTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_OperationTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link OperationType}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link OperationType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_OperationTypeCode * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_OperationTypeCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_OperationTypeCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PolarizationOrientationCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PolarizationOrientationCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PolarizationOrientationCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PolarizationOrientationCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,14 +24,17 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link PolarizationOrientation}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link PolarizationOrientation} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) - * @version 0.3 - * @since 0.3 + * @version 1.0 + * + * @see <a href="https://issues.apache.org/jira/browse/SIS-398">SIS-398</a> + * + * @since 0.3 * @module */ public final class MI_PolarizationOrientationCode @@ -76,7 +79,7 @@ public final class MI_PolarizationOrient * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_PolarizationOrientationCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_PolarisationOrientationCode", namespace = Namespaces.MRC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PriorityCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PriorityCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PriorityCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_PriorityCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Priority}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Priority} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_PriorityCode exten * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_PriorityCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_PriorityCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_SequenceCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_SequenceCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_SequenceCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_SequenceCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Sequence}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Sequence} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_SequenceCode exten * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_SequenceCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_SequenceCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TransferFunctionTypeCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TransferFunctionTypeCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TransferFunctionTypeCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TransferFunctionTypeCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link TransferFunctionType}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link TransferFunctionType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -75,7 +75,7 @@ public final class MI_TransferFunctionTy * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_TransferFunctionTypeCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_TransferFunctionTypeCode", namespace = Namespaces.MRC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TriggerCode.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TriggerCode.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TriggerCode.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MI_TriggerCode.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -24,12 +24,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Trigger}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Trigger} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ public final class MI_TriggerCode extend * @return the value to be marshalled. */ @Override - @XmlElement(name = "MI_TriggerCode", namespace = Namespaces.GMI) + @XmlElement(name = "MI_TriggerCode", namespace = Namespaces.MAC) public CodeListUID getElement() { return identifier; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -17,24 +17,25 @@ package org.apache.sis.internal.jaxb.code; import java.util.Locale; +import java.nio.charset.Charset; import javax.xml.bind.Marshaller; import javax.xml.bind.PropertyException; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.opengis.metadata.identification.CharacterSet; -import org.apache.sis.util.iso.Types; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.jaxb.Context; import org.apache.sis.internal.jaxb.gmd.Country; import org.apache.sis.internal.jaxb.gmd.LanguageCode; import org.apache.sis.internal.jaxb.gmd.PT_FreeText; +import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@link Locale}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@link Locale} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * <p>This adapter formats the locale like below:</p> * @@ -58,7 +59,8 @@ import org.apache.sis.internal.jaxb.gmd. * For an alternative (simpler) format, see {@link org.apache.sis.internal.jaxb.gmd.LocaleAdapter}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * * @see LanguageCode * @see Country @@ -71,18 +73,19 @@ public final class PT_Locale extends Xml /** * The attributes wrapped in a {@code "PT_Locale"} element. */ - @XmlElement(name = "PT_Locale") + @XmlElement(name = "PT_Locale", namespace = Namespaces.LAN) private Wrapper element; /** * Wraps the {@code "locale"} attributes in a {@code "PT_Locale"} element. */ - @XmlType(name = "PT_Locale", propOrder = { "languageCode", "country", "characterEncoding" }) + @XmlType(name = "PT_Locale_Type", namespace = Namespaces.LAN, propOrder = { + "languageCode", "language", "country", "characterEncoding" + }) private static final class Wrapper { /** * The language code, or {@code null} if none. */ - @XmlElement(required = true) LanguageCode languageCode; /** @@ -107,7 +110,13 @@ public final class PT_Locale extends Xml */ @XmlElement(required = true) @XmlJavaTypeAdapter(MD_CharacterSetCode.class) - CharacterSet characterEncoding; + Charset characterEncoding; + + /** + * {@code true} if marshalling an element from the ISO 19115:2003 model, + * or {@code false} if marshalling an element from the ISO 19115:2014 model. + */ + private boolean isLegacyMetadata; /** * Empty constructor for JAXB only. @@ -120,12 +129,45 @@ public final class PT_Locale extends Xml */ Wrapper(final Locale locale) { final Context context = Context.current(); - languageCode = LanguageCode.create(context, locale); - country = Country .create(context, locale); + isLegacyMetadata = Context.isFlagSet(context, Context.LEGACY_METADATA); + languageCode = LanguageCode.create(context, locale); + country = Country .create(context, locale); // The characterEncoding field will be initialized at marshalling time (see method below). } /** + * Gets the language code for this PT_Locale. Used in ISO 19115:2003 model. + */ + @XmlElement(name = "languageCode", namespace = LegacyNamespaces.GMD) + private LanguageCode getLanguageCode() { + return isLegacyMetadata ? languageCode : null; + } + + /** + * Sets the language code for this PT_Locale. Used in ISO 19115:2003 model. + */ + @SuppressWarnings("unused") + private void setLanguageCode(LanguageCode newValue) { + languageCode = newValue; + } + + /** + * Gets the language code for this PT_Locale. Used in ISO 19115-3. + */ + @XmlElement(name = "language", required = true) + private LanguageCode getLanguage() { + return isLegacyMetadata ? null : languageCode; + } + + /** + * Sets the language code for this PT_Locale. Used in ISO 19115:2003 model. + */ + @SuppressWarnings("unused") + private void setLanguage(LanguageCode newValue) { + languageCode = newValue; + } + + /** * Invoked by JAXB {@link javax.xml.bind.Marshaller} before this object is marshalled to XML. * This method sets the {@link #characterEncoding} to the XML encoding. * @@ -143,7 +185,8 @@ public final class PT_Locale extends Xml return; } if (encoding != null) { - characterEncoding = Types.forCodeName(CharacterSet.class, encoding, true); + final Context context = Context.current(); + characterEncoding = Context.converter(context).toCharset(context, encoding); } } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_CouplingType.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_CouplingType.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_CouplingType.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_CouplingType.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -23,12 +23,12 @@ import org.apache.sis.xml.Namespaces; /** - * JAXB adapter for {@code CouplingType}, in order to integrate the value in an element respecting - * the ISO-19139 standard. See package documentation for more information about the handling - * of {@code CodeList} in ISO-19139. + * JAXB adapter for {@code CouplingType} + * in order to wrap the value in an XML element as specified by ISO 19115-3 standard. + * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3. * * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.5 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -30,7 +30,9 @@ * </ul> * * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @author Martin Desruisseaux (Geomatys) + * @author Cullen Rombach (Image Matters) + * @version 1.0 * * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter * @see org.opengis.util.CodeList @@ -38,10 +40,21 @@ * @since 0.3 * @module */ -@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO) +@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, xmlns = { + @XmlNs(prefix = "mri", namespaceURI = Namespaces.MRI), // Metadata for Resource Identification + @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC), // Metadata for Resource Content + @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD), // Metadata for Resource Distribution + @XmlNs(prefix = "mmi", namespaceURI = Namespaces.MMI), // Metadata for Maintenance Information + @XmlNs(prefix = "msr", namespaceURI = Namespaces.MSR), // Metadata for Spatial Representation + @XmlNs(prefix = "mex", namespaceURI = Namespaces.MEX), // Metadata with Schema Extensions + @XmlNs(prefix = "mac", namespaceURI = Namespaces.MAC), // Metadata for Acquisition + @XmlNs(prefix = "mdq", namespaceURI = Namespaces.MDQ), // Metadata for Data Quality + @XmlNs(prefix = "mco", namespaceURI = Namespaces.MCO), // Metadata for Constraints + @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV), // Metadata for Services + @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT), // Citation and responsible party information + @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN), // Language localization + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes + @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD) }) package org.apache.sis.internal.jaxb.code; @@ -49,3 +62,4 @@ import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema; import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.LegacyNamespaces; Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -25,15 +25,16 @@ * will be substituted to that interface.</p> * * @author Guilhem Legal (Geomatys) - * @version 0.3 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter * * @since 0.3 * @module */ -@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GML, xmlns = { - @XmlNs(prefix = "gml", namespaceURI = Namespaces.GML) +@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GEX, xmlns = { + @XmlNs(prefix = "gex", namespaceURI = Namespaces.GEX) }) @XmlAccessorType(XmlAccessType.NONE) package org.apache.sis.internal.jaxb.geometry; Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.lineage.ProcessStep; import org.apache.sis.metadata.iso.lineage.DefaultProcessStep; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -29,12 +30,12 @@ import static org.apache.sis.util.collec * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "LE_ProcessStep_Type") -@XmlRootElement(name = "LE_ProcessStep") +@XmlType(name = "LE_ProcessStep_Type", namespace = Namespaces.MRL) +@XmlRootElement(name = "LE_ProcessStep", namespace = Namespaces.MRL) @SuppressWarnings("CloneableClassWithoutClone") public class LE_ProcessStep extends DefaultProcessStep { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.lineage.Source; import org.apache.sis.metadata.iso.lineage.DefaultSource; +import org.apache.sis.xml.Namespaces; /** @@ -27,12 +28,12 @@ import org.apache.sis.metadata.iso.linea * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "LE_Source_Type") -@XmlRootElement(name = "LE_Source") +@XmlType(name = "LE_Source_Type", namespace = Namespaces.MRL) +@XmlRootElement(name = "LE_Source", namespace = Namespaces.MRL) @SuppressWarnings("CloneableClassWithoutClone") public class LE_Source extends DefaultSource { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.content.Band; import org.apache.sis.metadata.iso.content.DefaultBand; +import org.apache.sis.xml.Namespaces; /** @@ -27,12 +28,12 @@ import org.apache.sis.metadata.iso.conte * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "MI_Band_Type") -@XmlRootElement(name = "MI_Band") +@XmlType(name = "MI_Band_Type", namespace = Namespaces.MRC) +@XmlRootElement(name = "MI_Band", namespace = Namespaces.MRC) @SuppressWarnings("CloneableClassWithoutClone") public class MI_Band extends DefaultBand { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.content.CoverageDescription; import org.apache.sis.metadata.iso.content.DefaultCoverageDescription; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -29,12 +30,12 @@ import static org.apache.sis.util.collec * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "MI_CoverageDescription_Type") -@XmlRootElement(name = "MI_CoverageDescription") +@XmlType(name = "MI_CoverageDescription_Type", namespace = Namespaces.MRC) +@XmlRootElement(name = "MI_CoverageDescription", namespace = Namespaces.MRC) @SuppressWarnings("CloneableClassWithoutClone") public class MI_CoverageDescription extends DefaultCoverageDescription { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.spatial.Georectified; import org.apache.sis.metadata.iso.spatial.DefaultGeorectified; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -29,12 +30,12 @@ import static org.apache.sis.util.collec * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "MI_Georectified_Type") -@XmlRootElement(name = "MI_Georectified") +@XmlType(name = "MI_Georectified_Type", namespace = Namespaces.MSR) +@XmlRootElement(name = "MI_Georectified", namespace = Namespaces.MSR) @SuppressWarnings("CloneableClassWithoutClone") public class MI_Georectified extends DefaultGeorectified { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.spatial.Georeferenceable; import org.apache.sis.metadata.iso.spatial.DefaultGeoreferenceable; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -29,12 +30,12 @@ import static org.apache.sis.util.collec * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "MI_Georeferenceable_Type") -@XmlRootElement(name = "MI_Georeferenceable") +@XmlType(name = "MI_Georeferenceable_Type", namespace = Namespaces.MSR) +@XmlRootElement(name = "MI_Georeferenceable", namespace = Namespaces.MSR) @SuppressWarnings("CloneableClassWithoutClone") public class MI_Georeferenceable extends DefaultGeoreferenceable { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.content.ImageDescription; import org.apache.sis.metadata.iso.content.DefaultImageDescription; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -29,12 +30,12 @@ import static org.apache.sis.util.collec * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlType(name = "MI_ImageDescription_Type") -@XmlRootElement(name = "MI_ImageDescription") +@XmlType(name = "MI_ImageDescription_Type", namespace = Namespaces.MRC) +@XmlRootElement(name = "MI_ImageDescription", namespace = Namespaces.MRC) @SuppressWarnings("CloneableClassWithoutClone") public class MI_ImageDescription extends DefaultImageDescription { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.Metadata; import org.apache.sis.metadata.iso.DefaultMetadata; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -33,8 +34,8 @@ import static org.apache.sis.util.collec * @since 0.3 * @module */ -@XmlType(name = "MI_Metadata_Type") -@XmlRootElement(name = "MI_Metadata") +@XmlType(name = "MI_Metadata_Type", namespace = LegacyNamespaces.GMI) +@XmlRootElement(name = "MI_Metadata", namespace = LegacyNamespaces.GMI) @SuppressWarnings("CloneableClassWithoutClone") public class MI_Metadata extends DefaultMetadata { /** Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -16,8 +16,8 @@ */ /** - * Extends some classes from the {@link org.apache.sis.metadata.iso} package in order - * to give them the {@code "gmi"} namespace. This is required for XML (un)marshalling + * Extends some classes from {@link org.apache.sis.metadata.iso} packages in order to give them + * the name used by imagery extensions (ISO 19115-2). This is required for XML (un)marshalling * because GeoAPI merged some classes which were dissociated in the ISO specifications. * The GeoAPI merge were done in order to simplify the conceptual model for developers, * since the classes were different in ISO specifications for historical reasons - not @@ -32,13 +32,15 @@ * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMI, xmlns = { - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO) +@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, xmlns = { + @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC), + @XmlNs(prefix = "mrl", namespaceURI = Namespaces.MRL), + @XmlNs(prefix = "msr", namespaceURI = Namespaces.MSR), + @XmlNs(prefix = "gmi", namespaceURI = LegacyNamespaces.GMI) }) @XmlAccessorType(XmlAccessType.NONE) package org.apache.sis.internal.jaxb.gmi; @@ -48,4 +50,5 @@ import javax.xml.bind.annotation.XmlNsFo import javax.xml.bind.annotation.XmlSchema; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.xml.Namespaces; Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java (from r1825261, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java) URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java&p1=sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java&r1=1825261&r2=1825355&rev=1825355&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_Duration.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -17,7 +17,7 @@ package org.apache.sis.internal.jaxb.gts; import javax.xml.bind.annotation.XmlElement; -import org.opengis.temporal.Duration; +import javax.xml.datatype.Duration; import org.opengis.temporal.PeriodDuration; import org.apache.sis.internal.jaxb.Context; import org.apache.sis.internal.jaxb.gco.PropertyType; @@ -99,6 +99,6 @@ public final class TM_Duration extends P * @param duration The adapter to set. */ public void setElement(final javax.xml.datatype.Duration duration) { - metadata = TM_PeriodDuration.toISO(duration); + metadata = /*TM_PeriodDuration.toISO*/(duration); } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/TM_PeriodDuration.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -40,15 +40,16 @@ import org.apache.sis.util.iso.SimpleInt * API in geoapi-pending, which is not very clear... We prefer to hide this for now. * * @author Guilhem Legal (Geomatys) - * @version 0.3 + * @author Martin Desruisseaux (Geomatys) + * @version 1.0 * @since 0.3 * @module */ -public final class TM_PeriodDuration extends PropertyType<TM_PeriodDuration, PeriodDuration> { +public class TM_PeriodDuration extends PropertyType<TM_PeriodDuration, PeriodDuration> { /** * Empty constructor for JAXB. */ - public TM_PeriodDuration() { + TM_PeriodDuration() { } /** @@ -77,7 +78,7 @@ public final class TM_PeriodDuration ext * @return {@code PeriodDuration.class} */ @Override - protected Class<PeriodDuration> getBoundType() { + protected final Class<PeriodDuration> getBoundType() { return PeriodDuration.class; } @@ -88,16 +89,23 @@ public final class TM_PeriodDuration ext * @return the time period, or {@code null}. */ @XmlElement(name = "TM_PeriodDuration") - public Duration getElement() { - if (metadata instanceof org.apache.sis.internal.geoapi.temporal.PeriodDuration) try { + public final Duration getElement() { + return toXML(metadata); + } + + /** + * Converts the given ISO 19108 duration into a Java XML duration. + */ + static Duration toXML(final PeriodDuration duration) { + if (duration instanceof org.apache.sis.internal.geoapi.temporal.PeriodDuration) try { + final org.apache.sis.internal.geoapi.temporal.PeriodDuration metadata = + (org.apache.sis.internal.geoapi.temporal.PeriodDuration) duration; /* * Get the DatatypeFactory first because if not available, then we don't need to parse * the calendar fields. This has the side effect of not validating the calendar fields * syntax (which should be integer values), but maybe this is what the user wants. */ final DatatypeFactory factory = XmlUtilities.getDatatypeFactory(); - final org.apache.sis.internal.geoapi.temporal.PeriodDuration metadata = - (org.apache.sis.internal.geoapi.temporal.PeriodDuration) this.metadata; InternationalString value; BigInteger years = null; if ((value = metadata.getYears()) != null) { @@ -125,7 +133,7 @@ public final class TM_PeriodDuration ext } return factory.newDuration(true, years, months, days, hours, minutes, seconds); } catch (DatatypeConfigurationException e) { - warningOccured("getElement", e); + warningOccured("toXML", e); } return null; } @@ -136,8 +144,14 @@ public final class TM_PeriodDuration ext * * @param duration the adapter to set. */ - public void setElement(final Duration duration) { - metadata = null; // Cleaned first in case of failure. + public final void setElement(final Duration duration) { + metadata = toISO(duration); + } + + /** + * Converts the given Java XML duration into an ISO 19108 duration. + */ + static PeriodDuration toISO(final Duration duration) { if (duration != null) try { final TemporalFactory factory = TemporalUtilities.getTemporalFactory(); InternationalString years = null; @@ -166,10 +180,11 @@ public final class TM_PeriodDuration ext if ((value = duration.getSeconds()) != 0) { seconds = new SimpleInternationalString(Integer.toString(value)); } - metadata = factory.createPeriodDuration(years, months, weeks, days, hours, minutes, seconds); + return factory.createPeriodDuration(years, months, weeks, days, hours, minutes, seconds); } catch (UnsupportedOperationException e) { - warningOccured("setElement", e); + warningOccured("toISO", e); } + return null; } /** @@ -183,4 +198,23 @@ public final class TM_PeriodDuration ext Context.warningOccured(Context.current(), TM_PeriodDuration.class, methodName, e, true); } } + + /** + * Wraps the value only if marshalling an element from the ISO 19115:2003 metadata model. + * Otherwise (i.e. if marshalling according legacy ISO 19115:2014 model), omits the element. + */ + public static final class Since2014 extends TM_PeriodDuration { + /** Empty constructor used only by JAXB. */ + public Since2014() { + } + + /** + * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document. + * + * @return a non-null value only if marshalling ISO 19115-3 or newer. + */ + @Override protected TM_PeriodDuration wrap(final PeriodDuration value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gts/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -19,7 +19,9 @@ * Temporary placeholder for the Temporal Schema JAXB adapters. * * @author Guilhem Legal (Geomatys) - * @version 0.3 + * @author Martin Desruisseaux (Geomatys) + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -28,11 +28,11 @@ import org.apache.sis.internal.jaxb.gco. * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -public final class CI_Citation extends PropertyType<CI_Citation, Citation> { +public class CI_Citation extends PropertyType<CI_Citation, Citation> { /** * Empty constructor for JAXB only. */ @@ -47,7 +47,7 @@ public final class CI_Citation extends P * @return {@code Citation.class} */ @Override - protected Class<Citation> getBoundType() { + protected final Class<Citation> getBoundType() { return Citation.class; } @@ -78,7 +78,7 @@ public final class CI_Citation extends P * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultCitation getElement() { + public final DefaultCitation getElement() { return DefaultCitation.castOrCopy(metadata); } @@ -87,7 +87,26 @@ public final class CI_Citation extends P * * @param metadata the unmarshalled metadata. */ - public void setElement(final DefaultCitation metadata) { + public final void setElement(final DefaultCitation metadata) { this.metadata = metadata; } + + /** + * Wraps the value only if marshalling an element from the ISO 19115:2003 metadata model. + * Otherwise (i.e. if marshalling according legacy ISO 19115:2014 model), omits the element. + */ + public static final class Since2014 extends CI_Citation { + /** Empty constructor used only by JAXB. */ + public Since2014() { + } + + /** + * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document. + * + * @return a non-null value only if marshalling ISO 19115-3 or newer. + */ + @Override protected CI_Citation wrap(final Citation value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_OnlineResource.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_OnlineResource.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_OnlineResource.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_OnlineResource.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -28,11 +28,11 @@ import org.apache.sis.internal.jaxb.gco. * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -public final class CI_OnlineResource extends PropertyType<CI_OnlineResource, OnlineResource> { +public class CI_OnlineResource extends PropertyType<CI_OnlineResource, OnlineResource> { /** * Empty constructor for JAXB only. */ @@ -47,7 +47,7 @@ public final class CI_OnlineResource ext * @return {@code OnlineResource.class} */ @Override - protected Class<OnlineResource> getBoundType() { + protected final Class<OnlineResource> getBoundType() { return OnlineResource.class; } @@ -78,7 +78,7 @@ public final class CI_OnlineResource ext * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultOnlineResource getElement() { + public final DefaultOnlineResource getElement() { return DefaultOnlineResource.castOrCopy(metadata); } @@ -87,7 +87,26 @@ public final class CI_OnlineResource ext * * @param metadata the unmarshalled metadata. */ - public void setElement(final DefaultOnlineResource metadata) { + public final void setElement(final DefaultOnlineResource metadata) { this.metadata = metadata; } + + /** + * Wraps the value only if marshalling an element from the ISO 19115:2003 metadata model. + * Otherwise (i.e. if marshalling according legacy ISO 19115:2014 model), omits the element. + */ + public static final class Since2014 extends CI_OnlineResource { + /** Empty constructor used only by JAXB. */ + public Since2014() { + } + + /** + * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document. + * + * @return a non-null value only if marshalling ISO 19115-3 or newer. + */ + @Override protected CI_OnlineResource wrap(final OnlineResource value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Responsibility.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -17,9 +17,11 @@ package org.apache.sis.internal.jaxb.metadata; import javax.xml.bind.annotation.XmlElementRef; +import org.opengis.metadata.citation.ResponsibleParty; import org.apache.sis.metadata.iso.citation.DefaultResponsibility; -import org.apache.sis.internal.jaxb.gco.PropertyType; import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty; +import org.apache.sis.internal.jaxb.gco.PropertyType; +import org.apache.sis.internal.jaxb.FilterByVersion; /** @@ -27,7 +29,8 @@ import org.apache.sis.metadata.iso.citat * package documentation for more information about JAXB and interface. * * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @since 1.0 * @since 0.5 * @module */ @@ -77,10 +80,20 @@ public final class CI_Responsibility ext @XmlElementRef @SuppressWarnings("deprecation") public DefaultResponsibility getElement() { - if (LEGACY_XML && !(metadata instanceof DefaultResponsibleParty)) { - return new DefaultResponsibleParty(metadata); - } else { + if (FilterByVersion.CURRENT_METADATA.accept()) { + if (metadata instanceof ResponsibleParty) { + // Need to build new DefaultResponsibility object here — simply casting doesn't work. + return new DefaultResponsibility(metadata); + } return metadata; + } else if (FilterByVersion.LEGACY_METADATA.accept()) { + if (metadata instanceof DefaultResponsibleParty) { + return metadata; + } else { + return new DefaultResponsibleParty(metadata); + } + } else { + return null; } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_ResponsibleParty.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_ResponsibleParty.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_ResponsibleParty.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_ResponsibleParty.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -17,9 +17,16 @@ package org.apache.sis.internal.jaxb.metadata; import javax.xml.bind.annotation.XmlElementRef; +import org.opengis.util.InternationalString; +import org.opengis.metadata.citation.Contact; import org.opengis.metadata.citation.ResponsibleParty; +import org.apache.sis.metadata.iso.citation.AbstractParty; +import org.apache.sis.metadata.iso.citation.DefaultIndividual; +import org.apache.sis.metadata.iso.citation.DefaultOrganisation; +import org.apache.sis.metadata.iso.citation.DefaultResponsibility; import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty; import org.apache.sis.internal.jaxb.gco.PropertyType; +import org.apache.sis.internal.jaxb.FilterByVersion; /** @@ -28,7 +35,7 @@ import org.apache.sis.internal.jaxb.gco. * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -79,16 +86,43 @@ public final class CI_ResponsibleParty e * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultResponsibleParty getElement() { - return DefaultResponsibleParty.castOrCopy(metadata); + public DefaultResponsibility getElement() { + if (FilterByVersion.LEGACY_METADATA.accept()) { + return DefaultResponsibleParty.castOrCopy(metadata); + } else if (metadata != null) { + final DefaultIndividual individual; + final String name = metadata.getIndividualName(); + Contact contact = metadata.getContactInfo(); + AbstractParty party; + if (name != null) { + individual = new DefaultIndividual(name, metadata.getPositionName(), contact); + party = individual; + contact = null; + } else { + individual = null; + party = null; + } + final InternationalString organisation = metadata.getOrganisationName(); + if (organisation != null) { + party = new DefaultOrganisation(organisation, null, individual, contact); + } + if (party != null) { + return new DefaultResponsibility(metadata.getRole(), null, party); + } + } + return null; } /** * Invoked by JAXB at unmarshalling time for storing the result temporarily. * - * @param metadata the unmarshalled metadata. + * @param md the unmarshalled metadata. */ - public void setElement(final DefaultResponsibleParty metadata) { - this.metadata = metadata; + public void setElement(final DefaultResponsibility md) { + if (md instanceof DefaultResponsibleParty) { + metadata = (DefaultResponsibleParty) md; + } else if (md != null) { + metadata = new DefaultResponsibleParty(md); + } } }
