Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Resolution.java [UTF-8] Sat Feb 24 16:13:58 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 MD_Resolution extends PropertyType<MD_Resolution, Resolution> { +public class MD_Resolution extends PropertyType<MD_Resolution, Resolution> { /** * Empty constructor for JAXB only. */ @@ -47,7 +47,7 @@ public final class MD_Resolution extends * @return {@code Resolution.class} */ @Override - protected Class<Resolution> getBoundType() { + protected final Class<Resolution> getBoundType() { return Resolution.class; } @@ -78,7 +78,7 @@ public final class MD_Resolution extends * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultResolution getElement() { + public final DefaultResolution getElement() { return DefaultResolution.castOrCopy(metadata); } @@ -87,7 +87,26 @@ public final class MD_Resolution extends * * @param metadata the unmarshalled metadata. */ - public void setElement(final DefaultResolution metadata) { + public final void setElement(final DefaultResolution 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 MD_Resolution { + /** 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 MD_Resolution wrap(final Resolution value) { + return accept2014() ? super.wrap(value) : null; + } + } }
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -23,16 +23,16 @@ import org.apache.sis.internal.jaxb.gco. /** - * JAXB adapter in order to map implementing class with the GeoAPI interface. See - * package documentation for more information about JAXB and interface. + * JAXB adapter in order to map implementing class with the GeoAPI interface. + * See package documentation for more information about JAXB and interface. * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ -public final class MD_Scope extends PropertyType<MD_Scope, Scope> { +public class MD_Scope extends PropertyType<MD_Scope, Scope> { /** * Empty constructor for JAXB only. */ @@ -47,7 +47,7 @@ public final class MD_Scope extends Prop * @return {@code Scope.class} */ @Override - protected Class<Scope> getBoundType() { + protected final Class<Scope> getBoundType() { return Scope.class; } @@ -60,7 +60,7 @@ public final class MD_Scope extends Prop /** * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value - * in a {@code <gmd:DQ_Scope>} XML element. + * in a {@code <mcc:MD_Scope>} XML element. * * @param metadata the metadata element to marshall. * @return a {@code PropertyType} wrapping the given the metadata element. @@ -72,13 +72,13 @@ public final class MD_Scope extends Prop /** * Invoked by JAXB at marshalling time for getting the actual metadata to write - * inside the {@code <gmd:DQ_Scope>} XML element. + * inside the {@code <mcc:MD_Scope>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultScope getElement() { + public final DefaultScope getElement() { return DefaultScope.castOrCopy(metadata); } @@ -87,7 +87,26 @@ public final class MD_Scope extends Prop * * @param metadata the unmarshalled metadata. */ - public void setElement(final DefaultScope metadata) { + public final void setElement(final DefaultScope 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 MD_Scope { + /** 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 MD_Scope wrap(final Scope value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -26,7 +26,7 @@ import org.apache.sis.internal.jaxb.gco. * JAXB adapter mapping the GeoAPI {@link Identifier} to an implementation class that can * be marshalled. See the package documentation for more information about JAXB and interfaces. * - * <p>The XML produced by this adapter shall be compliant to the ISO 19139 syntax.</p> + * <p>The XML produced by this adapter shall be compliant to the ISO 19115-3 syntax.</p> * * Note that a class of the same name is defined in the {@link org.apache.sis.internal.jaxb.referencing} * package, which serves the same purpose (wrapping exactly the same interface) but using the GML syntax Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -27,11 +27,11 @@ import org.apache.sis.internal.jaxb.meta * package documentation for more information about JAXB and interface. * * @author Guilhem Legal (Geomatys) - * @version 0.4 + * @version 1.0 * @since 0.3 * @module */ -public final class RS_ReferenceSystem extends PropertyType<RS_ReferenceSystem, ReferenceSystem> { +public class RS_ReferenceSystem extends PropertyType<RS_ReferenceSystem, ReferenceSystem> { /** * Empty constructor for JAXB only. */ @@ -46,7 +46,7 @@ public final class RS_ReferenceSystem ex * @return {@code ReferenceSystem.class} */ @Override - protected Class<ReferenceSystem> getBoundType() { + protected final Class<ReferenceSystem> getBoundType() { return ReferenceSystem.class; } @@ -79,7 +79,7 @@ public final class RS_ReferenceSystem ex * @return the metadata to be marshalled. */ @XmlElementRef - public ReferenceSystemMetadata getElement() { + public final ReferenceSystemMetadata getElement() { final ReferenceSystem metadata = this.metadata; if (metadata == null) { return null; @@ -95,7 +95,26 @@ public final class RS_ReferenceSystem ex * * @param metadata the unmarshalled metadata. */ - public void setElement(final ReferenceSystemMetadata metadata) { + public final void setElement(final ReferenceSystemMetadata 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 RS_ReferenceSystem { + /** 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 RS_ReferenceSystem wrap(final ReferenceSystem value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_OperationMetadata.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -27,11 +27,11 @@ import org.apache.sis.internal.jaxb.gco. * package documentation for more information about JAXB and interface. * * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.5 * @module */ -public final class SV_OperationMetadata extends PropertyType<SV_OperationMetadata, OperationMetadata> { +public class SV_OperationMetadata extends PropertyType<SV_OperationMetadata, OperationMetadata> { /** * Empty constructor for JAXB only. */ @@ -46,7 +46,7 @@ public final class SV_OperationMetadata * @return {@code OperationMetadata.class} */ @Override - protected Class<OperationMetadata> getBoundType() { + protected final Class<OperationMetadata> getBoundType() { return OperationMetadata.class; } @@ -77,7 +77,7 @@ public final class SV_OperationMetadata * @return the metadata to be marshalled. */ @XmlElementRef - public DefaultOperationMetadata getElement() { + public final DefaultOperationMetadata getElement() { return DefaultOperationMetadata.castOrCopy(metadata); } @@ -86,7 +86,26 @@ public final class SV_OperationMetadata * * @param metadata the unmarshalled metadata. */ - public void setElement(final DefaultOperationMetadata metadata) { + public final void setElement(final DefaultOperationMetadata 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 SV_OperationMetadata { + /** 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 SV_OperationMetadata wrap(final OperationMetadata value) { + return accept2014() ? super.wrap(value) : null; + } + } } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -49,7 +49,8 @@ * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @since 1.0 * * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter * Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -17,18 +17,26 @@ package org.apache.sis.internal.jaxb.metadata.replace; import java.util.Objects; +import javax.xml.bind.Marshaller; +import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.opengis.metadata.Identifier; import org.opengis.referencing.ReferenceSystem; +import org.apache.sis.internal.jaxb.metadata.MD_Identifier; +import org.apache.sis.internal.jaxb.metadata.RS_Identifier; import org.apache.sis.internal.simple.SimpleIdentifiedObject; +import org.apache.sis.internal.jaxb.FilterByVersion; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.util.ComparisonMode; +import org.apache.sis.xml.Namespaces; /** * An implementation of {@link ReferenceSystem} marshalled as specified in ISO 19115. * This is different than the {@code ReferenceSystem} implementation provided in the - * referencing module, since the later marshall the CRS as specified in GML (close + * referencing module, since the later marshals the CRS as specified in GML (close * to ISO 19111 model). * * <p>Note that this implementation is very simple and serves no other purpose than being @@ -37,14 +45,16 @@ import org.apache.sis.util.ComparisonMod * * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * * @see org.apache.sis.referencing.AbstractReferenceSystem * * @since 0.3 * @module */ -@XmlRootElement(name = "MD_ReferenceSystem") +@XmlType(name = "MD_ReferenceSystem_Type", namespace = Namespaces.MRS) +@XmlRootElement(name = "MD_ReferenceSystem", namespace = Namespaces.MRS) public class ReferenceSystemMetadata extends SimpleIdentifiedObject implements ReferenceSystem { /** * For cross-version compatibility. @@ -52,6 +62,11 @@ public class ReferenceSystemMetadata ext private static final long serialVersionUID = 2810145397032096087L; /** + * {@code true} if marshalling ISO 19115:2003 model, or {@code false} if marshalling ISO 19115:2014 model. + */ + private boolean isLegacyMetadata; + + /** * Creates a reference system without identifier. * This constructor is mainly for JAXB. */ @@ -77,14 +92,23 @@ public class ReferenceSystemMetadata ext } /** + * Invoked by JAXB {@link javax.xml.bind.Marshaller} before this object is marshalled to XML. + */ + private void beforeMarshal(final Marshaller marshaller) { + isLegacyMetadata = !FilterByVersion.CURRENT_METADATA.accept(); + } + + /** * Returns the primary name by which this object is identified. + * This method can be invoked during ISO 19115-3 marshalling. * * @return the identifier given at construction time. */ @Override @XmlElement(name = "referenceSystemIdentifier") + @XmlJavaTypeAdapter(MD_Identifier.class) public final Identifier getName() { - return super.getName(); + return isLegacyMetadata ? null : super.getName(); } /** @@ -96,6 +120,24 @@ public class ReferenceSystemMetadata ext this.name = name; } + /** + * Gets the name for this reference system metadata (used in ISO 19115:2003 model). + * This method can be invoked during marshalling of legacy XML documents. + */ + @XmlElement(name = "referenceSystemIdentifier", namespace = LegacyNamespaces.GMD) + @XmlJavaTypeAdapter(RS_Identifier.class) + private Identifier getLegacyName() { + return isLegacyMetadata ? super.getName() : null; + } + + /** + * Sets the name for this reference system metadata (used in ISO 19115:2003 model). + */ + @SuppressWarnings("unused") + private void setLegacyName(final Identifier name) { + this.name = name; + } + /** * Compares this object with the given one for equality. * Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -32,16 +32,19 @@ import org.opengis.parameter.ParameterVa import org.opengis.parameter.ParameterDirection; import org.opengis.parameter.ParameterDescriptor; import org.apache.sis.internal.simple.SimpleIdentifiedObject; -import org.apache.sis.internal.jaxb.metadata.direct.GO_MemberName; +import org.apache.sis.internal.jaxb.FilterByVersion; +import org.apache.sis.internal.jaxb.LegacyNamespaces; +import org.apache.sis.internal.jaxb.gco.GO_GenericName; import org.apache.sis.internal.metadata.ReferencingServices; import org.apache.sis.internal.metadata.NameToIdentifier; -import org.apache.sis.util.ComparisonMode; +import org.apache.sis.util.iso.DefaultMemberName; import org.apache.sis.util.iso.Names; import org.apache.sis.xml.Namespaces; +import org.apache.sis.util.ComparisonMode; +import org.apache.sis.util.resources.Errors; import static org.apache.sis.util.Utilities.deepEquals; import static org.apache.sis.internal.util.CollectionsExt.nonNull; -import static org.apache.sis.internal.jaxb.gco.PropertyType.LEGACY_XML; /** @@ -63,16 +66,18 @@ import static org.apache.sis.internal.ja * * @author Rémi Maréchal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.5 * @module */ @SuppressWarnings("rawtypes") // For the omission of <T> in ParameterDescriptor<T> - see javadoc. @XmlType(name = "SV_Parameter_Type", namespace = Namespaces.SRV, propOrder = { - "memberName", + "memberName", // The ISO 19115-3:2016 way to marshal name. + "legacyName", // Legacy ISO 19139:2007 way to marshal name. "direction", "description", "optionality", + "optionalityLabel", // Legacy ISO 19139:2007 way to marshal optionality. "repeatability", "valueType" }) @@ -84,18 +89,32 @@ public final class ServiceParameter exte private static final long serialVersionUID = -5335736212313243889L; /** - * The name, as used by the service for this parameter. + * The name, as used by the service for this parameter. Note that in ISO 19115-3:2016, this element is + * inside a {@code <gco:MemberName>} element (i.e. ISO inserts the same kind of {@code Property_Type} + * element as it does for all other attributes) while in ISO 19139:2007 it was not (i.e. name attributes + * like {@code <gco:aName>} were marshalled directly, without wrapper). Example: + * + * {@preformat xml + * <srv:name> + * <gco:MemberName> + * <gco:aName> + * <gco:CharacterString>A parameter name</gco:CharacterString> + * </gco:aName> + * </gco:MemberName> + * </srv:name> + * } * + * @see #getLegacyName() * @see #getValueType() */ @XmlElement(required=true, name="name") - @XmlJavaTypeAdapter(GO_MemberName.class) + @XmlJavaTypeAdapter(GO_GenericName.Since2014.class) MemberName memberName; /** * Indication if the parameter is an input to the service, an output or both. */ - @XmlElement + @XmlElement(required = true) ParameterDirection direction; /** @@ -108,12 +127,12 @@ public final class ServiceParameter exte * Indication if the parameter is required. * * <ul> - * <li>In ISO 19115, this is represented by "{@code true}" or "{@code false}".</li> - * <li>In ISO 19119, this is marshalled as "{@code Optional}" or "{@code Mandatory}".</li> + * <li>In ISO 19115-3:2016, this is represented by "{@code true}" or "{@code false}".</li> + * <li>In ISO 19139:2007, this was marshalled as "{@code Optional}" or "{@code Mandatory}".</li> * </ul> * * @see #getOptionality() - * @see #setOptionality(String) + * @see #setOptionality(Boolean) */ public boolean optionality; @@ -197,6 +216,48 @@ public final class ServiceParameter exte } /** + * Returns the name to be marshalled in the ISO 19139:2007 way. Example: + * + * {@preformat xml + * <srv:name> + * <gco:aName> + * <gco:CharacterString>A parameter name</gco:CharacterString> + * </gco:aName> + * </srv:name> + * } + * + * @return the name if marshalling legacy ISO 19139:2007 format, or {@code null} otherwise. + */ + @XmlElement(name = "name", namespace = LegacyNamespaces.SRV) + private DefaultMemberName getLegacyName() { + return FilterByVersion.LEGACY_METADATA.accept() ? DefaultMemberName.castOrCopy(memberName) : null; + } + + /** + * Sets the value from the {@code <gco:aName>} (legacy ISO 19139:2007 format). + * This method is called at unmarshalling-time by JAXB. + * + * @param value the new name. + * @throws IllegalStateException if a name is already defined. + */ + @SuppressWarnings("unused") + private void setLegacyName(final DefaultMemberName value) { + ensureUndefined(); + memberName = value; + } + + /** + * Ensures that the {@linkplain #memberName} is not already defined. + * + * @throws IllegalStateException if a name is already defined. + */ + private void ensureUndefined() throws IllegalStateException { + if (memberName != null) { + throw new IllegalStateException(Errors.format(Errors.Keys.ValueAlreadyDefined_1, "name")); + } + } + + /** * Returns the name as an {@code Identifier}, which is the type requested by ISO 19111. * Note that this is different than the type requested by ISO 19115, which is {@link MemberName}. * @@ -230,13 +291,17 @@ public final class ServiceParameter exte } /** - * For JAXB marhalling of ISO 19119 document only. + * For JAXB marshalling of ISO 19139:2007 document only. * Note that there is not setter method, since we expect the same information * to be provided in the {@link #name} attribute type. */ - @XmlElement(name = "valueType") + @XmlElement(name = "valueType", namespace = LegacyNamespaces.SRV) + @XmlJavaTypeAdapter(GO_GenericName.class) // Not in package-info because shall not be applied to getLegacyName(). final TypeName getValueType() { - return (LEGACY_XML && memberName != null) ? memberName.getAttributeType() : null; + if (memberName != null && FilterByVersion.LEGACY_METADATA.accept()) { + return memberName.getAttributeType(); + } + return null; } /** @@ -260,18 +325,33 @@ public final class ServiceParameter exte } /** - * Returns {@code true} if {@link #optionality} is "{@code true}" or "{@code Optional}", - * or {@code false} otherwise. + * Returns the optionality as a boolean (ISO 19115-3:2016 way). */ @XmlElement(name = "optionality", required = true) - final String getOptionality() { - return LEGACY_XML ? (optionality ? "Optional" : "Mandatory") : Boolean.toString(optionality); + final Boolean getOptionality() { + return FilterByVersion.CURRENT_METADATA.accept() ? optionality : null; + } + + /** + * Sets whether this parameter is optional. + */ + final void setOptionality(final Boolean optional) { + if (optional != null) optionality = optional; + } + + /** + * Returns {@code "Optional"} if {@link #optionality} is {@code true} or {@code "Mandatory"} otherwise. + * This is the legacy ISO 19139:2007 way to marshal optionality. + */ + @XmlElement(name = "optionality", namespace = LegacyNamespaces.SRV) + final String getOptionalityLabel() { + return FilterByVersion.LEGACY_METADATA.accept() ? (optionality ? "Optional" : "Mandatory") : null; } /** * Sets whether this parameter is optional. */ - final void setOptionality(final String optional) { + final void setOptionalityLabel(final String optional) { if (optional != null) { optionality = Boolean.parseBoolean(optional) || optional.equalsIgnoreCase("Optional"); } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -29,26 +29,27 @@ * * @author Martin Desruisseaux (Geomatys) * @author Rémi Maréchal (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @since 1.0 * @since 0.5 * @module */ -@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), - @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), - @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) +@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, xmlns = { + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes + @XmlNs(prefix = "mrs", namespaceURI = Namespaces.MRS), // Metadata for Reference System + @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV), // Metadata for Services 2.0 + @XmlNs(prefix = "srv1", namespaceURI = LegacyNamespaces.SRV), // Metadata for Services 1.0 + @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD) // Metadata ISO 19139:2007 }) @XmlAccessorType(XmlAccessType.NONE) @XmlJavaTypeAdapters({ - @XmlJavaTypeAdapter(RS_Identifier.class), + @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(SV_ParameterDirection.class), // Java types, primitive types and basic OGC types handling @XmlJavaTypeAdapter(StringAdapter.class), @XmlJavaTypeAdapter(InternationalStringAdapter.class), - @XmlJavaTypeAdapter(GO_GenericName.class), - @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class) + @XmlJavaTypeAdapter(value=GO_Boolean.class, type=boolean.class) }) package org.apache.sis.internal.jaxb.metadata.replace; @@ -59,10 +60,7 @@ import javax.xml.bind.annotation.XmlAcce import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters; -import org.apache.sis.internal.jaxb.gco.GO_Boolean; -import org.apache.sis.internal.jaxb.gco.GO_GenericName; -import org.apache.sis.internal.jaxb.gco.StringAdapter; -import org.apache.sis.internal.jaxb.gco.InternationalStringAdapter; -import org.apache.sis.internal.jaxb.metadata.RS_Identifier; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.jaxb.code.SV_ParameterDirection; +import org.apache.sis.internal.jaxb.gco.*; import org.apache.sis.xml.Namespaces; Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/Dependencies.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/Dependencies.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/Dependencies.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/Dependencies.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -24,9 +24,9 @@ import java.lang.annotation.RetentionPol /** * Indicates that the value of a property is computed from values of other properties. - * This annotation can be applied on getter methods. All dependent properties must be - * in the same class than the annotated method. Transitive dependencies do not need to - * be declared, but the dependency graph shall not contain cycle. + * This annotation can be applied on public getter methods. All dependent properties + * must be in the same class than the annotated method. Transitive dependencies do not + * need to be declared, but the dependency graph shall not contain cycle. * * <div class="note"><b>Example:</b> * {@code ResponsibleParty.individualName} is now deprecated and replaced by the first {@code Individual.name} value Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -79,7 +79,7 @@ public abstract class LegacyPropertyAdap protected abstract L unwrap(final N container); /** - * Update a new value with the given legacy value. + * Updates a new value with the given legacy value. * * @param container the new value to be used as a container for the old value. * @param value the value to update in the container. Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -54,7 +54,7 @@ public final class MetadataUtilities ext } /** - * Returns the given milliseconds time to a date object, or returns null + * Converts the given milliseconds time to a date object, or returns null * if the given time is {@link Long#MIN_VALUE}. * * @param value the time in milliseconds. Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -91,7 +91,7 @@ public final class OtherLocales extends @Override public Iterator<Locale> iterator() { final Iterator<Locale> it = languages.iterator(); - if (it.hasNext()) it.next(); // Skip the first element. + if (it.hasNext()) it.next(); // Skip the first element. return it; } @@ -114,7 +114,7 @@ public final class OtherLocales extends if (languages.isEmpty()) { Locale defaultLocale = Locale.getDefault(); if (defaultLocale.equals(locale)) { - defaultLocale = Locale.ROOT; // Same default than merge(Locale, Collection). + defaultLocale = Locale.ROOT; // Same default than merge(Locale, Collection). } languages.add(defaultLocale); } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -68,8 +68,8 @@ import static org.apache.sis.util.collec * except {@link #equals(Object, Object, ComparisonMode)} and {@link #freeze(Object)}.</li> * * <li>Extra properties defined by the {@link IdentifiedObject} interface. Those properties - * invisible in the ISO 19115 model, but appears in ISO 19139 XML marshalling. So we do - * the same in the SIS implementation: invisible in map and tree view, but visible in + * invisible in the ISO 19115-1 model, but appears in ISO 19115-3 XML marshalling. So we + * do the same in the SIS implementation: invisible in map and tree view, but visible in * XML marshalling.</li> * </ul> * @@ -100,8 +100,8 @@ class PropertyAccessor { /** * Additional getter to declare in every list of getter methods that do not already provide * their own {@code getIdentifiers()} method. We handle this method specially because it is - * needed for XML marshalling in ISO 19139 compliant document, while not part of abstract - * ISO 19115 specification. + * needed for XML marshalling in ISO 19115-3 compliant document, while not part of abstract + * ISO 19115-1 specification. * * @see IdentifiedObject#getIdentifiers() */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -43,7 +43,7 @@ import org.opengis.annotation.Obligation * </ol> * * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.3 * @module */ @@ -129,10 +129,7 @@ final class PropertyComparator implement * If duplicated properties are found, keep the first occurence (i.e. sort the property * with the most specialized child that declared it). */ - final Integer old = order.put(propOrder[i], order.size()); - if (old != null) { - order.put(propOrder[i], old); - } + order.putIfAbsent(propOrder[i], order.size()); } } implementation = implementation.getSuperclass(); Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -19,9 +19,13 @@ package org.apache.sis.metadata.iso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.opengis.metadata.ApplicationSchemaInformation; import org.opengis.metadata.citation.Citation; import org.opengis.metadata.citation.OnlineResource; +import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter; +import org.apache.sis.internal.jaxb.metadata.CI_OnlineResource; /** @@ -47,21 +51,22 @@ import org.opengis.metadata.citation.Onl * @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 */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "MD_ApplicationSchemaInformation_Type", propOrder = { +@XmlType(name = "MD_ApplicationSchemaInformation_Type", namespace = Namespaces.MAS, propOrder = { "name", "schemaLanguage", "constraintLanguage", -/// "schemaAscii", -/// "graphicsFile", -/// "softwareDevelopmentFile", + "schemaAscii", + "graphicsFile", + "softwareDevelopmentFile", "softwareDevelopmentFileFormat" }) -@XmlRootElement(name = "MD_ApplicationSchemaInformation") +@XmlRootElement(name = "MD_ApplicationSchemaInformation", namespace = Namespaces.MAS) public class DefaultApplicationSchemaInformation extends ISOMetadata implements ApplicationSchemaInformation { /** * Serial number for inter-operability with different versions. @@ -241,7 +246,8 @@ public class DefaultApplicationSchemaInf * @return application schema as an ASCII file, or {@code null}. */ @Override -/// @XmlElement(name = "schemaAscii") + @XmlElement(name = "schemaAscii") + @XmlJavaTypeAdapter(CharSequenceAdapter.Since2014.class) public CharSequence getSchemaAscii() { return schemaAscii; } @@ -262,7 +268,8 @@ public class DefaultApplicationSchemaInf * @return application schema as a graphics file, or {@code null}. */ @Override -/// @XmlElement(name = "graphicsFile") + @XmlElement(name = "graphicsFile") + @XmlJavaTypeAdapter(CI_OnlineResource.Since2014.class) public OnlineResource getGraphicsFile() { return graphicsFile; } @@ -283,7 +290,8 @@ public class DefaultApplicationSchemaInf * @return application schema as a software development file, or {@code null}. */ @Override -/// @XmlElement(name = "softwareDevelopmentFile") + @XmlElement(name = "softwareDevelopmentFile") + @XmlJavaTypeAdapter(CI_OnlineResource.Since2014.class) public OnlineResource getSoftwareDevelopmentFile() { return softwareDevelopmentFile; } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -30,6 +30,9 @@ import org.opengis.util.InternationalStr import org.apache.sis.metadata.TitleProperty; import org.apache.sis.measure.ValueRange; import org.apache.sis.util.iso.Types; +import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.LegacyNamespaces; +import org.apache.sis.internal.jaxb.FilterByVersion; import org.apache.sis.internal.metadata.Dependencies; import org.apache.sis.internal.metadata.LegacyPropertyAdapter; @@ -69,13 +72,14 @@ import static org.apache.sis.internal.me * @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 */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @TitleProperty(name = "name") -@XmlType(name = "MD_ExtendedElementInformation_Type", propOrder = { +@XmlType(name = "MD_ExtendedElementInformation_Type", namespace = Namespaces.MEX, propOrder = { "name", "shortName", "domainCode", @@ -87,10 +91,10 @@ import static org.apache.sis.internal.me "domainValue", "parentEntity", "rule", - "rationales", + "rationale", "sources" }) -@XmlRootElement(name = "MD_ExtendedElementInformation") +@XmlRootElement(name = "MD_ExtendedElementInformation", namespace = Namespaces.MEX) public class DefaultExtendedElementInformation extends ISOMetadata implements ExtendedElementInformation { /** * Serial number for inter-operability with different versions. @@ -302,9 +306,9 @@ public class DefaultExtendedElementInfor */ @Override @Deprecated - @XmlElement(name = "shortName") + @XmlElement(name = "shortName", namespace = LegacyNamespaces.GMD) public String getShortName() { - return shortName; + return FilterByVersion.LEGACY_METADATA.accept() ? shortName : null; } /** @@ -331,9 +335,9 @@ public class DefaultExtendedElementInfor */ @Override @Deprecated - @XmlElement(name = "domainCode") + @XmlElement(name = "domainCode", namespace = LegacyNamespaces.GMD) public Integer getDomainCode() { - return domainCode; + return FilterByVersion.LEGACY_METADATA.accept() ? domainCode : null; } /** @@ -539,6 +543,7 @@ public class DefaultExtendedElementInfor * @since 0.5 */ @Override + @XmlElement(name = "rationale") public InternationalString getRationale() { return rationale; } @@ -562,7 +567,6 @@ public class DefaultExtendedElementInfor */ @Override @Deprecated - @XmlElement(name = "rationale") @Dependencies("getRationale") public Collection<InternationalString> getRationales() { return new AbstractSet<InternationalString>() { Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -24,6 +24,7 @@ import org.opengis.metadata.citation.Cit import org.opengis.util.InternationalString; import org.apache.sis.metadata.TitleProperty; import org.apache.sis.metadata.iso.citation.Citations; +import org.apache.sis.xml.Namespaces; /** @@ -82,7 +83,8 @@ import org.apache.sis.metadata.iso.citat * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.7 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * * @see ImmutableIdentifier * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier) @@ -92,11 +94,14 @@ import org.apache.sis.metadata.iso.citat */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @TitleProperty(name = "code") -@XmlType(name = "MD_Identifier_Type", propOrder = { +@XmlType(name = "MD_Identifier_Type", namespace = Namespaces.MCC, propOrder = { "authority", - "code" + "code", + "codeSpace", + "version", + "description" }) -@XmlRootElement(name = "MD_Identifier") +@XmlRootElement(name = "MD_Identifier", namespace = Namespaces.MCC) public class DefaultIdentifier extends ISOMetadata implements Identifier { /** * Serial number for inter-operability with different versions. @@ -290,6 +295,7 @@ public class DefaultIdentifier extends I * @since 0.5 */ @Override + @XmlElement(name = "codeSpace") public String getCodeSpace() { return codeSpace; } @@ -316,6 +322,7 @@ public class DefaultIdentifier extends I * @return the version identifier for the namespace, or {@code null} if none. */ @Override + @XmlElement(name = "version") public String getVersion() { return version; } @@ -340,6 +347,7 @@ public class DefaultIdentifier extends I * @since 0.5 */ @Override + @XmlElement(name = "description") public InternationalString getDescription() { return description; } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -66,9 +66,12 @@ import org.apache.sis.internal.metadata. import org.apache.sis.internal.metadata.OtherLocales; import org.apache.sis.internal.metadata.Dependencies; import org.apache.sis.internal.util.CollectionsExt; -import org.apache.sis.internal.jaxb.code.PT_Locale; +import org.apache.sis.internal.jaxb.gmd.LocaleAdapter; +import org.apache.sis.internal.jaxb.LegacyNamespaces; +import org.apache.sis.internal.jaxb.FilterByVersion; import org.apache.sis.internal.jaxb.Context; -import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.metadata.CI_Citation; +import org.apache.sis.internal.jaxb.metadata.MD_Identifier; /** @@ -121,24 +124,45 @@ import org.apache.sis.xml.Namespaces; * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.8 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "MD_Metadata_Type", propOrder = { + // Attributes new in ISO 19115:2014 + "metadataIdentifier", + "defaultLocale", + "parentMetadata", + + // Legacy ISO 19115:2003 attributes "fileIdentifier", "language", "characterSet", "parentIdentifier", "hierarchyLevels", "hierarchyLevelNames", + + // Common to both versions "contacts", + + // Attributes new in ISO 19115:2014 + "dates", // actually "dateInfo" + "metadataStandard", + "metadataProfile", + "alternativeMetadataReference", + "otherLocales", + "metadataLinkage", + + // Legacy ISO 19115:2003 attributes "dateStamp", "metadataStandardName", "metadataStandardVersion", "dataSetUri", "locales", + + // Common to both metadata models "spatialRepresentationInfo", "referenceSystemInfo", "metadataExtensionInfo", @@ -150,6 +174,12 @@ import org.apache.sis.xml.Namespaces; "metadataConstraints", "applicationSchemaInfo", "metadataMaintenance", + "resourceLineage", + + // Attributes new in ISO 19115:2014 + "metadataScope", + + // GMI extension "acquisitionInformation" }) @XmlRootElement(name = "MD_Metadata") @@ -390,6 +420,8 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + @XmlElement(name = "metadataIdentifier") + @XmlJavaTypeAdapter(MD_Identifier.Since2014.class) public Identifier getMetadataIdentifier() { return metadataIdentifier; } @@ -416,11 +448,14 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "fileIdentifier") @Dependencies("getMetadataIdentifier") + @XmlElement(name = "fileIdentifier", namespace = LegacyNamespaces.GMD) public String getFileIdentifier() { - final Identifier identifier = getMetadataIdentifier(); - return (identifier != null) ? identifier.getCode() : null; + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Identifier identifier = getMetadataIdentifier(); + if (identifier != null) return identifier.getCode(); + } + return null; } /** @@ -459,6 +494,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<Locale> getLanguages() { return languages = nonNullCollection(languages, Locale.class); } @@ -476,7 +512,7 @@ public class DefaultMetadata extends ISO */ public void setLanguages(final Collection<Locale> newValues) { languages = writeCollection(newValues, languages, Locale.class); - // The "magik" applying this language to every children + // The "magic" applying this language to every children // is performed by the 'beforeMarshal(Marshaller)' method. } @@ -489,10 +525,11 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "language") @Dependencies("getLanguages") + @XmlElement(name = "language", namespace = LegacyNamespaces.GMD) + @XmlJavaTypeAdapter(LocaleAdapter.class) public Locale getLanguage() { - return CollectionsExt.first(getLanguages()); + return FilterByVersion.LEGACY_METADATA.accept() ? CollectionsExt.first(getLanguages()) : null; /* * No warning if the collection contains more than one locale, because * this is allowed by the "getLanguage() + getLocales()" contract. @@ -515,7 +552,7 @@ public class DefaultMetadata extends ISO @Deprecated public void setLanguage(final Locale newValue) { checkWritePermission(); - setLanguages(OtherLocales.setFirst(languages, newValue)); // See "Note about deprecated methods implementation" + setDefaultLocale(newValue); } /** @@ -527,11 +564,10 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "locale") - @XmlJavaTypeAdapter(PT_Locale.class) @Dependencies("getLanguages") + @XmlElement(name = "locale", namespace = LegacyNamespaces.GMD) public Collection<Locale> getLocales() { - return OtherLocales.filter(getLanguages()); + return FilterByVersion.LEGACY_METADATA.accept() ? OtherLocales.filter(getLanguages()) : null; } /** @@ -544,7 +580,7 @@ public class DefaultMetadata extends ISO @Deprecated public void setLocales(final Collection<? extends Locale> newValues) { checkWritePermission(); - setLanguages(OtherLocales.merge(CollectionsExt.first(languages), newValues)); // See "Note about deprecated methods implementation" + setOtherLocales(newValues); } /** @@ -569,6 +605,7 @@ public class DefaultMetadata extends ISO * @see #getLanguages() * @see org.opengis.metadata.identification.DataIdentification#getCharacterSets() * @see Charset#forName(String) + * @see <a href="https://issues.apache.org/jira/browse/SIS-402">SIS-402</a> * * @since 0.5 */ @@ -597,23 +634,25 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "characterSet") @Dependencies("getCharacterSets") + @XmlElement(name = "characterSet", namespace = LegacyNamespaces.GMD) public CharacterSet getCharacterSet() { - final Charset cs = LegacyPropertyAdapter.getSingleton(getCharacterSets(), - Charset.class, null, DefaultMetadata.class, "getCharacterSet"); - if (cs == null) { - return null; - } - final String name = cs.name(); - for (final CharacterSet candidate : CharacterSet.values()) { - for (final String n : candidate.names()) { - if (name.equals(n)) { - return candidate; + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Charset cs = LegacyPropertyAdapter.getSingleton(getCharacterSets(), + Charset.class, null, DefaultMetadata.class, "getCharacterSet"); + if (cs != null) { + final String name = cs.name(); + for (final CharacterSet candidate : CharacterSet.values()) { + for (final String n : candidate.names()) { + if (name.equals(n)) { + return candidate; + } + } } + return CharacterSet.valueOf(name); } } - return CharacterSet.valueOf(name); + return null; } /** @@ -637,6 +676,8 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + @XmlElement(name = "parentMetadata") + @XmlJavaTypeAdapter(CI_Citation.Since2014.class) public Citation getParentMetadata() { return parentMetadata; } @@ -662,14 +703,16 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "parentIdentifier") @Dependencies("getParentMetadata") + @XmlElement(name = "parentIdentifier", namespace = LegacyNamespaces.GMD) public String getParentIdentifier() { - final Citation parentMetadata = getParentMetadata(); - if (parentMetadata != null) { - final InternationalString title = parentMetadata.getTitle(); - if (title != null) { - return title.toString(); + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Citation parentMetadata = getParentMetadata(); + if (parentMetadata != null) { + final InternationalString title = parentMetadata.getTitle(); + if (title != null) { + return title.toString(); + } } } return null; @@ -702,6 +745,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<MetadataScope> getMetadataScopes() { return metadataScopes = nonNullCollection(metadataScopes, MetadataScope.class); } @@ -727,9 +771,10 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "hierarchyLevel") @Dependencies("getMetadataScopes") + @XmlElement(name = "hierarchyLevel", namespace = LegacyNamespaces.GMD) public final Collection<ScopeCode> getHierarchyLevels() { + if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return new MetadataScopeAdapter<ScopeCode>(getMetadataScopes()) { /** Stores a legacy value into the new kind of value. */ @Override protected MetadataScope wrap(final ScopeCode value) { @@ -776,9 +821,10 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "hierarchyLevelName") @Dependencies("getMetadataScopes") + @XmlElement(name = "hierarchyLevelName", namespace = LegacyNamespaces.GMD) public final Collection<String> getHierarchyLevelNames() { + if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return new MetadataScopeAdapter<String>(getMetadataScopes()) { /** Stores a legacy value into the new kind of value. */ @Override protected MetadataScope wrap(final String value) { @@ -847,6 +893,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<CitationDate> getDateInfo() { return dateInfo = nonNullCollection(dateInfo, CitationDate.class); } @@ -872,14 +919,16 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "dateStamp", required = true) @Dependencies("getDateInfo") + @XmlElement(name = "dateStamp", namespace = LegacyNamespaces.GMD) public Date getDateStamp() { - final Collection<CitationDate> dates = getDateInfo(); - if (dates != null) { - for (final CitationDate date : dates) { - if (DateType.CREATION.equals(date.getDateType())) { - return date.getDate(); + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Collection<CitationDate> dates = getDateInfo(); + if (dates != null) { + for (final CitationDate date : dates) { + if (DateType.CREATION.equals(date.getDateType())) { + return date.getDate(); + } } } } @@ -936,6 +985,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<Citation> getMetadataStandards() { return metadataStandards = nonNullCollection(metadataStandards, Citation.class); } @@ -963,6 +1013,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<Citation> getMetadataProfiles() { return metadataProfiles = nonNullCollection(metadataProfiles, Citation.class); } @@ -987,6 +1038,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<Citation> getAlternativeMetadataReferences() { return alternativeMetadataReferences = nonNullCollection(alternativeMetadataReferences, Citation.class); } @@ -1006,12 +1058,15 @@ public class DefaultMetadata extends ISO * Implementation of legacy {@link #getMetadataStandardName()} and {@link #getMetadataStandardVersion()} methods. */ private String getMetadataStandard(final boolean version) { - final Citation standard = LegacyPropertyAdapter.getSingleton(getMetadataStandards(), - Citation.class, null, DefaultMetadata.class, version ? "getMetadataStandardName" : "getMetadataStandardVersion"); - if (standard != null) { - final InternationalString title = version ? standard.getEdition() : standard.getTitle(); - if (title != null) { - return title.toString(); + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Citation standard = LegacyPropertyAdapter.getSingleton(getMetadataStandards(), + Citation.class, null, DefaultMetadata.class, + version ? "getMetadataStandardName" : "getMetadataStandardVersion"); + if (standard != null) { + final InternationalString title = version ? standard.getEdition() : standard.getTitle(); + if (title != null) { + return title.toString(); + } } } return null; @@ -1054,8 +1109,8 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "metadataStandardName") @Dependencies("getMetadataStandards") + @XmlElement(name = "metadataStandardName", namespace = LegacyNamespaces.GMD) public String getMetadataStandardName() { return getMetadataStandard(false); } @@ -1083,8 +1138,8 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "metadataStandardVersion") @Dependencies("getMetadataStandards") + @XmlElement(name = "metadataStandardVersion", namespace = LegacyNamespaces.GMD) public String getMetadataStandardVersion() { return getMetadataStandard(true); } @@ -1110,6 +1165,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<OnlineResource> getMetadataLinkages() { return metadataLinkages = nonNullCollection(metadataLinkages, OnlineResource.class); } @@ -1135,12 +1191,12 @@ public class DefaultMetadata extends ISO */ @Override @Deprecated - @XmlElement(name = "dataSetURI") @Dependencies("getIdentificationInfo") + @XmlElement(name = "dataSetURI", namespace = LegacyNamespaces.GMD) public String getDataSetUri() { String linkage = null; - final Collection<Identification> info = getIdentificationInfo(); - if (info != null) { + final Collection<Identification> info; + if (FilterByVersion.LEGACY_METADATA.accept() && (info = getIdentificationInfo()) != null) { for (final Identification identification : info) { final Citation citation = identification.getCitation(); if (citation != null) { @@ -1414,7 +1470,7 @@ public class DefaultMetadata extends ISO * @return the acquisition of data. */ @Override - @XmlElement(name = "acquisitionInformation", namespace = Namespaces.GMI) + @XmlElement(name = "acquisitionInformation") public Collection<AcquisitionInformation> getAcquisitionInformation() { return acquisitionInformation = nonNullCollection(acquisitionInformation, AcquisitionInformation.class); } @@ -1461,6 +1517,7 @@ public class DefaultMetadata extends ISO * @since 0.5 */ @Override + // @XmlElement at the end of this class. public Collection<Lineage> getResourceLineages() { return resourceLineages = nonNullCollection(resourceLineages, Lineage.class); } @@ -1494,6 +1551,7 @@ public class DefaultMetadata extends ISO * Invoked by JAXB {@link javax.xml.bind.Marshaller} before this object is marshalled to XML. * This method sets the locale to be used for XML marshalling to the metadata language. */ + @SuppressWarnings("unused") private void beforeMarshal(final Marshaller marshaller) { Context.push(CollectionsExt.first(languages)); } @@ -1502,7 +1560,78 @@ public class DefaultMetadata extends ISO * Invoked by JAXB {@link javax.xml.bind.Marshaller} after this object has been marshalled to * XML. This method restores the locale to be used for XML marshalling to its previous value. */ + @SuppressWarnings("unused") private void afterMarshal(final Marshaller marshaller) { Context.pull(); } + + /** + * Gets the default locale for this record (used in ISO 19115-3 format). + */ + @XmlElement(name = "defaultLocale") + private Locale getDefaultLocale() { + return FilterByVersion.CURRENT_METADATA.accept() ? CollectionsExt.first(getLanguages()) : null; + } + + /** + * Sets the default locale for this record (used in ISO 19115-3 format). + */ + private void setDefaultLocale(final Locale newValue) { + setLanguages(OtherLocales.setFirst(languages, newValue)); // See "Note about deprecated methods implementation" + } + + /** + * Gets the other locales for this record (used in ISO 19115-3 format). + */ + @XmlElement(name = "otherLocale") + private Collection<Locale> getOtherLocales() { + return FilterByVersion.CURRENT_METADATA.accept() ? OtherLocales.filter(getLanguages()) : null; + } + + /** + * Sets the other locales for this record (used in ISO 19115-3 format). + */ + private void setOtherLocales(final Collection<? extends Locale> newValues) { + setLanguages(OtherLocales.merge(CollectionsExt.first(languages), newValues)); + } + + /** + * Invoked by JAXB at both marshalling and unmarshalling time. + * This attribute has been added by ISO 19115:2014 standard. + * If (and only if) marshalling an older standard version, we omit this attribute. + */ + @XmlElement(name = "dateInfo", required = true) + private Collection<CitationDate> getDates() { + return FilterByVersion.CURRENT_METADATA.accept() ? getDateInfo() : null; + } + + @XmlElement(name = "metadataStandard") + private Collection<Citation> getMetadataStandard() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataStandards() : null; + } + + @XmlElement(name = "metadataProfile") + private Collection<Citation> getMetadataProfile() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataProfiles() : null; + } + + @XmlElement(name = "alternativeMetadataReference") + private Collection<Citation> getAlternativeMetadataReference() { + return FilterByVersion.CURRENT_METADATA.accept() ? getAlternativeMetadataReferences() : null; + } + + @XmlElement(name = "metadataLinkage") + private Collection<OnlineResource> getMetadataLinkage() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataLinkages() : null; + } + + @XmlElement(name = "resourceLineage") + private Collection<Lineage> getResourceLineage() { + return FilterByVersion.CURRENT_METADATA.accept() ? getResourceLineages() : null; + } + + @XmlElement(name = "metadataScope") + private Collection<MetadataScope> getMetadataScope() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataScopes() : null; + } } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlRoot import org.opengis.metadata.citation.OnlineResource; import org.opengis.metadata.ExtendedElementInformation; import org.opengis.metadata.MetadataExtensionInformation; +import org.apache.sis.xml.Namespaces; /** @@ -40,16 +41,17 @@ import org.opengis.metadata.MetadataExte * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "MD_MetadataExtensionInformation_Type", propOrder = { +@XmlType(name = "MD_MetadataExtensionInformation_Type", namespace = Namespaces.MEX, propOrder = { "extensionOnLineResource", "extendedElementInformation" }) -@XmlRootElement(name = "MD_MetadataExtensionInformation") +@XmlRootElement(name = "MD_MetadataExtensionInformation", namespace = Namespaces.MEX) public class DefaultMetadataExtensionInformation extends ISOMetadata implements MetadataExtensionInformation { /** * Serial number for compatibility with different versions. Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -43,7 +43,7 @@ import org.apache.sis.util.iso.Types; * * @author Rémi Maréchal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.5 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlElem import javax.xml.bind.annotation.XmlRootElement; import org.opengis.metadata.citation.Citation; import org.opengis.metadata.PortrayalCatalogueReference; +import org.apache.sis.xml.Namespaces; /** @@ -45,13 +46,13 @@ import org.opengis.metadata.PortrayalCat * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "MD_PortrayalCatalogueReference_Type") -@XmlRootElement(name = "MD_PortrayalCatalogueReference") +@XmlType(name = "MD_PortrayalCatalogueReference_Type", namespace = Namespaces.MPC) +@XmlRootElement(name = "MD_PortrayalCatalogueReference", namespace = Namespaces.MPC) public class DefaultPortrayalCatalogueReference extends ISOMetadata implements PortrayalCatalogueReference { /** * Serial number for compatibility with different versions. Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -37,6 +37,7 @@ import org.apache.sis.io.wkt.Formattable import org.apache.sis.io.wkt.Formatter; import org.apache.sis.io.wkt.Convention; import org.apache.sis.io.wkt.ElementKind; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.ArgumentChecks.ensureNonNull; import static org.apache.sis.util.CharSequences.trimWhitespaces; @@ -129,13 +130,13 @@ import static org.apache.sis.util.collec * @module */ @TitleProperty(name = "code") -@XmlType(name = "RS_Identifier_Type", propOrder = { +@XmlType(name = "RS_Identifier_Type", namespace = Namespaces.GMD, propOrder = { "authority", "code", "codeSpace", "version" }) -@XmlRootElement(name = "RS_Identifier") +@XmlRootElement(name = "RS_Identifier", namespace = Namespaces.GMD) public class ImmutableIdentifier extends FormattableObject implements Identifier, Serializable { /** * For cross-version compatibility. @@ -615,6 +616,7 @@ public class ImmutableIdentifier extends /** * Empty constructor for JAXB. */ + @SuppressWarnings("unused") private ImmutableIdentifier() { code = null; codeSpace = null; Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -46,7 +46,7 @@ import org.apache.sis.metadata.iso.ISOMe * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -48,7 +48,7 @@ import static org.apache.sis.internal.me * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.3 * @module */ @@ -216,7 +216,7 @@ public class DefaultEnvironmentalRecord * @return meteorological conditions in the photo flight area, or {@code null}. */ @Override - @XmlElement(name = "meteorologicalConditions", required = true) + @XmlElement(name = "meterologicalConditions", required = true) // Really spelled that way in XSD file. public InternationalString getMeteorologicalConditions() { return meteorologicalConditions; } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -59,7 +59,7 @@ import static org.apache.sis.internal.me * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -49,7 +49,7 @@ import org.apache.sis.internal.jaxb.NonM * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -59,7 +59,7 @@ import org.apache.sis.internal.jaxb.NonM * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @version 1.0 * @since 0.3 * @module */ @@ -181,7 +181,7 @@ public class DefaultObjective extends IS * * <div class="note"><b>XML note:</b> * The {@code <gmd:identifier>} element marshalled to XML will exclude all the above cited identifiers, - * for ISO 19139 compliance. Those identifiers will appear in other XML elements or attributes.</div> + * for compliance with ISO 19115 model. Those identifiers will appear in other XML elements or attributes.</div> * * @return identification of the objective. */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -55,7 +55,7 @@ import org.apache.sis.internal.jaxb.NonM * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -237,7 +237,7 @@ public class DefaultOperation extends IS * @return unique identification of the operation, or {@code null}. */ @Override - @XmlElement(name = "identifier", required = true) + @XmlElement(name = "identifier") public Identifier getIdentifier() { return NonMarshalledAuthority.getMarshallable(identifiers); } @@ -341,7 +341,7 @@ public class DefaultOperation extends IS * @return heritage of the operation, or {@code null}. */ @Override - @XmlElement(name = "parentOperation", required = true) + @XmlElement(name = "parentOperation") public Operation getParentOperation() { return parentOperation; } Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -50,7 +50,7 @@ import org.apache.sis.metadata.iso.ISOMe * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -53,7 +53,7 @@ import org.apache.sis.internal.jaxb.NonM * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -47,7 +47,7 @@ import org.apache.sis.internal.jaxb.NonM * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -46,7 +46,7 @@ import static org.apache.sis.internal.me * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java?rev=1825254&r1=1825253&r2=1825254&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] Sat Feb 24 16:13:58 2018 @@ -65,7 +65,7 @@ import static org.apache.sis.internal.me * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -330,7 +330,7 @@ public class DefaultRequirement extends * @return plan that identifies solution to satisfy the requirement. */ @Override - @XmlElement(name = "satisfiedPlan") + @XmlElement(name = "satisifiedPlan") // Really spelled that way in XSD file. public Collection<Plan> getSatisfiedPlans() { return satisfiedPlans = nonNullCollection(satisfiedPlans, Plan.class); }
