sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1616822 - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribu...
Date Fri, 08 Aug 2014 16:37:19 GMT
Author: desruisseaux
Date: Fri Aug  8 16:37:18 2014
New Revision: 1616822

URL: http://svn.apache.org/r1616822
Log:
Merge from the JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1616537-1616820

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
[UTF-8] Fri Aug  8 16:37:18 2014
@@ -160,8 +160,7 @@ public abstract class LegacyPropertyAdap
                         }
                         caller.warningOccurred = true;
                     }
-                    Context.warningOccured(Context.current(), callerClass, callerMethod,
-                            Messages.class, Messages.Keys.IgnoredPropertiesAfterFirst_1,
valueClass);
+                    warnIgnoredExtraneous(valueClass, callerClass, callerMethod);
                 }
                 return value;
             }
@@ -170,6 +169,20 @@ public abstract class LegacyPropertyAdap
     }
 
     /**
+     * Emit a warning about extraneous ignored values.
+     *
+     * @param  valueClass    The value class, used in case of warning only.
+     * @param  callerClass   The caller class, used in case of warning only.
+     * @param  callerMethod  The caller method, used in case of warning only.
+     */
+    public static void warnIgnoredExtraneous(final Class<?> valueClass,
+            final Class<?> callerClass, final String callerMethod)
+    {
+        Context.warningOccured(Context.current(), callerClass, callerMethod,
+                Messages.class, Messages.Keys.IgnoredPropertiesAfterFirst_1, valueClass);
+    }
+
+    /**
      * Returns the given value as an empty or singleton collection.
      *
      * @param  <L>   The type of the old value.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] Fri Aug  8 16:37:18 2014
@@ -30,8 +30,6 @@ import org.opengis.metadata.content.Rang
 import org.opengis.metadata.content.RangeElementDescription;
 import org.opengis.util.RecordType;
 import org.apache.sis.xml.Namespaces;
-import org.apache.sis.internal.jaxb.Context;
-import org.apache.sis.util.resources.Messages;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
 
@@ -238,8 +236,8 @@ public class DefaultCoverageDescription 
                         if (type == null) {
                             type = t;
                         } else {
-                            Context.warningOccured(Context.current(), DefaultCoverageDescription.class,
"getContentType",
-                                    Messages.class, Messages.Keys.IgnoredPropertiesAfterFirst_1,
CoverageContentType.class);
+                            LegacyPropertyAdapter.warnIgnoredExtraneous(CoverageContentType.class,
+                                    DefaultCoverageDescription.class, "getContentType");
                             break;
                         }
                     }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
[UTF-8] Fri Aug  8 16:37:18 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;
 
@@ -44,7 +49,7 @@ import org.apache.sis.util.iso.Types;
  * @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 = {
@@ -60,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.
@@ -78,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;
@@ -106,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;
     }
 
     /**
@@ -122,12 +126,11 @@ 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);
+            formatSpecificationCitation = object.getFormatSpecificationCitation();
+            amendmentNumber             = object.getAmendmentNumber();
+            fileDecompressionTechnique  = object.getFileDecompressionTechnique();
+            media                       = copyCollection(object.getMedia(), Medium.class);
+            formatDistributors          = copyCollection(object.getFormatDistributors(),
Distributor.class);
         }
     }
 
@@ -157,45 +160,139 @@ public class DefaultFormat extends ISOMe
     }
 
     /**
+     * Returns the citation / URL of the specification format.
+     *
+     * @return Citation / URL of the specification format.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @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);
     }
 
     /**
@@ -220,27 +317,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.
      *
@@ -265,6 +341,30 @@ public class DefaultFormat extends ISOMe
     }
 
     /**
+     * Returns the media used by the format.
+     *
+     * @return Media used by the format.
+     *
+     * @since 0.5
+     */
+    @Override
+/// @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/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
[UTF-8] Fri Aug  8 16:37:18 2014
@@ -16,17 +16,21 @@
  */
 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;
 
 
 /**
@@ -45,7 +49,7 @@ import org.apache.sis.metadata.iso.ISOMe
  * @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 +65,7 @@ public class DefaultMedium extends ISOMe
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 7751002701087451894L;
+    private static final long serialVersionUID = 2657393801067168091L;
 
     /**
      * Name of the medium on which the resource can be received.
@@ -70,9 +74,9 @@ 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;
+    private Double density;
 
     /**
      * Units of measure for the recording density.
@@ -95,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() {
@@ -113,11 +122,12 @@ public class DefaultMedium extends ISOMe
         super(object);
         if (object != null) {
             name          = object.getName();
-            densities     = copyCollection(object.getDensities(), Double.class);
+            density       = object.getDensity();
             densityUnits  = object.getDensityUnits();
             volumes       = object.getVolumes();
             mediumFormats = copyCollection(object.getMediumFormats(), MediumFormat.class);
             mediumNote    = object.getMediumNote();
+            identifier    = object.getIdentifier();
         }
     }
 
@@ -169,25 +179,72 @@ public class DefaultMedium extends ISOMe
 
     /**
      * Returns the density at which the data is recorded.
-     * The numbers shall be greater than zero.
+     * The number shall be greater than zero.
+     *
+     * @return Density at which the data is recorded, or {@code null}.
+     *
+     * @since 0.5
+     */
+    @Override
+    @ValueRange(minimum = 0, isMinIncluded = false)
+    public Double getDensity() {
+        return density;
+    }
+
+    /**
+     * Sets density at which the data is recorded.
+     * The number shall be greater than zero.
+     *
+     * @param newValue The new density.
+     *
+     * @since 0.5
+     */
+    public void setDensity(final Double newValue) {
+        checkWritePermission();
+        density = newValue;
+    }
+
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getDensity()}.
      *
      * @return Density at which the data is recorded, or {@code null}.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "density")
-    @ValueRange(minimum=0, isMinIncluded=false)
     public Collection<Double> getDensities() {
-        return densities = nonNullCollection(densities, Double.class);
+        return new AbstractSet<Double>() {
+            /** Returns 0 if empty, or 1 if a density has been specified. */
+            @Override public int size() {
+                return getDensity() != null ? 1 : 0;
+            }
+
+            /** Returns an iterator over 0 or 1 element. Current iterator implementation
is unmodifiable. */
+            @Override public Iterator<Double> iterator() {
+                return LegacyPropertyAdapter.asCollection(getDensity()).iterator();
+            }
+
+            /** Adds an element only if the set is empty. This method is invoked by JAXB
at unmarshalling time. */
+            @Override public boolean add(final Double newValue) {
+                if (isEmpty()) {
+                    setDensity(newValue);
+                    return true;
+                } else {
+                    LegacyPropertyAdapter.warnIgnoredExtraneous(Double.class, DefaultMedium.class,
"setDensities");
+                    return false;
+                }
+            }
+        };
     }
 
     /**
-     * Sets density at which the data is recorded.
-     * The numbers shall be greater than zero.
+     * @deprecated As of ISO 19115:2014, replaced by {@link #setDensity(Double)}.
      *
      * @param newValues The new densities.
      */
+    @Deprecated
     public void setDensities(final Collection<? extends Double> newValues) {
-        densities = writeCollection(newValues, densities, Double.class);
+        setDensity(LegacyPropertyAdapter.getSingleton(newValues, Double.class, null, DefaultMedium.class,
"setDensities"));
     }
 
     /**
@@ -217,7 +274,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;
@@ -273,4 +330,29 @@ 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
+     */
+    @Override
+/// @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/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
[UTF-8] Fri Aug  8 16:37:18 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;
@@ -45,7 +47,7 @@ import static org.apache.sis.internal.me
  * @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 = {
@@ -84,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() {
@@ -105,6 +117,8 @@ public class DefaultStandardOrderProcess
             plannedAvailableDateTime = toMilliseconds(object.getPlannedAvailableDateTime());
             orderingInstructions     = object.getOrderingInstructions();
             turnaround               = object.getTurnaround();
+            orderOptionType          = object.getOrderOptionType();
+            orderOptions             = object.getOrderOptions();
         }
     }
 
@@ -218,4 +232,60 @@ 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()
+     */
+    @Override
+/// @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.
+     */
+    @Override
+/// @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/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java?rev=1616822&r1=1616821&r2=1616822&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] Fri Aug  8 16:37:18 2014
@@ -60,7 +60,7 @@
  *
  *       <li>{@link org.apache.sis.metadata.iso.extent.Extents#intersection
  *       intersection(GeographicBoundingBox, GeographicBoundingBox)}
- *       for computing the intersection of two geographic bounding boxes, which may be null.</li>
+ *       for computing the intersection of two geographic bounding boxes.</li>
  *
  *       <li>{@link org.apache.sis.metadata.iso.extent.Extents#area
  *       area(GeographicBoundingBox)}



Mime
View raw message