sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626345 [5/14] - in /sis/trunk: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ core/sis-metadat...
Date Fri, 19 Sep 2014 21:46:44 GMT
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -24,16 +24,26 @@ import javax.xml.bind.annotation.XmlRoot
 import org.opengis.util.GenericName;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.content.FeatureCatalogueDescription;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
 
 /**
- * Information identifying the feature catalogue.
+ * Information identifying the feature catalogue or the conceptual schema.
+ *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_FeatureCatalogueDescription_Type", propOrder = {
@@ -50,7 +60,7 @@ public class DefaultFeatureCatalogueDesc
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -3626075463499626815L;
+    private static final long serialVersionUID = 5731044701122380718L;
 
     /**
      * Whether or not the cited feature catalogue complies with ISO 19110.
@@ -67,14 +77,14 @@ public class DefaultFeatureCatalogueDesc
     private Collection<Locale> languages;
 
     /**
-     * Whether or not the feature catalogue is included with the dataset.
+     * Whether or not the feature catalogue is included with the resource.
      */
     private boolean includedWithDataset;
 
     /**
-     * Subset of feature types from cited feature catalogue occurring in dataset.
+     * Subset of feature types from cited feature catalogue occurring in resource.
      */
-    private Collection<GenericName> featureTypes;
+    private Collection<DefaultFeatureTypeInfo> featureTypes;
 
     /**
      * Complete bibliographic reference to one or more external feature catalogues.
@@ -102,8 +112,12 @@ public class DefaultFeatureCatalogueDesc
             compliant                 = object.isCompliant();
             includedWithDataset       = object.isIncludedWithDataset();
             languages                 = copyCollection(object.getLanguages(), Locale.class);
-            featureTypes              = copyCollection(object.getFeatureTypes(), GenericName.class);
             featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
+            if (object instanceof DefaultFeatureCatalogueDescription) {
+                featureTypes = copyCollection(((DefaultFeatureCatalogueDescription) object).getFeatureTypeInfo(), DefaultFeatureTypeInfo.class);
+            } else {
+                setFeatureTypes(object.getFeatureTypes());
+            }
         }
     }
 
@@ -174,9 +188,9 @@ public class DefaultFeatureCatalogueDesc
     }
 
     /**
-     * Returns whether or not the feature catalogue is included with the dataset.
+     * Returns whether or not the feature catalogue is included with the resource.
      *
-     * @return Whether or not the feature catalogue is included with the dataset.
+     * @return Whether or not the feature catalogue is included with the resource.
      */
     @Override
     @XmlElement(name = "includedWithDataset", required = true)
@@ -185,7 +199,7 @@ public class DefaultFeatureCatalogueDesc
     }
 
     /**
-     * Sets whether or not the feature catalogue is included with the dataset.
+     * Sets whether or not the feature catalogue is included with the resource.
      *
      * @param newValue {@code true} if the feature catalogue is included.
      */
@@ -195,23 +209,81 @@ public class DefaultFeatureCatalogueDesc
     }
 
     /**
-     * Returns the subset of feature types from cited feature catalogue occurring in dataset.
+     * Returns the subset of feature types from cited feature catalogue occurring in resource.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code FeatureTypeInfo} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @return Subset of feature types occurring in resource.
+     *
+     * @since 0.5
+     */
+    public Collection<DefaultFeatureTypeInfo> getFeatureTypeInfo() {
+        return featureTypes = nonNullCollection(featureTypes, DefaultFeatureTypeInfo.class);
+    }
+
+    /**
+     * Sets the subset of feature types from cited feature catalogue occurring in resource.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code FeatureTypeInfo} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @param newValues The new feature types.
+     *
+     * @since 0.5
+     */
+    public void setFeatureTypeInfo(final Collection<? extends DefaultFeatureTypeInfo> newValues) {
+        featureTypes = writeCollection(newValues, featureTypes, DefaultFeatureTypeInfo.class);
+    }
+
+    /**
+     * Returns the names of {@linkplain #getFeatureTypes() feature types}.
+     *
+     * @return The feature type names.
      *
-     * @return Subset of feature types occurring in dataset.
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getFeatureTypeInfo()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "featureTypes")
-    public Collection<GenericName> getFeatureTypes() {
-        return featureTypes = nonNullCollection(featureTypes, GenericName.class);
+    public final Collection<GenericName> getFeatureTypes() {
+        return new LegacyPropertyAdapter<GenericName,DefaultFeatureTypeInfo>(getFeatureTypeInfo()) {
+            /** Stores a legacy value into the new kind of value. */
+            @Override protected DefaultFeatureTypeInfo wrap(final GenericName value) {
+                return new DefaultFeatureTypeInfo(value);
+            }
+
+            /** Extracts the legacy value from the new kind of value. */
+            @Override protected GenericName unwrap(final DefaultFeatureTypeInfo container) {
+                return container.getFeatureTypeName();
+            }
+
+            /** Updates the legacy value in an existing instance of the new kind of value. */
+            @Override protected boolean update(final DefaultFeatureTypeInfo container, final GenericName value) {
+                if (container instanceof DefaultFeatureTypeInfo) {
+                    container.setFeatureTypeName(value);
+                    return true;
+                }
+                return false;
+            }
+        }.validOrNull();
     }
 
     /**
-     * Sets the subset of feature types from cited feature catalogue occurring in dataset.
+     * Sets the names of {@linkplain #getFeatureTypes() feature types}.
      *
-     * @param newValues The new feature types.
+     * @param newValues The new feature type names.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by {@link #setFeatureTypeInfo(Collection)}.
      */
-    public void setFeatureTypes(final Collection<? extends GenericName> newValues) {
-        featureTypes = writeCollection(newValues, featureTypes, GenericName.class);
+    @Deprecated
+    public final void setFeatureTypes(final Collection<? extends GenericName> newValues) {
+        checkWritePermission();
+        ((LegacyPropertyAdapter<GenericName,?>) getFeatureTypes()).setValues(newValues);
     }
 
     /**

Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java (from r1625241, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java&p1=sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,15 +20,28 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.opengis.util.GenericName;
-import org.opengis.metadata.content.FeatureTypeInfo;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.ArgumentChecks;
 
+// Branch-specific imports
+import org.opengis.annotation.UML;
+import static org.opengis.annotation.Obligation.OPTIONAL;
+import static org.opengis.annotation.Obligation.MANDATORY;
+import static org.opengis.annotation.Specification.ISO_19115;
+
 
 /**
  * Information about the occurring feature type.
  *
+ * <div class="warning"><b>Note on International Standard versions</b><br>
+ * This class is derived from a new type defined in the ISO 19115 international standard published in 2014,
+ * while GeoAPI 3.0 is based on the version published in 2003. Consequently this implementation class does
+ * not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases.
+ * When the interface will become available, all references to this implementation class in Apache SIS will
+ * be replaced be references to the corresponding interface.
+ * </div>
+ *
  * <p><b>Limitations:</b></p>
  * <ul>
  *   <li>Instances of this class are not synchronized for multi-threading.
@@ -49,7 +62,8 @@ import org.apache.sis.util.ArgumentCheck
     "featureInstanceCount"
 })
 @XmlRootElement(name = "MD_FeatureTypeInfo")
-public class DefaultFeatureTypeInfo extends ISOMetadata implements FeatureTypeInfo {
+@UML(identifier="MD_FeatureTypeInfo", specification=ISO_19115)
+public class DefaultFeatureTypeInfo extends ISOMetadata {
     /**
      * Serial number for compatibility with different versions.
      */
@@ -86,10 +100,8 @@ public class DefaultFeatureTypeInfo exte
      * given object are not recursively copied.
      *
      * @param object The metadata to copy values from, or {@code null} if none.
-     *
-     * @see #castOrCopy(FeatureTypeInfo)
      */
-    public DefaultFeatureTypeInfo(final FeatureTypeInfo object) {
+    public DefaultFeatureTypeInfo(final DefaultFeatureTypeInfo object) {
         super(object);
         if (object != null) {
             featureTypeName      = object.getFeatureTypeName();
@@ -98,39 +110,14 @@ public class DefaultFeatureTypeInfo exte
     }
 
     /**
-     * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code DefaultFeatureTypeInfo}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code DefaultFeatureTypeInfo} instance is created using the
-     *       {@linkplain #DefaultFeatureTypeInfo(FeatureTypeInfo) copy constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static DefaultFeatureTypeInfo castOrCopy(final FeatureTypeInfo object) {
-        if (object == null || object instanceof DefaultFeatureTypeInfo) {
-            return (DefaultFeatureTypeInfo) object;
-        }
-        return new DefaultFeatureTypeInfo(object);
-    }
-
-    /**
      * Returns the name of the feature type.
      *
      * @return Name of the feature type.
      *
      * @see org.apache.sis.feature.DefaultFeatureType#getName()
      */
-    @Override
     @XmlElement(name = "featureTypeName", required = true)
+    @UML(identifier="featureTypeName", obligation=MANDATORY, specification=ISO_19115)
     public GenericName getFeatureTypeName() {
         return featureTypeName;
     }
@@ -150,9 +137,9 @@ public class DefaultFeatureTypeInfo exte
      *
      * @return The number of occurrence of feature instances for this feature types, or {@code null} if none.
      */
-    @Override
     @ValueRange(minimum = 1)
     @XmlElement(name = "featureInstanceCount")
+    @UML(identifier="featureInstanceCount", obligation=OPTIONAL, specification=ISO_19115)
     public Integer getFeatureInstanceCount() {
         return featureInstanceCount;
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -29,6 +29,15 @@ import org.apache.sis.measure.ValueRange
 /**
  * Information about an image's suitability for use.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
@@ -56,7 +65,7 @@ public class DefaultImageDescription ext
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 1756867502303578675L;
+    private static final long serialVersionUID = -239683653229623567L;
 
     /**
      * Illumination elevation measured in degrees clockwise from the target plane
@@ -87,12 +96,6 @@ public class DefaultImageDescription ext
     private Double cloudCoverPercentage;
 
     /**
-     * Image distributor's code that identifies the level of radiometric and geometric
-     * processing that has been applied.
-     */
-    private Identifier processingLevelCode;
-
-    /**
      * Count of the number of lossy compression cycles performed on the image.
      */
     private Integer compressionGenerationQuantity;
@@ -150,7 +153,6 @@ public class DefaultImageDescription ext
             imagingCondition                      = object.getImagingCondition();
             imageQualityCode                      = object.getImageQualityCode();
             cloudCoverPercentage                  = object.getCloudCoverPercentage();
-            processingLevelCode                   = object.getProcessingLevelCode();
             compressionGenerationQuantity         = object.getCompressionGenerationQuantity();
             triangulationIndicator                = object.getTriangulationIndicator();
             radiometricCalibrationDataAvailable   = object.isRadiometricCalibrationDataAvailable();
@@ -195,7 +197,7 @@ public class DefaultImageDescription ext
      * @return A value between -90° and +90°, or {@code null} if unspecified.
      */
     @Override
-    @ValueRange(minimum=0, maximum=180)
+    @ValueRange(minimum = -90, maximum = +90)
     @XmlElement(name = "illuminationElevationAngle")
     public Double getIlluminationElevationAngle() {
         return illuminationElevationAngle;
@@ -220,7 +222,7 @@ public class DefaultImageDescription ext
      * @return A value between 0° and 360°, or {@code null} if unspecified.
      */
     @Override
-    @ValueRange(minimum=0, maximum=360)
+    @ValueRange(minimum = 0, maximum = 360)
     @XmlElement(name = "illuminationAzimuthAngle")
     public Double getIlluminationAzimuthAngle() {
         return illuminationAzimuthAngle;
@@ -238,9 +240,9 @@ public class DefaultImageDescription ext
     }
 
     /**
-     * Returns the conditions affected the image.
+     * Returns the conditions which affected the image.
      *
-     * @return Conditions affected the image, or {@code null} if unspecified.
+     * @return Conditions which affected the image, or {@code null} if unspecified.
      */
     @Override
     @XmlElement(name = "imagingCondition")
@@ -249,7 +251,7 @@ public class DefaultImageDescription ext
     }
 
     /**
-     * Sets the conditions affected the image.
+     * Sets the conditions that affected the image.
      *
      * @param newValue The new imaging condition.
      */
@@ -259,7 +261,7 @@ public class DefaultImageDescription ext
     }
 
     /**
-     * Returns the identifier that specifies the image quality.
+     * Returns a code in producer’s codespace that specifies the image quality.
      *
      * @return The image quality, or {@code null} if unspecified.
      */
@@ -270,7 +272,7 @@ public class DefaultImageDescription ext
     }
 
     /**
-     * Sets the identifier that specifies the image quality.
+     * Sets a code in producer’s codespace that specifies the image quality.
      *
      * @param newValue The new image quality code.
      */
@@ -285,7 +287,7 @@ public class DefaultImageDescription ext
      * @return A value between 0 and 100, or {@code null} if unspecified.
      */
     @Override
-    @ValueRange(minimum=0, maximum=100)
+    @ValueRange(minimum = 0, maximum = 100)
     @XmlElement(name = "cloudCoverPercentage")
     public Double getCloudCoverPercentage() {
         return cloudCoverPercentage;
@@ -311,7 +313,7 @@ public class DefaultImageDescription ext
     @Override
     @XmlElement(name = "processingLevelCode")
     public Identifier getProcessingLevelCode() {
-        return processingLevelCode;
+        return super.getProcessingLevelCode();
     }
 
     /**
@@ -320,9 +322,9 @@ public class DefaultImageDescription ext
      *
      * @param newValue The new processing level code.
      */
+    @Override
     public void setProcessingLevelCode(final Identifier newValue) {
-        checkWritePermission();
-        processingLevelCode = newValue;
+        super.setProcessingLevelCode(newValue);
     }
 
     /**
@@ -332,7 +334,7 @@ public class DefaultImageDescription ext
      *         or {@code null} if unspecified.
      */
     @Override
-    @ValueRange(minimum=0)
+    @ValueRange(minimum = 0)
     @XmlElement(name = "compressionGenerationQuantity")
     public Integer getCompressionGenerationQuantity() {
         return compressionGenerationQuantity;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,12 +16,14 @@
  */
 package org.apache.sis.metadata.iso.content;
 
+import java.util.Collection;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.MemberName;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.content.RangeDimension;
 import org.opengis.metadata.content.Band;
 import org.apache.sis.metadata.iso.ISOMetadata;
@@ -30,16 +32,27 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Information on the range of each dimension of a cell measurement value.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_RangeDimension_Type", propOrder = {
     "sequenceIdentifier",
-    "descriptor"
+    "descriptor",
+/// "names"
 })
 @XmlRootElement(name = "MD_RangeDimension")
 @XmlSeeAlso(DefaultBand.class)
@@ -47,17 +60,23 @@ public class DefaultRangeDimension exten
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -8624244894762434804L;
+    private static final long serialVersionUID = 4517148689016920767L;
 
     /**
-     * Number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
+     * Unique name or number that identifies attributes included in the coverage.
      */
     private MemberName sequenceIdentifier;
 
     /**
-     * Description of the range of a cell measurement value.
+     * Description of the attribute.
+     */
+    private InternationalString description;
+
+    /**
+     * Identifiers for each attribute included in the resource. These identifiers
+     * can be use to provide names for the attribute from a standard set of names.
      */
-    private InternationalString descriptor;
+    private Collection<Identifier> names;
 
     /**
      * Constructs an initially empty range dimension.
@@ -78,7 +97,10 @@ public class DefaultRangeDimension exten
         super(object);
         if (object != null) {
             sequenceIdentifier = object.getSequenceIdentifier();
-            descriptor         = object.getDescriptor();
+            description        = object.getDescriptor();
+            if (object instanceof DefaultRangeDimension) {
+                names = copyCollection(((DefaultRangeDimension) object).getNames(), Identifier.class);
+            }
         }
     }
 
@@ -88,7 +110,7 @@ public class DefaultRangeDimension exten
      *
      * <ul>
      *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is is an instance of {@link Band}, then this method
+     *   <li>Otherwise if the given object is an instance of {@link SampleDimension}, then this method
      *       delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.</li>
      *   <li>Otherwise if the given object is already an instance of
      *       {@code DefaultRangeDimension}, then it is returned unchanged.</li>
@@ -114,9 +136,9 @@ public class DefaultRangeDimension exten
     }
 
     /**
-     * Returns the number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
+     * Returns a unique name or number that identifies attributes included in the coverage.
      *
-     * @return Identifier of bands on which a sensor operates, or {@code null}.
+     * @return Unique name or number, or {@code null}.
      */
     @Override
     @XmlElement(name = "sequenceIdentifier")
@@ -135,23 +157,78 @@ public class DefaultRangeDimension exten
     }
 
     /**
+     * Returns the description of the attribute.
+     *
+     * @return Description of the attribute, or {@code null}.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "description")
+    public InternationalString getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the description of the attribute.
+     *
+     * @param newValue The new description.
+     *
+     * @since 0.5
+     */
+    public void setDescription(final InternationalString newValue) {
+        checkWritePermission();
+        description = newValue;
+    }
+
+    /**
      * Returns the description of the range of a cell measurement value.
+     * This method fetches the value from the {@linkplain #getDescription() description}.
      *
      * @return Description of the range of a cell measurement value, or {@code null}.
+     *
+     * @deprecated As of ISO 19115:2014, renamed {@link #getDescription()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "descriptor")
-    public InternationalString getDescriptor() {
-        return descriptor;
+    public final InternationalString getDescriptor() {
+        return getDescription();
     }
 
     /**
      * Sets the description of the range of a cell measurement value.
+     * This method stores the value in the {@linkplain #setDescription(InternationalString) description}.
      *
      * @param newValue The new descriptor.
+     *
+     * @deprecated As of ISO 19115:2014, renamed {@link #setDescription(InternationalString)}.
      */
-    public void setDescriptor(final InternationalString newValue) {
-        checkWritePermission();
-        descriptor = newValue;
+    @Deprecated
+    public final void setDescriptor(final InternationalString newValue) {
+        setDescription(newValue);
+    }
+
+    /**
+     * Returns the identifiers for each attribute included in the resource.
+     * These identifiers can be use to provide names for the attribute from a standard set of names.
+     *
+     * @return Identifiers for each attribute included in the resource.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "name")
+    public Collection<Identifier> getNames() {
+        return names = nonNullCollection(names, Identifier.class);
+    }
+
+    /**
+     * Sets the identifiers for each attribute included in the resource.
+     *
+     * @param newValues The new identifiers for each attribute.
+     *
+     * @since 0.5
+     */
+    public void setNames(final Collection<? extends Identifier> newValues) {
+        names = writeCollection(newValues, names, Identifier.class);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -30,6 +30,15 @@ import org.apache.sis.xml.Namespaces;
 /**
  * Description of specific range elements.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)

Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java (from r1625241, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java&p1=sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -21,16 +21,29 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlType;
-import org.opengis.metadata.content.Band;
-import org.opengis.metadata.content.SampleDimension;
 import org.opengis.util.Record;
 import org.opengis.util.RecordType;
+import org.opengis.metadata.content.Band;
 import org.apache.sis.measure.ValueRange;
 
+// Branch-specific imports
+import org.opengis.annotation.UML;
+import static org.opengis.annotation.Obligation.OPTIONAL;
+import static org.opengis.annotation.Obligation.CONDITIONAL;
+import static org.opengis.annotation.Specification.ISO_19115;
+
 
 /**
  * The characteristic of each dimension (layer) included in the resource.
  *
+ * <div class="warning"><b>Note on International Standard versions</b><br>
+ * This class is derived from a new type defined in the ISO 19115 international standard published in 2014,
+ * while GeoAPI 3.0 is based on the version published in 2003. Consequently this implementation class does
+ * not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases.
+ * When the interface will become available, all references to this implementation class in Apache SIS will
+ * be replaced be references to the corresponding interface.
+ * </div>
+ *
  * <p><b>Limitations:</b></p>
  * <ul>
  *   <li>Instances of this class are not synchronized for multi-threading.
@@ -61,7 +74,8 @@ import org.apache.sis.measure.ValueRange
 })
 @XmlRootElement(name = "MD_SampleDimension")
 @XmlSeeAlso({DefaultBand.class, DefaultRangeDimension.class})
-public class DefaultSampleDimension extends DefaultRangeDimension implements SampleDimension {
+@UML(identifier="MD_SampleDimension", specification=ISO_19115)
+public class DefaultSampleDimension extends DefaultRangeDimension {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -139,52 +153,47 @@ public class DefaultSampleDimension exte
      *
      * @see #castOrCopy(SampleDimension)
      */
-    public DefaultSampleDimension(final SampleDimension object) {
+    public DefaultSampleDimension(final DefaultSampleDimension object) {
         super(object);
         if (object != null) {
-            maxValue          = object.getMaxValue();
-            minValue          = object.getMinValue();
-            units             = object.getUnits();
-            scaleFactor       = object.getScaleFactor();
-            offset            = object.getOffset();
-            meanValue         = object.getMeanValue();
-            numberOfValues    = object.getNumberOfValues();
-            standardDeviation = object.getStandardDeviation();
-            otherPropertyType = object.getOtherPropertyType();
-            otherProperty     = object.getOtherProperty();
-            bitsPerValue      = object.getBitsPerValue();
+            init(object);
         }
     }
 
     /**
-     * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is is an instance of {@link Band}, then this
-     *       method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code DefaultSampleDimension}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code DefaultSampleDimension} instance is created using the
-     *       {@linkplain #DefaultSampleDimension(SampleDimension) copy constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static DefaultSampleDimension castOrCopy(final SampleDimension object) {
-        if (object instanceof Band) {
-            return DefaultBand.castOrCopy((Band) object);
-        }
-        //-- Intentionally tested after the sub-interfaces.
-        if (object == null || object instanceof DefaultSampleDimension) {
-            return (DefaultSampleDimension) object;
+     * Initializes this sample dimension to the values of the given object.
+     */
+    private void init(final DefaultSampleDimension object) {
+        maxValue          = object.getMaxValue();
+        minValue          = object.getMinValue();
+        units             = object.getUnits();
+        scaleFactor       = object.getScaleFactor();
+        offset            = object.getOffset();
+        meanValue         = object.getMeanValue();
+        numberOfValues    = object.getNumberOfValues();
+        standardDeviation = object.getStandardDeviation();
+        otherPropertyType = object.getOtherPropertyType();
+        otherProperty     = object.getOtherProperty();
+        bitsPerValue      = object.getBitsPerValue();
+    }
+
+    /**
+     * Bridge constructor for {@link DefaultBand#DefaultBand(Band)}.
+     */
+    DefaultSampleDimension(final Band object) {
+        super(object);
+        if (object != null) {
+            if (object instanceof DefaultSampleDimension) {
+                init((DefaultSampleDimension) object);
+            } else {
+                maxValue     = object.getMaxValue();
+                minValue     = object.getMinValue();
+                units        = object.getUnits();
+                scaleFactor  = object.getScaleFactor();
+                offset       = object.getOffset();
+                bitsPerValue = object.getBitsPerValue();
+            }
         }
-        return new DefaultSampleDimension(object);
     }
 
     /**
@@ -192,8 +201,8 @@ public class DefaultSampleDimension exte
      *
      * @return Minimum value of data values in each dimension included in the resource, or {@code null} if unspecified.
      */
-    @Override
     @XmlElement(name = "minValue")
+    @UML(identifier="minValue", obligation=OPTIONAL, specification=ISO_19115)
     public Double getMinValue() {
         return minValue;
     }
@@ -213,8 +222,8 @@ public class DefaultSampleDimension exte
      *
      * @return Maximum value of data values in each dimension included in the resource, or {@code null} if unspecified.
      */
-    @Override
     @XmlElement(name = "maxValue")
+    @UML(identifier="maxValue", obligation=OPTIONAL, specification=ISO_19115)
     public Double getMaxValue() {
         return maxValue;
     }
@@ -234,8 +243,8 @@ public class DefaultSampleDimension exte
      *
      * @return The units of data in each dimension included in the resource, or {@code null} if unspecified.
      */
-    @Override
     @XmlElement(name = "units")
+    @UML(identifier="units", obligation=CONDITIONAL, specification=ISO_19115)
     public Unit<?> getUnits() {
         return units;
     }
@@ -255,8 +264,8 @@ public class DefaultSampleDimension exte
      *
      * @return Scale factor which has been applied to the cell value, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "scaleFactor")
+    @UML(identifier="scaleFactor", obligation=OPTIONAL, specification=ISO_19115)
     public Double getScaleFactor() {
         return scaleFactor;
     }
@@ -276,8 +285,8 @@ public class DefaultSampleDimension exte
      *
      * @return The physical value corresponding to a cell value of zero, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "offset")
+    @UML(identifier="offset", obligation=OPTIONAL, specification=ISO_19115)
     public Double getOffset() {
         return offset;
     }
@@ -297,8 +306,8 @@ public class DefaultSampleDimension exte
      *
      * @return The mean value of data values in each dimension included in the resource, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "meanValue")
+    @UML(identifier="meanValue", obligation=OPTIONAL, specification=ISO_19115)
     public Double getMeanValue() {
         return meanValue;
     }
@@ -318,8 +327,8 @@ public class DefaultSampleDimension exte
      *
      * @return The number of values used in a thematic classification resource, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "numberOfValues")
+    @UML(identifier="numberOfValues", obligation=OPTIONAL, specification=ISO_19115)
     public Integer getNumberOfValues() {
         return numberOfValues;
     }
@@ -339,8 +348,8 @@ public class DefaultSampleDimension exte
      *
      * @return Standard deviation of data values in each dimension included in the resource, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "standardDeviation")
+    @UML(identifier="standardDeviation", obligation=OPTIONAL, specification=ISO_19115)
     public Double getStandardDeviation() {
         return standardDeviation;
     }
@@ -360,8 +369,8 @@ public class DefaultSampleDimension exte
      *
      * @return Type of other attribute description, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "otherPropertyType")
+    @UML(identifier="otherPropertyType", obligation=OPTIONAL, specification=ISO_19115)
     public RecordType getOtherPropertyType() {
         return otherPropertyType;
     }
@@ -382,8 +391,8 @@ public class DefaultSampleDimension exte
      *
      * @return instance of other/attributeType that defines attributes, or {@code null} if none.
      */
-    @Override
 /// @XmlElement(name = "otherProperty")
+    @UML(identifier="otherProperty", obligation=OPTIONAL, specification=ISO_19115)
     public Record getOtherProperty() {
         return otherProperty;
     }
@@ -406,9 +415,9 @@ public class DefaultSampleDimension exte
      * @return Maximum number of significant bits in the uncompressed representation
      *         for the value in each band of each pixel, or {@code null} if none.
      */
-    @Override
     @ValueRange(minimum = 1)
 /// @XmlElement(name = "bitsPerValues")
+    @UML(identifier="bitsPerValue", obligation=OPTIONAL, specification=ISO_19115)
     public Integer getBitsPerValue() {
         return bitsPerValue;
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -31,11 +31,14 @@
  * </tr><tr><td style="width: 50%; white-space: nowrap">
  * {@linkplain org.apache.sis.metadata.iso.ISOMetadata ISO-19115 metadata}<br>
  * {@code  ├─}         {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation         Content information} «abstract»<br>
+ * {@code  │   ├─}                                                                                        Feature catalogue<br>
  * {@code  │   ├─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
  * {@code  │   └─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription         Coverage description}<br>
  * {@code  │       └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription            Image description}<br>
+ * {@code  ├─}         {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo             Feature type info}<br>
  * {@code  ├─}         {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension              Range dimension}<br>
- * {@code  │   └─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultBand                        Band}<br>
+ * {@code  │   └─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultSampleDimension             Sample dimension}<br>
+ * {@code  │       └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultBand                        Band}<br>
  * {@code  └─}         {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription     Range element description}<br>
  * {@linkplain org.opengis.util.CodeList Code list}<br>
  * {@code  ├─} {@linkplain org.opengis.metadata.content.BandDefinition          Band definition}<br>
@@ -44,18 +47,20 @@
  * {@code  ├─} {@linkplain org.opengis.metadata.content.PolarizationOrientation Polarization orientation}<br>
  * {@code  └─} {@linkplain org.opengis.metadata.content.TransferFunctionType    Transfer function type}<br>
  * </td><td class="sep" style="width: 50%; white-space: nowrap">
- *             {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation         Content information} «abstract»<br>
- *             {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
- *             {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription         Coverage description}<br>
- * {@code  ├─} {@linkplain org.opengis.metadata.content.CoverageContentType                       Coverage content type} «code list»<br>
- * {@code  ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension              Range dimension}<br>
- * {@code  └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription     Range element description}<br>
- *             {@linkplain org.apache.sis.metadata.iso.content.DefaultBand                        Band}<br>
- * {@code  ├─} {@linkplain org.opengis.metadata.content.BandDefinition                            Band definition} «code list»<br>
- * {@code  ├─} {@linkplain org.opengis.metadata.content.PolarizationOrientation                   Polarization orientation} «code list»<br>
- * {@code  └─} {@linkplain org.opengis.metadata.content.TransferFunctionType                      Transfer function type} «code list»<br>
- *             {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription            Image description}<br>
- * {@code  └─} {@linkplain org.opengis.metadata.content.ImagingCondition                          Imaging condition} «code list»<br>
+ *                 {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation         Content information} «abstract»<br>
+ *                 {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
+ * {@code  └─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo             Feature type info}<br>
+ *                 {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription         Coverage description}<br>
+ * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultAttributeGroup              Attribute group}<br>
+ * {@code  │   ├─} {@linkplain org.opengis.metadata.content.CoverageContentType                       Coverage content type} «code list»<br>
+ * {@code  │   └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension              Range dimension}<br>
+ * {@code  └─}     {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription     Range element description}<br>
+ *                 {@linkplain org.apache.sis.metadata.iso.content.DefaultBand                        Band}<br>
+ * {@code  ├─}     {@linkplain org.opengis.metadata.content.BandDefinition                            Band definition} «code list»<br>
+ * {@code  ├─}     {@linkplain org.opengis.metadata.content.PolarizationOrientation                   Polarization orientation} «code list»<br>
+ * {@code  └─}     {@linkplain org.opengis.metadata.content.TransferFunctionType                      Transfer function type} «code list»<br>
+ *                 {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription            Image description}<br>
+ * {@code  └─}     {@linkplain org.opengis.metadata.content.ImagingCondition                          Imaging condition} «code list»<br>
  * </td></tr></table>
  *
  * {@section Bands in gridded data}
@@ -68,7 +73,7 @@
  * {@link org.opengis.metadata.content.RangeDimension}.
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -30,6 +30,15 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Description of a transfer data file.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -21,21 +21,34 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.InternationalString;
+import org.opengis.temporal.PeriodDuration;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.distribution.DigitalTransferOptions;
+import org.opengis.metadata.distribution.Format;
 import org.opengis.metadata.distribution.Medium;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.util.ArgumentChecks;
 
 
 /**
  * Technical means and media by which a resource is obtained from the distributor.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_DigitalTransferOptions_Type", propOrder = {
@@ -49,7 +62,7 @@ public class DefaultDigitalTransferOptio
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 3797035083686261676L;
+    private static final long serialVersionUID = -2901375920581273330L;
 
     /**
      * Tiles, layers, geographic areas, etc., in which data is available.
@@ -70,7 +83,17 @@ public class DefaultDigitalTransferOptio
     /**
      * Information about offline media on which the resource can be obtained.
      */
-    private Medium offLine;
+    private Collection<Medium> offLines;
+
+    /**
+     * Rate of occurrence of distribution.
+     */
+    private PeriodDuration transferFrequency;
+
+    /**
+     * Formats of distribution.
+     */
+    private Collection<Format> distributionFormats;
 
     /**
      * Constructs an initially empty digital transfer options.
@@ -93,7 +116,14 @@ public class DefaultDigitalTransferOptio
             unitsOfDistribution = object.getUnitsOfDistribution();
             transferSize        = object.getTransferSize();
             onLines             = copyCollection(object.getOnLines(), OnlineResource.class);
-            offLine             = object.getOffLine();
+            if (object instanceof DefaultDigitalTransferOptions) {
+                final DefaultDigitalTransferOptions c = (DefaultDigitalTransferOptions) object;
+                offLines            = copyCollection(c.getOffLines(), Medium.class);
+                transferFrequency   = c.getTransferFrequency();
+                distributionFormats = copyCollection(c.getDistributionFormats(), Format.class);
+            } else {
+                offLines = singleton(object.getOffLine(), Medium.class);
+            }
         }
     }
 
@@ -151,7 +181,7 @@ public class DefaultDigitalTransferOptio
      */
     @Override
     @XmlElement(name = "transferSize")
-    @ValueRange(minimum=0, isMinIncluded=false)
+    @ValueRange(minimum = 0, isMinIncluded = false)
     public Double getTransferSize() {
         return transferSize;
     }
@@ -161,9 +191,13 @@ public class DefaultDigitalTransferOptio
      * The transfer shall be greater than zero.
      *
      * @param newValue The new transfer size.
+     * @throws IllegalArgumentException if the given value is negative.
      */
-    public void setTransferSize(final Double newValue) {
+    public void setTransferSize(final Double newValue) throws IllegalArgumentException {
         checkWritePermission();
+        if (newValue != null) {
+            ArgumentChecks.ensurePositive("transferSize", newValue);
+        }
         transferSize = newValue;
     }
 
@@ -190,21 +224,93 @@ public class DefaultDigitalTransferOptio
     /**
      * Returns information about offline media on which the resource can be obtained.
      *
+     * @return Offline media on which the resource can be obtained.
+     *
+     * @since 0.5
+     */
+    public Collection<Medium> getOffLines() {
+        return offLines = nonNullCollection(offLines, Medium.class);
+    }
+
+    /**
+     * Sets information about offline media on which the resource can be obtained.
+     *
+     * @param newValues The new offline media.
+     *
+     * @since 0.5
+     */
+    public void setOffLines(final Collection<? extends Medium> newValues) {
+        offLines = writeCollection(newValues, offLines, Medium.class);
+    }
+
+    /**
+     * Returns information about offline media on which the resource can be obtained.
+     *
      * @return Offline media on which the resource can be obtained, or {@code null}.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getOffLines()}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "offLine")
-    public Medium getOffLine() {
-        return offLine;
+    public final Medium getOffLine() {
+        return LegacyPropertyAdapter.getSingleton(offLines, Medium.class, null, DefaultDigitalTransferOptions.class, "getOffLine");
     }
 
     /**
      * Sets information about offline media on which the resource can be obtained.
      *
      * @param newValue The new offline media.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by {@link #setOffLines(Collection)}.
      */
+    @Deprecated
     public void setOffLine(final Medium newValue) {
+        setOffLines(LegacyPropertyAdapter.asCollection(newValue));
+    }
+
+    /**
+     * Returns the rate of occurrence of distribution.
+     *
+     * @return Rate of occurrence of distribution, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public PeriodDuration getTransferFrequency() {
+        return transferFrequency;
+    }
+
+    /**
+     * Sets the rate of occurrence of distribution.
+     *
+     * @param newValue The new rate of occurrence of distribution.
+     *
+     * @since 0.5
+     */
+    public void setTransferFrequency(final PeriodDuration newValue) {
         checkWritePermission();
-        offLine = newValue;
+        transferFrequency = newValue;
+    }
+
+    /**
+     * Returns the formats of distribution.
+     *
+     * @return Formats of distribution.
+     *
+     * @since 0.5
+     */
+    public Collection<Format> getDistributionFormats() {
+        return distributionFormats = nonNullCollection(distributionFormats, Format.class);
+    }
+
+    /**
+     * Sets the formats of distribution.
+     *
+     * @param newValues The new formats of distribution.
+     *
+     * @since 0.5
+     */
+    public void setDistributionFormats(final Collection<? extends Format> newValues) {
+        distributionFormats = writeCollection(newValues, distributionFormats, Format.class);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,6 +20,7 @@ import java.util.Collection;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.distribution.DigitalTransferOptions;
 import org.opengis.metadata.distribution.Distribution;
 import org.opengis.metadata.distribution.Distributor;
@@ -30,11 +31,20 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Information about the distributor of and options for obtaining the resource.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Distribution_Type", propOrder = {
@@ -50,6 +60,11 @@ public class DefaultDistribution extends
     private static final long serialVersionUID = 1331353255189686369L;
 
     /**
+     * Brief description of a set of distribution options.
+     */
+    private InternationalString description;
+
+    /**
      * Provides a description of the format of the data to be distributed.
      */
     private Collection<Format> distributionFormats;
@@ -86,6 +101,9 @@ public class DefaultDistribution extends
             distributionFormats = copyCollection(object.getDistributionFormats(), Format.class);
             distributors        = copyCollection(object.getDistributors(), Distributor.class);
             transferOptions     = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class);
+            if (object instanceof DefaultDistribution) {
+                description = ((DefaultDistribution) object).getDescription();
+            }
         }
     }
 
@@ -115,6 +133,29 @@ public class DefaultDistribution extends
     }
 
     /**
+     * Returns a brief description of a set of distribution options.
+     *
+     * @return Brief description of a set of distribution options.
+     *
+     * @since 0.5
+     */
+    public InternationalString getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets a brief description of a set of distribution options.
+     *
+     * @param newValue The new description.
+     *
+     * @since 0.5
+     */
+    public void setDescription(final InternationalString newValue) {
+        checkWritePermission();
+        description = newValue;
+    }
+
+    /**
      * Provides a description of the format of the data to be distributed.
      *
      * @return Description of the format of the data to be distributed.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -31,11 +31,20 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Information about the distributor.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Distributor_Type", propOrder = {
@@ -132,7 +141,12 @@ public class DefaultDistributor extends 
     }
 
     /**
-     * Party from whom the resource may be obtained. This list need not be exhaustive.
+     * Party from whom the resource may be obtained.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@link Responsibility} parent interface.
+     * This change may be applied in GeoAPI 4.0.
+     * </div>
      *
      * @return Party from whom the resource may be obtained, or {@code null}.
      */
@@ -143,7 +157,12 @@ public class DefaultDistributor extends 
     }
 
     /**
-     * Sets the party from whom the resource may be obtained. This list need not be exhaustive.
+     * Sets the party from whom the resource may be obtained.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@link Responsibility} parent interface.
+     * This change may be applied in GeoAPI 4.0.
+     * </div>
      *
      * @param newValue The new distributor contact.
      */

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -17,12 +17,17 @@
 package org.apache.sis.metadata.iso.distribution;
 
 import java.util.Collection;
+import java.util.Collections;
+import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.distribution.Format;
+import org.opengis.metadata.distribution.Medium;
 import org.opengis.metadata.distribution.Distributor;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
+import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 
@@ -31,11 +36,20 @@ import org.apache.sis.util.iso.Types;
  * Description of the computer language construct that specifies the representation
  * of data objects in a record, file, message, storage device or transmission channel.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Format_Type", propOrder = {
@@ -51,17 +65,12 @@ public class DefaultFormat extends ISOMe
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -6713019619784302519L;
-
-    /**
-     * Name of the data transfer format(s).
-     */
-    private InternationalString name;
+    private static final long serialVersionUID = -8346373589075887348L;
 
     /**
-     * Version of the format (date, number, etc.).
+     * Citation / URL of the specification format.
      */
-    private InternationalString version;
+    private Citation formatSpecificationCitation;
 
     /**
      * Amendment number of the format version.
@@ -69,17 +78,17 @@ public class DefaultFormat extends ISOMe
     private InternationalString amendmentNumber;
 
     /**
-     * Name of a subset, profile, or product specification of the format.
-     */
-    private InternationalString specification;
-
-    /**
      * Recommendations of algorithms or processes that can be applied to read or
      * expand resources to which compression techniques have been applied.
      */
     private InternationalString fileDecompressionTechnique;
 
     /**
+     * Media used by the format.
+     */
+    private Collection<Medium> media;
+
+    /**
      * Provides information about the distributor's format.
      */
     private Collection<Distributor> formatDistributors;
@@ -97,8 +106,12 @@ public class DefaultFormat extends ISOMe
      * @param version The version of the format (date, number, etc.), or {@code null}.
      */
     public DefaultFormat(final CharSequence name, final CharSequence version) {
-        this.name    = Types.toInternationalString(name);
-        this.version = Types.toInternationalString(version);
+        final DefaultCitation citation = new DefaultCitation();
+        if (name != null) {
+            citation.setAlternateTitles(Collections.singleton(Types.toInternationalString(name)));
+        }
+        citation.setEdition(Types.toInternationalString(version));
+        formatSpecificationCitation = citation;
     }
 
     /**
@@ -113,12 +126,17 @@ public class DefaultFormat extends ISOMe
     public DefaultFormat(final Format object) {
         super(object);
         if (object != null) {
-            name                       = object.getName();
-            version                    = object.getVersion();
-            amendmentNumber            = object.getAmendmentNumber();
-            specification              = object.getSpecification();
-            fileDecompressionTechnique = object.getFileDecompressionTechnique();
-            formatDistributors         = copyCollection(object.getFormatDistributors(), Distributor.class);
+            amendmentNumber             = object.getAmendmentNumber();
+            fileDecompressionTechnique  = object.getFileDecompressionTechnique();
+            formatDistributors          = copyCollection(object.getFormatDistributors(), Distributor.class);
+            if (object instanceof DefaultFormat) {
+                formatSpecificationCitation = ((DefaultFormat) object).getFormatSpecificationCitation();
+                media = copyCollection(((DefaultFormat) object).getMedia(), Medium.class);
+            } else {
+                setSpecification(object.getSpecification());
+                setVersion(object.getVersion());
+                setName(object.getName());
+            }
         }
     }
 
@@ -148,45 +166,138 @@ public class DefaultFormat extends ISOMe
     }
 
     /**
+     * Returns the citation / URL of the specification format.
+     *
+     * @return Citation / URL of the specification format.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "formatSpecificationCitation", required = true)
+    public Citation getFormatSpecificationCitation() {
+        return formatSpecificationCitation;
+    }
+
+    /**
+     * Sets the citation / URL of the specification format.
+     *
+     * @param newValue The new specification format.
+     *
+     * @since 0.5
+     */
+    public void setFormatSpecificationCitation(final Citation newValue) {
+        checkWritePermission();
+        formatSpecificationCitation = newValue;
+    }
+
+    /**
+     * Returns the {@link #formatSpecificationCitation} as a SIS implementation.
+     */
+    private DefaultCitation getWritableCitation() {
+        Citation citation = getFormatSpecificationCitation();
+        if (!(citation instanceof DefaultCitation)) {
+            citation = new DefaultCitation(citation);
+            setFormatSpecificationCitation(citation);
+        }
+        return (DefaultCitation) citation;
+    }
+
+    /**
+     * Returns the name of a subset, profile, or product specification of the format.
+     *
+     * @return Name of a subset, profile, or product specification of the format, or {@code null}.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getTitle() getTitle()}</code>.
+     */
+    @Override
+    @Deprecated
+    @XmlElement(name = "specification")
+    public InternationalString getSpecification() {
+        final Citation citation = getFormatSpecificationCitation();
+        return (citation != null) ? citation.getTitle(): null;
+    }
+
+    /**
+     * Sets the name of a subset, profile, or product specification of the format.
+     *
+     * @param newValue The new specification.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#setTitle(InternationalString)
+     * setTitle(InternationalString)}</code>.
+     */
+    @Deprecated
+    public void setSpecification(final InternationalString newValue) {
+        checkWritePermission();
+        getWritableCitation().setTitle(newValue);
+    }
+
+    /**
      * Returns the name of the data transfer format(s).
      *
      * @return Name of the data transfer format(s), or {@code null}.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getAlternateTitles()
+     * getAlternateTitles()}</code>. Note that citation alternate titles are often used for abbreviations.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "name", required = true)
-    public InternationalString getName() {
-        return name;
+    public final InternationalString getName() {
+        final Citation citation = getFormatSpecificationCitation();
+        if (citation != null) {
+            return LegacyPropertyAdapter.getSingleton(citation.getAlternateTitles(),
+                    InternationalString.class, null, DefaultFormat.class, "getName");
+        }
+        return null;
     }
 
     /**
      * Sets the name of the data transfer format(s).
      *
      * @param newValue The new name.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#setAlternateTitles(Collection)
+     * setAlternateTitles(Collection)}</code>.
      */
+    @Deprecated
     public void setName(final InternationalString newValue) {
-         checkWritePermission();
-         name = newValue;
-     }
+        checkWritePermission();
+        getWritableCitation().setAlternateTitles(LegacyPropertyAdapter.asCollection(newValue));
+    }
 
     /**
      * Returns the version of the format (date, number, etc.).
      *
      * @return Version of the format, or {@code null}.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getEdition()
+     * getEdition()}</code>.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "version", required = true)
     public InternationalString getVersion() {
-        return version;
+        final Citation citation = getFormatSpecificationCitation();
+        return (citation != null) ? citation.getEdition(): null;
     }
 
     /**
      * Sets the version of the format (date, number, etc.).
      *
      * @param newValue The new version.
+     *
+     * @deprecated As of ISO 19115:2014, replaced by
+     * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#setEdition(InternationalString)
+     * setEdition(InternationalString)}</code>.
      */
+    @Deprecated
     public void setVersion(final InternationalString newValue) {
         checkWritePermission();
-        version = newValue;
+        getWritableCitation().setEdition(newValue);
     }
 
     /**
@@ -211,27 +322,6 @@ public class DefaultFormat extends ISOMe
     }
 
     /**
-     * Returns the name of a subset, profile, or product specification of the format.
-     *
-     * @return Name of a subset, profile, or product specification of the format, or {@code null}.
-     */
-    @Override
-    @XmlElement(name = "specification")
-    public InternationalString getSpecification() {
-        return specification;
-    }
-
-    /**
-     * Sets the name of a subset, profile, or product specification of the format.
-     *
-     * @param newValue The new specification.
-     */
-    public void setSpecification(final InternationalString newValue) {
-        checkWritePermission();
-        specification = newValue;
-    }
-
-    /**
      * Returns recommendations of algorithms or processes that can be applied to read or
      * expand resources to which compression techniques have been applied.
      *
@@ -256,6 +346,29 @@ public class DefaultFormat extends ISOMe
     }
 
     /**
+     * Returns the media used by the format.
+     *
+     * @return Media used by the format.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "medium")
+    public Collection<Medium> getMedia() {
+        return media = nonNullCollection(media, Medium.class);
+    }
+
+    /**
+     * Sets the media used by the format.
+     *
+     * @param newValues The new media.
+     *
+     * @since 0.5
+     */
+    public void setMedia(final Collection<? extends Medium> newValues) {
+        media = writeCollection(newValues, media, Medium.class);
+    }
+
+    /**
      * Provides information about the distributor's format.
      *
      * @return Information about the distributor's format.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,27 +16,40 @@
  */
 package org.apache.sis.metadata.iso.distribution;
 
+import java.util.AbstractSet;
 import java.util.Collection;
+import java.util.Iterator;
 import javax.measure.unit.Unit;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.distribution.Medium;
 import org.opengis.metadata.distribution.MediumName;
 import org.opengis.metadata.distribution.MediumFormat;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
 
 /**
  * Information about the media on which the resource can be distributed.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Medium_Type", propOrder = {
@@ -61,7 +74,7 @@ public class DefaultMedium extends ISOMe
 
     /**
      * Density at which the data is recorded.
-     * If non-null, then the numbers shall be greater than zero.
+     * If non-null, then the number shall be greater than zero.
      */
     private Collection<Double> densities;
 
@@ -86,6 +99,11 @@ public class DefaultMedium extends ISOMe
     private InternationalString mediumNote;
 
     /**
+     * Unique identifier for an instance of the medium.
+     */
+    private Identifier identifier;
+
+    /**
      * Constructs an initially empty medium.
      */
     public DefaultMedium() {
@@ -109,6 +127,9 @@ public class DefaultMedium extends ISOMe
             volumes       = object.getVolumes();
             mediumFormats = copyCollection(object.getMediumFormats(), MediumFormat.class);
             mediumNote    = object.getMediumNote();
+            if (object instanceof DefaultMedium) {
+                identifier = ((DefaultMedium) object).getIdentifier();
+            }
         }
     }
 
@@ -208,7 +229,7 @@ public class DefaultMedium extends ISOMe
      * @return Number of items in the media identified, or {@code null}.
      */
     @Override
-    @ValueRange(minimum=0)
+    @ValueRange(minimum = 0)
     @XmlElement(name = "volumes")
     public Integer getVolumes() {
         return volumes;
@@ -264,4 +285,28 @@ public class DefaultMedium extends ISOMe
         checkWritePermission();
         mediumNote = newValue;
     }
+
+    /**
+     * Returns a unique identifier for an instance of the medium.
+     *
+     * @return Unique identifier, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "identifier")
+    public Identifier getIdentifier() {
+        return identifier;
+    }
+
+    /**
+     * Sets a unique identifier for an instance of the medium.
+     *
+     * @param newValue The new identifier.
+     *
+     * @since 0.5
+     */
+    public void setIdentifier(final Identifier newValue) {
+        checkWritePermission();
+        identifier = newValue;
+    }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,6 +20,8 @@ import java.util.Date;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
+import org.opengis.util.Record;
+import org.opengis.util.RecordType;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.distribution.StandardOrderProcess;
 import org.apache.sis.metadata.iso.ISOMetadata;
@@ -32,11 +34,20 @@ import static org.apache.sis.internal.me
  * Common ways in which the resource may be obtained or received, and related instructions
  * and fee information.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_StandardOrderProcess_Type", propOrder = {
@@ -75,6 +86,16 @@ public class DefaultStandardOrderProcess
     private InternationalString turnaround;
 
     /**
+     * Description of the order options record.
+     */
+    private RecordType orderOptionType;
+
+    /**
+     * Request/purchase choices.
+     */
+    private Record orderOptions;
+
+    /**
      * Constructs an initially empty standard order process.
      */
     public DefaultStandardOrderProcess() {
@@ -96,6 +117,10 @@ public class DefaultStandardOrderProcess
             plannedAvailableDateTime = toMilliseconds(object.getPlannedAvailableDateTime());
             orderingInstructions     = object.getOrderingInstructions();
             turnaround               = object.getTurnaround();
+            if (object instanceof DefaultStandardOrderProcess) {
+                orderOptionType = ((DefaultStandardOrderProcess) object).getOrderOptionType();
+                orderOptions    = ((DefaultStandardOrderProcess) object).getOrderOptions();
+            }
         }
     }
 
@@ -209,4 +234,58 @@ public class DefaultStandardOrderProcess
         checkWritePermission();
         turnaround = newValue;
     }
+
+    /**
+     * Returns the description of the {@linkplain #getOrderOptions() order options} record.
+     *
+     * @return Description of the order options record, or {@code null} if none.
+     *
+     * @since 0.5
+     *
+     * @see org.apache.sis.util.iso.DefaultRecord#getRecordType()
+     */
+/// @XmlElement(name = "orderOptionType")
+    public RecordType getOrderOptionType() {
+        return orderOptionType;
+    }
+
+    /**
+     * Sets the description of the {@linkplain #getOrderOptions() order options} record.
+     *
+     * @param newValue New description of the order options record.
+     *
+     * @since 0.5
+     */
+    public void setOrderOptionType(final RecordType newValue) {
+        checkWritePermission();
+        orderOptionType = newValue;
+    }
+
+    /**
+     * Returns the request/purchase choices.
+     *
+     * @return Request/purchase choices.
+     *
+     * @since 0.5
+     *
+     * @todo We presume that this record is filled by the vendor for describing the options chosen by the client
+     *       when he ordered the resource. We presume that this is not a record to be filled by the user for new
+     *       orders, otherwise this method would need to be a factory rather than a getter.
+     */
+/// @XmlElement(name = "orderOptions")
+    public Record getOrderOptions() {
+        return orderOptions;
+    }
+
+    /**
+     * Sets the request/purchase choices.
+     *
+     * @param newValue the new request/purchase choices.
+     *
+     * @since 0.5
+     */
+    public void setOrderOptions(final Record newValue) {
+        checkWritePermission();
+        orderOptions = newValue;
+    }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -53,7 +53,7 @@
  * </td></tr></table>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -30,6 +30,15 @@ import org.apache.sis.metadata.iso.ISOMe
 /**
  * Base class for geographic area of the dataset.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
@@ -97,7 +106,7 @@ public class AbstractGeographicExtent ex
      *
      * <ul>
      *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is is an instance of {@link BoundingPolygon},
+     *   <li>Otherwise if the given object is an instance of {@link BoundingPolygon},
      *       {@link GeographicBoundingBox} or {@link GeographicDescription}, then this method
      *       delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
      *       Note that if the given object implements more than one of the above-cited interfaces,



Mime
View raw message