sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1629811 - in /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso: identification/DefaultBrowseGraphic.java maintenance/DefaultScopeDescription.java
Date Tue, 07 Oct 2014 06:51:31 GMT
Author: desruisseaux
Date: Tue Oct  7 06:51:31 2014
New Revision: 1629811

URL: http://svn.apache.org/r1629811
Log:
Documentation update from ISO 19115:2014 reading (especially the example sections).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java?rev=1629811&r1=1629810&r2=1629811&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
[UTF-8] Tue Oct  7 06:51:31 2014
@@ -192,7 +192,10 @@ public class DefaultBrowseGraphic extend
 
     /**
      * Format in which the illustration is encoded.
-     * Examples: CGM, EPS, GIF, JPEG, PBM, PS, TIFF, XWD.
+     *
+     * <div class="note"><b>Example:</b>
+     * CGM, EPS, GIF, JPEG, PBM, PS, TIFF, XWD.
+     * </div>
      *
      * @return Format in which the illustration is encoded, or {@code null}.
      */
@@ -205,6 +208,8 @@ public class DefaultBrowseGraphic extend
 
     /**
      * Sets the format in which the illustration is encoded.
+     * Raster formats are encouraged to use one of the names returned by
+     * {@link javax.imageio.ImageIO#getReaderFormatNames()}.
      *
      * @param newValue The new file type.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1629811&r1=1629810&r2=1629811&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
[UTF-8] Tue Oct  7 06:51:31 2014
@@ -21,6 +21,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.metadata.maintenance.ScopeCode;
 import org.opengis.metadata.maintenance.ScopeDescription;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.internal.metadata.ExcludedSet;
@@ -53,7 +54,7 @@ import static org.apache.sis.util.collec
  * @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_ScopeDescription_Type") // No need for propOrder since this structure
is a union (see javadoc).
@@ -67,18 +68,18 @@ public class DefaultScopeDescription ext
     /**
      * Enumeration of possible values for {@link #property}.
      */
-    private static final byte ATTRIBUTES=1, FEATURES=2, FEATURE_INSTANCES=3, ATTRIBUTE_INSTANCES=4,
DATASET=5, OTHER=6;
+    private static final byte DATASET=1, FEATURES=2, ATTRIBUTES=3, FEATURE_INSTANCES=4, ATTRIBUTE_INSTANCES=5,
OTHER=6;
 
     /**
      * The names of the mutually exclusive properties. The index of each name shall be the
      * value of the above {@code byte} constants minus one.
      */
     private static final String[] NAMES = {
-        "attributes",
+        "dataset",
         "features",
+        "attributes",
         "featureInstances",
         "attributeInstances",
-        "dataset",
         "other"
     };
 
@@ -86,11 +87,11 @@ public class DefaultScopeDescription ext
      * The names of the setter methods, for logging purpose only.
      */
     private static final String[] SETTERS = {
-        "setAttributes",
+        "setDataset",
         "setFeatures",
+        "setAttributes",
         "setFeatureInstances",
         "setAttributeInstances",
-        "setDataset",
         "setOther"
     };
 
@@ -103,8 +104,8 @@ public class DefaultScopeDescription ext
      * The value, as one of the following types:
      *
      * <ul>
-     *   <li>{@code Set<CharSequence>} for the {@code attributes} property</li>
      *   <li>{@code Set<CharSequence>} for the {@code features} property</li>
+     *   <li>{@code Set<CharSequence>} for the {@code attributes} property</li>
      *   <li>{@code Set<CharSequence>} for the {@code featureInstances} property</li>
      *   <li>{@code Set<CharSequence>} for the {@code attributeInstances} property</li>
      *   <li>{@code String} for the {@code dataset} property</li>
@@ -125,9 +126,12 @@ public class DefaultScopeDescription ext
      * given object are not recursively copied.
      *
      * <p>If the given object contains more than one value, then the first non-null
element in the
-     * following list has precedence: {@linkplain #getAttributes() attributes},
-     * {@linkplain #getFeatures() features}, {@linkplain #getFeatureInstances() feature instances},
-     * {@linkplain #getAttributeInstances() attribute instances}, {@linkplain #getDataset()
dataset}
+     * following list has precedence (from wider scope to smaller scope):
+     * {@linkplain #getDataset() dataset},
+     * {@linkplain #getFeatures() features},
+     * {@linkplain #getAttributes() attributes},
+     * {@linkplain #getFeatureInstances() feature instances},
+     * {@linkplain #getAttributeInstances() attribute instances}
      * and {@linkplain #getOther() other}.</p>
      *
      * @param object The metadata to copy values from, or {@code null} if none.
@@ -138,15 +142,15 @@ public class DefaultScopeDescription ext
     public DefaultScopeDescription(final ScopeDescription object) {
         super(object);
         if (object != null) {
-            for (byte i=ATTRIBUTES; i<=OTHER; i++) {
+            for (byte i=DATASET; i<=OTHER; i++) {
                 Collection<? extends CharSequence> props = null;
                 Object value = null;
                 switch (i) {
-                    case ATTRIBUTES:          props = object.getAttributes();         break;
+                    case DATASET:             value = object.getDataset();            break;
                     case FEATURES:            props = object.getFeatures();           break;
+                    case ATTRIBUTES:          props = object.getAttributes();         break;
                     case FEATURE_INSTANCES:   props = object.getFeatureInstances();   break;
                     case ATTRIBUTE_INSTANCES: props = object.getAttributeInstances(); break;
-                    case DATASET:             value = object.getDataset();            break;
                     case OTHER:               value = object.getOther();              break;
                     default: throw new AssertionError(i);
                 }
@@ -250,36 +254,51 @@ public class DefaultScopeDescription ext
     }
 
     /**
-     * Returns the attributes to which the information applies.
+     * Returns the dataset to which the information applies.
      *
-     * @return Attributes to which the information applies.
+     * <div class="note"><b>Example:</b>
+     * If a geographic data provider is generating vector mapping for thee administrative
areas
+     * and if the data were processed in the same way, then the provider could record the
bulk
+     * of initial data at {@link ScopeCode#DATASET} level with a
+     * “<cite>Administrative area A, B &amp; C</cite>” description.
+     * </div>
      *
-     * {@section Conditions}
-     * This method returns a modifiable collection only if no other property is set.
-     * Otherwise, this method returns an unmodifiable empty collection.
+     * @return Dataset to which the information applies, or {@code null}.
      */
     @Override
-    public Set<CharSequence> getAttributes() {
-        return getProperty(ATTRIBUTES);
+    @XmlElement(name = "dataset")
+    public String getDataset() {
+        return (property == DATASET) ? (String) value : null;
     }
 
     /**
-     * Sets the attributes to which the information applies.
+     * Sets the dataset to which the information applies.
      *
      * {@section Effect on other properties}
-     * If and only if the {@code newValue} is non-empty, then this method automatically
+     * If and only if the {@code newValue} is non-null, then this method automatically
      * discards all other properties.
      *
-     * @param newValues The new attributes.
+     * @param newValue The new dataset.
      */
-    public void setAttributes(final Set<? extends CharSequence> newValues) {
-        setProperty(newValues, ATTRIBUTES);
+    public void setDataset(final String newValue) {
+        checkWritePermission();
+        if (newValue != null || property == DATASET) {
+            warningOnOverwrite(DATASET);
+            property = DATASET;
+            value = newValue;
+        }
     }
 
     /**
-     * Returns the features to which the information applies.
+     * Returns the feature types to which the information applies.
+     *
+     * <div class="note"><b>Example:</b>
+     * If an administrative area performs a complete re-survey of the road network,
+     * the change can be recorded at {@link ScopeCode#FEATURE_TYPE} level with a
+     * “<cite>Administrative area A — Road network</cite>” description.
+     * </div>
      *
-     * @return Features to which the information applies.
+     * @return Feature types to which the information applies.
      *
      * {@section Conditions}
      * This method returns a modifiable collection only if no other property is set.
@@ -291,21 +310,60 @@ public class DefaultScopeDescription ext
     }
 
     /**
-     * Sets the features to which the information applies.
+     * Sets the feature types to which the information applies.
      *
      * {@section Effect on other properties}
      * If and only if the {@code newValue} is non-empty, then this method automatically
      * discards all other properties.
      *
-     * @param newValues The new features.
+     * @param newValues The new feature types.
      */
     public void setFeatures(final Set<? extends CharSequence> newValues) {
         setProperty(newValues, FEATURES);
     }
 
     /**
+     * Returns the attribute types to which the information applies.
+     *
+     * <div class="note"><b>Example:</b>
+     * If an administrative area detects an anomaly in all overhead clearance of the road
survey,
+     * the correction can be recorded at {@link ScopeCode#ATTRIBUTE_TYPE} level with a
+     * “<cite>Administrative area A — Overhead clearance</cite>” description.
+     * </div>
+     *
+     * @return Attribute types to which the information applies.
+     *
+     * {@section Conditions}
+     * This method returns a modifiable collection only if no other property is set.
+     * Otherwise, this method returns an unmodifiable empty collection.
+     */
+    @Override
+    public Set<CharSequence> getAttributes() {
+        return getProperty(ATTRIBUTES);
+    }
+
+    /**
+     * Sets the attribute types to which the information applies.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-empty, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValues The new attribute types.
+     */
+    public void setAttributes(final Set<? extends CharSequence> newValues) {
+        setProperty(newValues, ATTRIBUTES);
+    }
+
+    /**
      * Returns the feature instances to which the information applies.
      *
+     * <div class="note"><b>Example:</b>
+     * If a new bridge is constructed in a road network,
+     * the change can be recorded at {@link ScopeCode#FEATURE} level with a
+     * “<cite>Administrative area A — New bridge</cite>” description.
+     * </div>
+     *
      * @return Feature instances to which the information applies.
      *
      * {@section Conditions}
@@ -333,6 +391,12 @@ public class DefaultScopeDescription ext
     /**
      * Returns the attribute instances to which the information applies.
      *
+     * <div class="note"><b>Example:</b>
+     * If the overhead clearance of a new bridge was wrongly recorded,
+     * the correction can be recorded at {@link ScopeCode#ATTRIBUTE} level with a
+     * “<cite>Administrative area A — New bridge — Overhead clearance</cite>”
description.
+     * </div>
+     *
      * @return Attribute instances to which the information applies.
      *
      * {@section Conditions}
@@ -358,35 +422,6 @@ public class DefaultScopeDescription ext
     }
 
     /**
-     * Returns the dataset to which the information applies.
-     *
-     * @return Dataset to which the information applies, or {@code null}.
-     */
-    @Override
-    @XmlElement(name = "dataset")
-    public String getDataset() {
-        return (property == DATASET) ? (String) value : null;
-    }
-
-    /**
-     * Sets the dataset to which the information applies.
-     *
-     * {@section Effect on other properties}
-     * If and only if the {@code newValue} is non-null, then this method automatically
-     * discards all other properties.
-     *
-     * @param newValue The new dataset.
-     */
-    public void setDataset(final String newValue) {
-        checkWritePermission();
-        if (newValue != null || property == DATASET) {
-            warningOnOverwrite(DATASET);
-            property = DATASET;
-            value = newValue;
-        }
-    }
-
-    /**
      * Returns the class of information that does not fall into the other categories to which
the information applies.
      *
      * @return Class of information that does not fall into the other categories, or {@code
null}.



Mime
View raw message