You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/03/20 15:48:48 UTC

svn commit: r1458861 - in /sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso: constraint/ content/

Author: desruisseaux
Date: Wed Mar 20 14:48:48 2013
New Revision: 1458861

URL: http://svn.apache.org/r1458861
Log:
Added the metadata content package.

Added:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java   (with props)
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java   (with props)
Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -19,9 +19,9 @@
  */
 package org.apache.sis.metadata.iso.constraint;
 
+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.constraint.Classification;
 import org.opengis.metadata.constraint.SecurityConstraints;
@@ -80,7 +80,7 @@ public class DefaultSecurityConstraints 
     /**
      * Creates a security constraints initialized with the specified classification.
      *
-     * @param classification The name of the handling restrictions on the resource.
+     * @param classification The name of the handling restrictions on the resource, or {@code null}.
      */
     public DefaultSecurityConstraints(final Classification classification) {
         this.classification = classification;

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,11 +13,79 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 package org.apache.sis.metadata.iso.content;
 
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.metadata.content.ContentInformation;
+import org.opengis.metadata.content.CoverageDescription;
+import org.opengis.metadata.content.FeatureCatalogueDescription;
 import org.apache.sis.metadata.iso.ISOMetadata;
 
+
+/**
+ * Description of the content of a dataset.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "AbstractMD_ContentInformation_Type")
+@XmlRootElement(name = "MD_ContentInformation")
+@XmlSeeAlso({
+    DefaultCoverageDescription.class,
+    DefaultFeatureCatalogueDescription.class
+})
 public class AbstractContentInformation extends ISOMetadata implements ContentInformation {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -1609535650982322560L;
+
+    /**
+     * Constructs an initially empty content information.
+     */
+    public AbstractContentInformation() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * <p>This method checks for the {@link CoverageDescription} and {@link FeatureCatalogueDescription}
+     * sub-interfaces. If one of those interfaces is found, then this method delegates to
+     * the corresponding {@code castOrCopy} static method. If the given object implements more
+     * than one of the above-cited interfaces, then the {@code castOrCopy} method to be used is
+     * unspecified.</p>
+     *
+     * @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 AbstractContentInformation castOrCopy(final ContentInformation object) {
+        if (object instanceof CoverageDescription) {
+            return DefaultCoverageDescription.castOrCopy((CoverageDescription) object);
+        }
+        if (object instanceof FeatureCatalogueDescription) {
+            return DefaultFeatureCatalogueDescription.castOrCopy((FeatureCatalogueDescription) object);
+        }
+        if (object == null || object instanceof AbstractContentInformation) {
+            return (AbstractContentInformation) object;
+        }
+        final AbstractContentInformation copy = new AbstractContentInformation();
+        copy.shallowCopy(object);
+        return copy;
+    }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,106 +13,426 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 package org.apache.sis.metadata.iso.content;
 
+import javax.measure.unit.Unit;
+import javax.measure.quantity.Length;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.metadata.content.Band;
 import org.opengis.metadata.content.BandDefinition;
 import org.opengis.metadata.content.PolarizationOrientation;
 import org.opengis.metadata.content.TransferFunctionType;
-import javax.measure.quantity.Length;
-import javax.measure.unit.Unit;
-
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.measure.ValueRange;
+import org.apache.sis.internal.jaxb.gco.GO_Real;
+
+
+/**
+ * Range of wavelengths in the electromagnetic spectrum.
+ *
+ * {@section SIS extension}
+ * The {@link Band} interface defined by ISO 19115-2 is specific to measurements in
+ * electromagnetic spectrum. For the needs of Image I/O, an additional interface -
+ * {@link org.apache.sis.image.io.metadata.SampleDimension} - has been defined with
+ * a subset of the {@code Band} API but without the restriction to wavelengths.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "MD_Band_Type", propOrder = {
+    "maxValue",
+    "minValue",
+    "units",
+    "peakResponse",
+    "bitsPerValue",
+    "toneGradation",
+    "scaleFactor",
+    "offset",
+    "bandBoundaryDefinition",
+    "nominalSpatialResolution",
+    "transferFunctionType",
+    "transmittedPolarization",
+    "detectedPolarization"
+})
+@XmlRootElement(name = "MD_Band")
+@XmlSeeAlso(org.apache.sis.internal.jaxb.gmi.MI_Band.class)
 public class DefaultBand extends DefaultRangeDimension implements Band {
-
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -3543010637264725421L;
+
+    /**
+     * Longest wavelength that the sensor is capable of collecting within a designated band.
+     */
     private Double maxValue;
 
+    /**
+     * Shortest wavelength that the sensor is capable of collecting within a designated band.
+     */
     private Double minValue;
 
-    private Double peakResponse;
-
+    /**
+     * Units in which sensor wavelengths are expressed. Should be non-null if
+     * {@linkplain #getMinValue() min value} or {@linkplain #getMaxValue() max value}
+     * are provided.
+     */
     private Unit<Length> units;
 
+    /**
+     * Wavelength at which the response is the highest.
+     */
+    private Double peakResponse;
+
+    /**
+     * Maximum number of significant bits in the uncompressed representation for the value
+     * in each band of each pixel.
+     */
     private Integer bitsPerValue;
 
+    /**
+     * Number of discrete numerical values in the grid data.
+     */
     private Integer toneGradation;
 
+    /**
+     * Scale factor which has been applied to the cell value.
+     */
     private Double scaleFactor;
 
+    /**
+     * The physical value corresponding to a cell value of zero.
+     */
     private Double offset;
 
+    /**
+     * Designation of criterion for defining maximum and minimum wavelengths for a spectral band.
+     */
     private BandDefinition bandBoundaryDefinition;
 
+    /**
+     * Smallest distance between which separate points can be distinguished, as specified in
+     * instrument design.
+     */
     private Double nominalSpatialResolution;
 
+    /**
+     * Type of transfer function to be used when scaling a physical value for a given element.
+     */
     private TransferFunctionType transferFunctionType;
 
+    /**
+     * Polarization of the radiation transmitted.
+     */
     private PolarizationOrientation transmittedPolarization;
 
+    /**
+     * Polarization of the radiation detected.
+     */
     private PolarizationOrientation detectedPolarization;
 
+    /**
+     * Constructs an initially empty band.
+     */
+    public DefaultBand() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * @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 DefaultBand castOrCopy(final Band object) {
+        if (object == null || object instanceof DefaultBand) {
+            return (DefaultBand) object;
+        }
+        final DefaultBand copy = new DefaultBand();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns the longest wavelength that the sensor is capable of collecting within
+     * a designated band.
+     */
     @Override
+    @XmlElement(name = "maxValue")
+    @XmlJavaTypeAdapter(GO_Real.class)
     public synchronized Double getMaxValue() {
         return maxValue;
     }
 
+    /**
+     * Sets the longest wavelength that the sensor is capable of collecting within a
+     * designated band.
+     *
+     * @param newValue The new longest wavelength.
+     */
+    public synchronized void setMaxValue(final Double newValue) {
+        checkWritePermission();
+        maxValue = newValue;
+    }
+
+    /**
+     * Returns the shortest wavelength that the sensor is capable of collecting
+     * within a designated band.
+     */
     @Override
+    @XmlElement(name = "minValue")
+    @XmlJavaTypeAdapter(GO_Real.class)
     public synchronized Double getMinValue() {
         return minValue;
     }
 
+    /**
+     * Sets the shortest wavelength that the sensor is capable of collecting within
+     * a designated band.
+     *
+     * @param newValue The new shortest wavelength.
+     */
+    public synchronized void setMinValue(final Double newValue) {
+        checkWritePermission();
+        minValue = newValue;
+    }
+
+    /**
+     * Returns the units in which sensor wavelengths are expressed. Should be non-null
+     * if {@linkplain #getMinValue() min value} or {@linkplain #getMaxValue() max value}
+     * are provided.
+     */
     @Override
-    public synchronized Double getPeakResponse() {
-        return peakResponse;
+    @XmlElement(name = "units")
+    public synchronized Unit<Length> getUnits() {
+        return units;
     }
 
+    /**
+     * Sets the units in which sensor wavelengths are expressed. Should be non-null if
+     * {@linkplain #getMinValue() min value} or {@linkplain #getMaxValue() max value}
+     * are provided.
+     *
+     * @param newValue The new units.
+     */
+    public synchronized void setUnits(final Unit<Length> newValue) {
+        checkWritePermission();
+        units = newValue;
+    }
+
+    /**
+     * Returns the wavelength at which the response is the highest.
+     */
     @Override
-    public synchronized Unit<Length> getUnits() {
-        return units;
+    @XmlElement(name = "peakResponse")
+    public synchronized Double getPeakResponse() {
+        return peakResponse;
     }
 
+    /**
+     * Sets the wavelength at which the response is the highest.
+     *
+     * @param newValue The new peak response.
+     */
+    public synchronized void setPeakResponse(final Double newValue) {
+        checkWritePermission();
+        peakResponse = newValue;
+    }
+
+    /**
+     * Returns the maximum number of significant bits in the uncompressed
+     * representation for the value in each band of each pixel.
+     */
     @Override
+    @ValueRange(minimum=1)
+    @XmlElement(name = "bitsPerValue")
     public synchronized Integer getBitsPerValue() {
         return bitsPerValue;
     }
 
+    /**
+     * Sets the maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
+     *
+     * @param newValue The new number of bits per value.
+     */
+    public synchronized void setBitsPerValue(final Integer newValue) {
+        checkWritePermission();
+        bitsPerValue = newValue;
+    }
+
+    /**
+     * Returns the number of discrete numerical values in the grid data.
+     */
     @Override
+    @ValueRange(minimum=0)
+    @XmlElement(name = "toneGradation")
     public synchronized Integer getToneGradation() {
         return toneGradation;
     }
 
+    /**
+     * Sets the number of discrete numerical values in the grid data.
+     *
+     * @param newValue The new tone gradation.
+     */
+    public synchronized void setToneGradation(final Integer newValue) {
+        checkWritePermission();
+        toneGradation = newValue;
+    }
+
+    /**
+     * Returns the scale factor which has been applied to the cell value.
+     */
     @Override
+    @XmlElement(name = "scaleFactor")
     public synchronized Double getScaleFactor() {
         return scaleFactor;
     }
 
+    /**
+     * Sets the scale factor which has been applied to the cell value.
+     *
+     * @param newValue The new scale factor.
+     */
+    public synchronized void setScaleFactor(final Double newValue) {
+        checkWritePermission();
+        scaleFactor = newValue;
+    }
+
+    /**
+     * Returns the physical value corresponding to a cell value of zero.
+     */
     @Override
+    @XmlElement(name = "offset")
     public synchronized Double getOffset() {
         return offset;
     }
 
+    /**
+     * Sets the physical value corresponding to a cell value of zero.
+     *
+     * @param newValue The new offset.
+     */
+    public synchronized void setOffset(final Double newValue) {
+        checkWritePermission();
+        offset = newValue;
+    }
+
+    /**
+     * Returns the designation of criterion for defining maximum and minimum wavelengths
+     * for a spectral band.
+     */
     @Override
+    @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
     public synchronized BandDefinition getBandBoundaryDefinition() {
         return bandBoundaryDefinition;
     }
 
+    /**
+     * Sets designation of criterion for defining maximum and minimum wavelengths
+     * for a spectral band.
+     *
+     * @param newValue The new band definition.
+     */
+    public synchronized void setBandBoundaryDefinition(final BandDefinition newValue) {
+        checkWritePermission();
+        bandBoundaryDefinition = newValue;
+    }
+
+    /**
+     * Returns the smallest distance between which separate points can be distinguished,
+     * as specified in instrument design.
+     */
     @Override
+    @ValueRange(minimum=0, isMinIncluded=false)
+    @XmlElement(name = "nominalSpatialResolution", namespace = Namespaces.GMI)
     public synchronized Double getNominalSpatialResolution() {
         return nominalSpatialResolution;
     }
 
+    /**
+     * Sets the smallest distance between which separate points can be distinguished,
+     * as specified in instrument design.
+     *
+     * @param newValue The new nominal spatial resolution.
+     */
+    public synchronized void setNominalSpatialResolution(final Double newValue) {
+        checkWritePermission();
+        nominalSpatialResolution = newValue;
+    }
+
+    /**
+     * Returns type of transfer function to be used when scaling a physical value for a given element.
+     */
     @Override
+    @XmlElement(name = "transferFunctionType", namespace = Namespaces.GMI)
     public synchronized TransferFunctionType getTransferFunctionType() {
         return transferFunctionType;
     }
 
+    /**
+     * Sets the type of transfer function to be used when scaling a physical value for a given element.
+     *
+     * @param newValue The new transfer function value.
+     */
+    public synchronized void setTransferFunctionType(final TransferFunctionType newValue) {
+        checkWritePermission();
+        transferFunctionType = newValue;
+    }
+
+    /**
+     * Polarization of the radiation transmitted.
+     */
     @Override
+    @XmlElement(name = "transmittedPolarization", namespace = Namespaces.GMI)
     public synchronized PolarizationOrientation getTransmittedPolarization() {
         return transmittedPolarization;
     }
 
+    /**
+     * Sets the polarization of the radiation transmitted.
+     *
+     * @param newValue The new transmitted polarization.
+     */
+    public synchronized void setTransmittedPolarization(final PolarizationOrientation newValue) {
+        checkWritePermission();
+        transmittedPolarization = newValue;
+    }
+
+    /**
+     * Polarization of the radiation detected.
+     */
     @Override
+    @XmlElement(name = "detectedPolarization", namespace = Namespaces.GMI)
     public synchronized PolarizationOrientation getDetectedPolarization() {
         return detectedPolarization;
     }
+
+    /**
+     * Sets the polarization of the radiation detected.
+     *
+     * @param newValue The new detected polarization.
+     */
+    public synchronized void setDetectedPolarization(final PolarizationOrientation newValue) {
+        checkWritePermission();
+        detectedPolarization = newValue;
+    }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,45 +13,179 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 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.metadata.content.CoverageContentType;
 import org.opengis.metadata.content.CoverageDescription;
+import org.opengis.metadata.content.ImageDescription;
 import org.opengis.metadata.content.RangeDimension;
 import org.opengis.metadata.content.RangeElementDescription;
 import org.opengis.util.RecordType;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.xml.Namespaces;
 
 
-public class DefaultCoverageDescription extends ISOMetadata implements CoverageDescription {
-
+/**
+ * Information about the content of a grid data cell.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "MD_CoverageDescription_Type", propOrder = {
+    "attributeDescription",
+    "contentType",
+    "dimensions",
+    "rangeElementDescriptions"
+})
+@XmlRootElement(name = "MD_CoverageDescription")
+@XmlSeeAlso({
+    DefaultImageDescription.class,
+    org.apache.sis.internal.jaxb.gmi.MI_CoverageDescription.class
+})
+public class DefaultCoverageDescription extends AbstractContentInformation implements CoverageDescription {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = 5943716957630930520L;
+
+    /**
+     * Description of the attribute described by the measurement value.
+     */
     private RecordType attributeDescription;
 
+    /**
+     * Type of information represented by the cell value.
+     */
     private CoverageContentType contentType;
 
+    /**
+     * Information on the dimensions of the cell measurement value.
+     */
     private Collection<RangeDimension> dimensions;
 
+    /**
+     * Provides the description of the specific range elements of a coverage.
+     */
     private Collection<RangeElementDescription> rangeElementDescriptions;
 
+    /**
+     * Constructs an empty coverage description.
+     */
+    public DefaultCoverageDescription() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * <p>This method checks for the {@link ImageDescription} sub-interface. If that interface is
+     * found, then this method delegates to the corresponding {@code castOrCopy} static method.</p>
+     *
+     * @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 DefaultCoverageDescription castOrCopy(final CoverageDescription object) {
+        if (object instanceof ImageDescription) {
+            return DefaultImageDescription.castOrCopy((ImageDescription) object);
+        }
+        if (object == null || object instanceof DefaultCoverageDescription) {
+            return (DefaultCoverageDescription) object;
+        }
+        final DefaultCoverageDescription copy = new DefaultCoverageDescription();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns the description of the attribute described by the measurement value.
+     */
     @Override
+    @XmlElement(name = "attributeDescription", required = true)
     public synchronized RecordType getAttributeDescription() {
         return attributeDescription;
     }
 
+    /**
+     * Sets the description of the attribute described by the measurement value.
+     *
+     * @param newValue The new attribute description.
+     */
+    public synchronized void setAttributeDescription(final RecordType newValue) {
+        checkWritePermission();
+        attributeDescription = newValue;
+    }
+
+    /**
+     * Returns the type of information represented by the cell value.
+     */
     @Override
+    @XmlElement(name = "contentType", required = true)
     public synchronized CoverageContentType getContentType() {
         return contentType;
     }
 
+    /**
+     * Sets the type of information represented by the cell value.
+     *
+     * @param newValue The new content type.
+     */
+    public synchronized void setContentType(final CoverageContentType newValue) {
+        checkWritePermission();
+        contentType = newValue;
+    }
+
+    /**
+     * Returns the information on the dimensions of the cell measurement value.
+     */
     @Override
+    @XmlElement(name = "dimension")
     public synchronized Collection<RangeDimension> getDimensions() {
-        return dimensions;
+        return dimensions = nonNullCollection(dimensions, RangeDimension.class);
     }
 
+    /**
+     * Sets the information on the dimensions of the cell measurement value.
+     *
+     * @param newValues The new dimensions.
+     */
+    public synchronized void setDimensions(final Collection<? extends RangeDimension> newValues) {
+        dimensions = copyCollection(newValues, dimensions, RangeDimension.class);
+    }
+
+    /**
+     * Provides the description of the specific range elements of a coverage.
+     *
+     * @return Description of the specific range elements of a coverage.
+     */
     @Override
+    @XmlElement(name = "rangeElementDescription", namespace = Namespaces.GMI)
     public synchronized Collection<RangeElementDescription> getRangeElementDescriptions() {
-        return rangeElementDescriptions;
+        return rangeElementDescriptions = nonNullCollection(rangeElementDescriptions, RangeElementDescription.class);
+    }
+
+    /**
+     * Sets the description of the specific range elements of a coverage.
+     *
+     * @param newValues The new range element description.
+     */
+    public synchronized void setRangeElementDescriptions(final Collection<? extends RangeElementDescription> newValues) {
+        rangeElementDescriptions = copyCollection(newValues, rangeElementDescriptions, RangeElementDescription.class);
     }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,51 +13,189 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 package org.apache.sis.metadata.iso.content;
 
-import java.util.Collection;
 import java.util.Locale;
+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.GenericName;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.content.FeatureCatalogueDescription;
-import org.opengis.util.GenericName;
 
+
+/**
+ * Information identifying the feature catalogue.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "MD_FeatureCatalogueDescription_Type", propOrder = {
+    "compliant",
+    "languages",
+    "includedWithDataset",
+    "featureTypes",
+    "featureCatalogueCitations"
+})
+@XmlRootElement(name = "MD_FeatureCatalogueDescription")
 public class DefaultFeatureCatalogueDescription extends AbstractContentInformation
         implements FeatureCatalogueDescription
 {
-
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = 1984922846251567908L;
+
+    /**
+     * Indication of whether or not the cited feature catalogue complies with ISO 19110.
+     */
     private Boolean compliant;
 
+    /**
+     * Language(s) used within the catalogue
+     */
     private Collection<Locale> languages;
 
+    /**
+     * Indication of whether or not the feature catalogue is included with the dataset.
+     */
     private boolean includedWithDataset;
 
+    /**
+     * Subset of feature types from cited feature catalogue occurring in dataset.
+     */
     private Collection<GenericName> featureTypes;
 
+    /**
+     * Complete bibliographic reference to one or more external feature catalogues.
+     */
     private Collection<Citation> featureCatalogueCitations;
 
+    /**
+     * Constructs an initially empty feature catalogue description.
+     */
+    public DefaultFeatureCatalogueDescription() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * @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 DefaultFeatureCatalogueDescription castOrCopy(final FeatureCatalogueDescription object) {
+        if (object == null || object instanceof DefaultFeatureCatalogueDescription) {
+            return (DefaultFeatureCatalogueDescription) object;
+        }
+        final DefaultFeatureCatalogueDescription copy = new DefaultFeatureCatalogueDescription();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns whether or not the cited feature catalogue complies with ISO 19110.
+     */
     @Override
+    @XmlElement(name = "complianceCode")
     public synchronized Boolean isCompliant() {
         return compliant;
     }
 
+    /**
+     * Sets whether or not the cited feature catalogue complies with ISO 19110.
+     *
+     * @param newValue The new compliance value.
+     */
+    public synchronized void setCompliant(final Boolean newValue) {
+        checkWritePermission();
+        compliant = newValue;
+    }
+
+    /**
+     * Returns the language(s) used within the catalogue
+     */
     @Override
+    @XmlElement(name = "language")
     public synchronized Collection<Locale> getLanguages() {
-        return languages;
+        return languages = nonNullCollection(languages, Locale.class);
     }
 
+    /**
+     * Sets the language(s) used within the catalogue
+     *
+     * @param newValues The new languages.
+     */
+    public synchronized void setLanguages(final Collection<? extends Locale> newValues) {
+        languages = copyCollection(newValues, languages, Locale.class);
+    }
+
+    /**
+     * Returns whether or not the feature catalogue is included with the dataset.
+     */
     @Override
+    @XmlElement(name = "includedWithDataset", required = true)
     public synchronized boolean isIncludedWithDataset() {
         return includedWithDataset;
     }
 
+    /**
+     * Sets whether or not the feature catalogue is included with the dataset.
+     *
+     * @param newValue {@code true} if the feature catalogue is included.
+     */
+    public synchronized void setIncludedWithDataset(final boolean newValue) {
+        checkWritePermission();
+        includedWithDataset = newValue;
+    }
+
+    /**
+     * Returns the subset of feature types from cited feature catalogue occurring in dataset.
+     */
     @Override
+    @XmlElement(name = "featureTypes")
     public synchronized Collection<GenericName> getFeatureTypes() {
-        return featureTypes;
+        return featureTypes = nonNullCollection(featureTypes, GenericName.class);
+    }
+
+    /**
+     * Sets the subset of feature types from cited feature catalogue occurring in dataset.
+     *
+     * @param newValues The new feature types.
+     */
+    public synchronized void setFeatureTypes(final Collection<? extends GenericName> newValues) {
+        featureTypes = copyCollection(newValues, featureTypes, GenericName.class);
     }
 
+    /**
+     * Returns the complete bibliographic reference to one or more external feature catalogues.
+     */
     @Override
+    @XmlElement(name = "featureCatalogueCitation", required = true)
     public synchronized Collection<Citation> getFeatureCatalogueCitations() {
-        return featureCatalogueCitations;
+        return featureCatalogueCitations = nonNullCollection(featureCatalogueCitations, Citation.class);
+    }
+
+    /**
+     * Sets the complete bibliographic reference to one or more external feature catalogues.
+     *
+     * @param newValues The feature catalogue citations.
+     */
+    public synchronized void setFeatureCatalogueCitations(final Collection<? extends Citation> newValues) {
+        featureCatalogueCitations = copyCollection(newValues, featureCatalogueCitations, Citation.class);
     }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,96 +13,391 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 package org.apache.sis.metadata.iso.content;
 
+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.metadata.Identifier;
 import org.opengis.metadata.content.ImageDescription;
 import org.opengis.metadata.content.ImagingCondition;
+import org.apache.sis.measure.ValueRange;
 
-public class DefaultImageDescription extends DefaultCoverageDescription implements ImageDescription {
 
+/**
+ * Information about an image's suitability for use.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "MD_ImageDescription_Type", propOrder = {
+    "illuminationElevationAngle",
+    "illuminationAzimuthAngle",
+    "imagingCondition",
+    "imageQualityCode",
+    "cloudCoverPercentage",
+    "processingLevelCode",
+    "compressionGenerationQuantity",
+    "triangulationIndicator",
+    "radiometricCalibrationDataAvailable",
+    "cameraCalibrationInformationAvailable",
+    "filmDistortionInformationAvailable",
+    "lensDistortionInformationAvailable"
+})
+@XmlRootElement(name = "MD_ImageDescription")
+@XmlSeeAlso(org.apache.sis.internal.jaxb.gmi.MI_ImageDescription.class)
+public class DefaultImageDescription extends DefaultCoverageDescription implements ImageDescription {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -6168624828802439062L;
+
+    /**
+     * Illumination elevation measured in degrees clockwise from the target plane
+     * at intersection of the optical line of sight with the Earth’s surface.
+     * For images from a scanning device, refer to the centre pixel of the image.
+     */
     private Double illuminationElevationAngle;
 
+    /**
+     * Illumination azimuth measured in degrees clockwise from true north at the time the image is taken.
+     * For images from a scanning device, refer to the centre pixel of the image.
+     */
     private Double illuminationAzimuthAngle;
 
+    /**
+     * Conditions affected the image.
+     */
     private ImagingCondition imagingCondition;
 
+    /**
+     * Specifies the image quality.
+     */
     private Identifier imageQualityCode;
 
+    /**
+     * Area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.
+     */
     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 the number of lossy compression cycles performed on the image.
+     */
     private Integer compressionGenerationQuantity;
 
+    /**
+     * Indication of whether or not triangulation has been performed upon the image.
+     */
     private Boolean triangulationIndicator;
 
+    /**
+     * Indication of whether or not the radiometric calibration information for generating the
+     * radiometrically calibrated standard data product is available.
+     */
     private Boolean radiometricCalibrationDataAvailable;
 
+    /**
+     * Indication of whether or not constants are available which allow for camera calibration
+     * corrections.
+     */
     private Boolean cameraCalibrationInformationAvailable;
 
+    /**
+     * Indication of whether or not Calibration Reseau information is available.
+     */
     private Boolean filmDistortionInformationAvailable;
 
+    /**
+     * Indication of whether or not lens aberration correction information is available.
+     */
     private Boolean lensDistortionInformationAvailable;
 
+    /**
+     * Constructs an initially empty image description.
+     */
+    public DefaultImageDescription() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * @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 DefaultImageDescription castOrCopy(final ImageDescription object) {
+        if (object == null || object instanceof DefaultImageDescription) {
+            return (DefaultImageDescription) object;
+        }
+        final DefaultImageDescription copy = new DefaultImageDescription();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns the illumination elevation measured in degrees clockwise from the target plane at
+     * intersection of the optical line of sight with the Earth's surface.
+     * For images from a scanning device, refer to the centre pixel of the image.
+     *
+     * <p>The horizon is at 0°, straight up has an elevation of 90°.</p>
+     */
     @Override
+    @ValueRange(minimum=0, maximum=180)
+    @XmlElement(name = "illuminationElevationAngle")
     public synchronized Double getIlluminationElevationAngle() {
         return illuminationElevationAngle;
     }
 
+    /**
+     * Sets the illumination elevation measured in degrees clockwise from the target plane at
+     * intersection of the optical line of sight with the Earth's surface. For images from a
+     * scanning device, refer to the centre pixel of the image.
+     *
+     * @param newValue The new illumination elevation angle.
+     */
+    public synchronized void setIlluminationElevationAngle(final Double newValue) {
+        checkWritePermission();
+        illuminationElevationAngle = newValue;
+    }
+
+    /**
+     * Returns the illumination azimuth measured in degrees clockwise from true north at the time
+     * the image is taken. For images from a scanning device, refer to the centre pixel of the
+     * image.
+     */
     @Override
+    @ValueRange(minimum=0, maximum=360)
+    @XmlElement(name = "illuminationAzimuthAngle")
     public synchronized Double getIlluminationAzimuthAngle() {
         return illuminationAzimuthAngle;
     }
 
+    /**
+     * Sets the illumination azimuth measured in degrees clockwise from true north at the time the
+     * image is taken. For images from a scanning device, refer to the centre pixel of the image.
+     *
+     * @param newValue The new illumination azimuth angle.
+     */
+    public synchronized void setIlluminationAzimuthAngle(final Double newValue) {
+        checkWritePermission();
+        illuminationAzimuthAngle = newValue;
+    }
+
+    /**
+     * Returns the conditions affected the image.
+     */
     @Override
+    @XmlElement(name = "imagingCondition")
     public synchronized ImagingCondition getImagingCondition() {
         return imagingCondition;
     }
 
+    /**
+     * Sets the conditions affected the image.
+     *
+     * @param newValue The new imaging condition.
+     */
+    public synchronized void setImagingCondition(final ImagingCondition newValue) {
+        checkWritePermission();
+        imagingCondition = newValue;
+    }
+
+    /**
+     * Returns the identifier that specifies the image quality.
+     */
     @Override
+    @XmlElement(name = "imageQualityCode")
     public synchronized Identifier getImageQualityCode() {
         return imageQualityCode;
     }
 
+    /**
+     * Sets the identifier that specifies the image quality.
+     *
+     * @param newValue The new image quality code.
+     */
+    public synchronized void setImageQualityCode(final Identifier newValue) {
+        checkWritePermission();
+        imageQualityCode = newValue;
+    }
+
+    /**
+     * Returns the area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.
+     */
     @Override
+    @ValueRange(minimum=0, maximum=100)
+    @XmlElement(name = "cloudCoverPercentage")
     public synchronized Double getCloudCoverPercentage() {
         return cloudCoverPercentage;
     }
 
+    /**
+     * Sets the area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.
+     *
+     * @param newValue The new cloud cover percentage.
+     */
+    public synchronized void setCloudCoverPercentage(final Double newValue) {
+        checkWritePermission();
+        cloudCoverPercentage = newValue;
+    }
+
+    /**
+     * Returns the image distributor's code that identifies the level of radiometric and geometric
+     * processing that has been applied.
+     */
     @Override
+    @XmlElement(name = "processingLevelCode")
     public synchronized Identifier getProcessingLevelCode() {
         return processingLevelCode;
     }
 
+    /**
+     * Sets the image distributor's code that identifies the level of radiometric and geometric
+     * processing that has been applied.
+     *
+     * @param newValue The new processing level code.
+     */
+    public synchronized void setProcessingLevelCode(final Identifier newValue) {
+        checkWritePermission();
+        processingLevelCode = newValue;
+    }
+
+    /**
+     * Returns the count of the number of lossy compression cycles performed on the image.
+     */
     @Override
+    @ValueRange(minimum=0)
+    @XmlElement(name = "compressionGenerationQuantity")
     public synchronized Integer getCompressionGenerationQuantity() {
         return compressionGenerationQuantity;
     }
 
+    /**
+     * Sets the count of the number the number of lossy compression cycles performed on the image.
+     *
+     * @param newValue The new compression generation quantity.
+     */
+    public synchronized void setCompressionGenerationQuantity(final Integer newValue) {
+        checkWritePermission();
+        compressionGenerationQuantity = newValue;
+    }
+
+    /**
+     * Returns the indication of whether or not triangulation has been performed upon the image.
+     */
     @Override
+    @XmlElement(name = "triangulationIndicator")
     public synchronized Boolean getTriangulationIndicator() {
         return triangulationIndicator;
     }
 
+    /**
+     * Sets the indication of whether or not triangulation has been performed upon the image.
+     *
+     * @param newValue The new triangulation indicator.
+     */
+    public synchronized void setTriangulationIndicator(final Boolean newValue) {
+        checkWritePermission();
+        triangulationIndicator = newValue;
+    }
+
+    /**
+     * Returns the indication of whether or not the radiometric calibration information for
+     * generating the radiometrically calibrated standard data product is available.
+     */
     @Override
+    @XmlElement(name = "radiometricCalibrationDataAvailability")
     public synchronized Boolean isRadiometricCalibrationDataAvailable() {
         return radiometricCalibrationDataAvailable;
     }
 
+    /**
+     * Sets the indication of whether or not the radiometric calibration information for generating
+     * the radiometrically calibrated standard data product is available.
+     *
+     * @param newValue {@code true} if radiometric calibration data are available.
+     */
+    public synchronized void setRadiometricCalibrationDataAvailable(final Boolean newValue) {
+        checkWritePermission();
+        radiometricCalibrationDataAvailable = newValue;
+    }
+
+    /**
+     * Returns the indication of whether or not constants are available which allow for camera
+     * calibration corrections.
+     */
     @Override
+    @XmlElement(name = "cameraCalibrationInformationAvailability")
     public synchronized Boolean isCameraCalibrationInformationAvailable() {
         return cameraCalibrationInformationAvailable;
     }
 
+    /**
+     * Sets the indication of whether or not constants are available which allow for camera
+     * calibration corrections.
+     *
+     * @param newValue {@code true} if camera calibration information are available.
+     */
+    public synchronized void setCameraCalibrationInformationAvailable(final Boolean newValue) {
+        checkWritePermission();
+        cameraCalibrationInformationAvailable = newValue;
+    }
+
+    /**
+     * Returns the indication of whether or not Calibration Reseau information is available.
+     */
     @Override
+    @XmlElement(name = "filmDistortionInformationAvailability")
     public synchronized Boolean isFilmDistortionInformationAvailable() {
         return filmDistortionInformationAvailable;
     }
 
+    /**
+     * Sets the indication of whether or not Calibration Reseau information is available.
+     *
+     * @param newValue {@code true} if film distortion information are available.
+     */
+    public synchronized void setFilmDistortionInformationAvailable(final Boolean newValue) {
+        checkWritePermission();
+        filmDistortionInformationAvailable = newValue;
+    }
+
+    /**
+     * Returns the indication of whether or not lens aberration correction information is available.
+     */
     @Override
+    @XmlElement(name = "lensDistortionInformationAvailability")
     public synchronized Boolean isLensDistortionInformationAvailable() {
         return lensDistortionInformationAvailable;
     }
+
+    /**
+     * Sets the indication of whether or not lens aberration correction information is available.
+     *
+     * @param newValue {@code true} if lens distortion information are available.
+     */
+    public synchronized void setLensDistortionInformationAvailable(final Boolean newValue) {
+        checkWritePermission();
+        lensDistortionInformationAvailable = newValue;
+    }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java?rev=1458861&r1=1458860&r2=1458861&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -13,27 +13,125 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
  */
 package org.apache.sis.metadata.iso.content;
 
-import org.opengis.metadata.content.RangeDimension;
-import org.opengis.util.InternationalString;
+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.content.RangeDimension;
+import org.opengis.metadata.content.Band;
 import org.apache.sis.metadata.iso.ISOMetadata;
 
-public class DefaultRangeDimension extends ISOMetadata implements RangeDimension {
 
+/**
+ * Information on the range of each dimension of a cell measurement value.
+ *
+ * @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
+ * @module
+ */
+@XmlType(name = "MD_RangeDimension_Type", propOrder = {
+    "sequenceIdentifier",
+    "descriptor"
+})
+@XmlRootElement(name = "MD_RangeDimension")
+@XmlSeeAlso(DefaultBand.class)
+public class DefaultRangeDimension extends ISOMetadata implements RangeDimension {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = 4365956866782010460L;
+
+    /**
+     * Number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
+     */
     private MemberName sequenceIdentifier;
 
+    /**
+     * Description of the range of a cell measurement value.
+     */
     private InternationalString descriptor;
 
+    /**
+     * Constructs an initially empty range dimension.
+     */
+    public DefaultRangeDimension() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * <p>This method checks for the {@link Band} sub-interface. If that interface is found,
+     * then this method delegates to the corresponding {@code castOrCopy} static method.</p>
+     *
+     * @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 DefaultRangeDimension castOrCopy(final RangeDimension object) {
+        if (object instanceof Band) {
+            return DefaultBand.castOrCopy((Band) object);
+        }
+        if (object == null || object instanceof DefaultRangeDimension) {
+            return (DefaultRangeDimension) object;
+        }
+        final DefaultRangeDimension copy = new DefaultRangeDimension();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns the number that uniquely identifies instances of bands of wavelengths
+     * on which a sensor operates.
+     */
     @Override
+    @XmlElement(name = "sequenceIdentifier")
     public synchronized MemberName getSequenceIdentifier() {
         return sequenceIdentifier;
     }
 
+    /**
+     * Sets the number that uniquely identifies instances of bands of wavelengths
+     * on which a sensor operates.
+     *
+     * @param newValue The new sequence identifier.
+     */
+    public synchronized void setSequenceIdentifier(final MemberName newValue) {
+        checkWritePermission();
+        sequenceIdentifier = newValue;
+    }
+
+    /**
+     * Returns the description of the range of a cell measurement value.
+     */
     @Override
+    @XmlElement(name = "descriptor")
     public synchronized InternationalString getDescriptor() {
         return descriptor;
     }
+
+    /**
+     * Sets the description of the range of a cell measurement value.
+     *
+     * @param newValue The new descriptor.
+     */
+    public synchronized void setDescriptor(final InternationalString newValue) {
+        checkWritePermission();
+        descriptor = newValue;
+    }
 }

Added: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java?rev=1458861&view=auto
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java (added)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
+ */
+package org.apache.sis.metadata.iso.content;
+
+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.Record;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.content.RangeElementDescription;
+import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * Description of specific range elements.
+ *
+ * @author  Cédric Briançon (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3 (derived from geotk-3.03)
+ * @version 0.3
+ * @module
+ */
+@XmlType(name = "MI_RangeElementDescription_Type", propOrder = {
+    "name",
+    "definition"/*,
+    "rangeElements"*/ // TODO: not yet supported.
+})
+@XmlRootElement(name = "MI_RangeElementDescription", namespace = Namespaces.GMI)
+public class DefaultRangeElementDescription extends ISOMetadata implements RangeElementDescription {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -2869953851390143207L;
+
+    /**
+     * Designation associated with a set of range elements.
+     */
+    private InternationalString name;
+
+    /**
+     * Description of a set of specific range elements.
+     */
+    private InternationalString definition;
+
+    /**
+     * Specific range elements, i.e. range elements associated with a name and their definition.
+     */
+    private Collection<Record> rangeElements;
+
+    /**
+     * Constructs an initially empty range element description.
+     */
+    public DefaultRangeElementDescription() {
+    }
+
+    /**
+     * Returns a SIS metadata implementation with the same values than the given arbitrary
+     * implementation. If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is
+     * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
+     * property values of the given object, using a <cite>shallow</cite> copy operation
+     * (i.e. properties are not cloned).
+     *
+     * @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 DefaultRangeElementDescription castOrCopy(final RangeElementDescription object) {
+        if (object == null || object instanceof DefaultRangeElementDescription) {
+            return (DefaultRangeElementDescription) object;
+        }
+        final DefaultRangeElementDescription copy = new DefaultRangeElementDescription();
+        copy.shallowCopy(object);
+        return copy;
+    }
+
+    /**
+     * Returns the designation associated with a set of range elements.
+     */
+    @Override
+    @XmlElement(name = "name", namespace = Namespaces.GMI, required = true)
+    public synchronized InternationalString getName() {
+        return name;
+    }
+
+    /**
+     * Sets the designation associated with a set of range elements.
+     *
+     * @param newValue The new name value.
+     */
+    public synchronized void setName(final InternationalString newValue) {
+        checkWritePermission();
+        name = newValue;
+    }
+
+    /**
+     * Returns the description of a set of specific range elements.
+     */
+    @Override
+    @XmlElement(name = "definition", namespace = Namespaces.GMI, required = true)
+    public synchronized InternationalString getDefinition() {
+        return definition;
+    }
+
+    /**
+     * Sets the description of a set of specific range elements.
+     *
+     * @param newValue The new definition value.
+     */
+    public synchronized void setDefinition(final InternationalString newValue) {
+        checkWritePermission();
+        definition = newValue;
+    }
+
+    /**
+     * Returns the specific range elements, i.e. range elements associated with a name
+     * and their definition.
+     *
+     * @todo implements {@link Record} in order to use the annotation.
+     */
+    @Override
+    //@XmlElement(name = "rangeElement", namespace = Namespaces.GMI, required = true)
+    public synchronized Collection<Record> getRangeElements() {
+        return rangeElements = nonNullCollection(rangeElements, Record.class);
+    }
+
+    /**
+     * Sets the specific range elements, i.e. range elements associated with a name and
+     * their definition.
+     *
+     * @param newValues The new range element values.
+     */
+    public synchronized void setRangeElements(final Collection<? extends Record> newValues) {
+        rangeElements = copyCollection(newValues, rangeElements, Record.class);
+    }
+}

Propchange: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1458861&view=auto
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java (added)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] Wed Mar 20 14:48:48 2013
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This package contains documentation from OGC specifications.
+ * Open Geospatial Consortium's work is fully acknowledged here.
+ */
+
+/**
+ * {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation Content information} implementation.
+ * An explanation for this package is provided in the {@linkplain org.opengis.metadata.content OpenGIS® javadoc}.
+ * The remaining discussion on this page is specific to the SIS implementation.
+ *
+ * {@section Overview}
+ * For a global overview of metadata in SIS, see the
+ * <a href="{@docRoot}/../sis-metadata/index.html">Metadata page on the project web site</a>.
+ *
+ * {@section Bands in gridded data}
+ * ISO 19115 defines a {@link org.opengis.metadata.content.Band} interface
+ * which expresses the range of wavelengths in the electromagnetic spectrum.
+ * For the needs of Image I/O, an additional interface has been defined with a subset
+ * of the {@code Band} API and the restriction to electromagnetic spectrum removed.
+ * That interface is named {@link org.apache.sis.image.io.metadata.SampleDimension}.
+ * Both {@code Band} and {@code SampleDimension} interfaces extend the same parent,
+ * {@link org.opengis.metadata.content.RangeDimension}.
+ *
+ * @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
+ * @module
+ */
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {
+    @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI),
+    @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
+    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
+    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+})
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlJavaTypeAdapters({
+    @XmlJavaTypeAdapter(CI_Citation.class),
+    @XmlJavaTypeAdapter(MD_CoverageContentTypeCode.class),
+    @XmlJavaTypeAdapter(MD_Identifier.class),
+    @XmlJavaTypeAdapter(MD_ImagingConditionCode.class),
+    @XmlJavaTypeAdapter(MD_RangeDimension.class),
+    @XmlJavaTypeAdapter(MI_BandDefinition.class),
+    @XmlJavaTypeAdapter(MI_PolarizationOrientationCode.class),
+    @XmlJavaTypeAdapter(MI_RangeElementDescription.class),
+    @XmlJavaTypeAdapter(MI_TransferFunctionTypeCode.class),
+
+    // Java types, primitive types and basic OGC types handling
+//  @XmlJavaTypeAdapter(UnitAdapter.class), // TODO
+    @XmlJavaTypeAdapter(LocaleAdapter.class),
+    @XmlJavaTypeAdapter(InternationalStringAdapter.class),
+    @XmlJavaTypeAdapter(GO_GenericName.class),
+//  @XmlJavaTypeAdapter(GO_RecordType.class), // TODO
+    @XmlJavaTypeAdapter(GO_Boolean.class),        @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class),
+    @XmlJavaTypeAdapter(GO_Decimal.class),        @XmlJavaTypeAdapter(type=double.class,  value=GO_Decimal.class),
+    @XmlJavaTypeAdapter(GO_Integer.class),        @XmlJavaTypeAdapter(type=int.class,     value=GO_Integer.class),
+    @XmlJavaTypeAdapter(GO_Integer.AsLong.class), @XmlJavaTypeAdapter(type=long.class,    value=GO_Integer.AsLong.class)
+})
+package org.apache.sis.metadata.iso.content;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.gco.*;
+import org.apache.sis.internal.jaxb.gmd.*;
+import org.apache.sis.internal.jaxb.code.*;
+import org.apache.sis.internal.jaxb.metadata.*;

Propchange: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8