sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1768246 [1/2] - in /sis/branches/JDK8: core/sis-utility/src/main/java/org/apache/sis/internal/simple/ core/sis-utility/src/test/java/org/apache/sis/test/mock/ storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/ storage/sis-xmls...
Date Sat, 05 Nov 2016 16:51:40 GMT
Author: desruisseaux
Date: Sat Nov  5 16:51:40 2016
New Revision: 1768246

URL: http://svn.apache.org/viewvc?rev=1768246&view=rev
Log:
Partial consolidation of GPX metadata.

Added:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java
      - copied, changed from r1768119, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Metadata.java
      - copied, changed from r1768245, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/MetaData.java
Removed:
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/MetaData.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java
Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Copyright.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXReader.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter100.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter110.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/package-info.java
    sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXReaderTest.java
    sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXWriterTest.java

Copied: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java (from r1768119, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java?p2=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java&p1=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java&r1=1768119&r2=1768246&rev=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java Sat Nov  5 16:51:40 2016
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.gpx;
+package org.apache.sis.internal.simple;
 
 import java.nio.charset.Charset;
 import java.util.Collection;
@@ -39,17 +39,7 @@ import org.opengis.metadata.content.Cont
 import org.opengis.metadata.distribution.Distribution;
 import org.opengis.metadata.distribution.Format;
 import org.opengis.metadata.extent.Extent;
-import org.opengis.metadata.identification.AggregateInformation;
-import org.opengis.metadata.identification.AssociatedResource;
-import org.opengis.metadata.identification.BrowseGraphic;
-import org.opengis.metadata.identification.CharacterSet;
-import org.opengis.metadata.identification.DataIdentification;
-import org.opengis.metadata.identification.Identification;
-import org.opengis.metadata.identification.Keywords;
-import org.opengis.metadata.identification.Progress;
-import org.opengis.metadata.identification.Resolution;
-import org.opengis.metadata.identification.TopicCategory;
-import org.opengis.metadata.identification.Usage;
+import org.opengis.metadata.identification.*;
 import org.opengis.metadata.lineage.Lineage;
 import org.opengis.metadata.maintenance.MaintenanceInformation;
 import org.opengis.metadata.maintenance.ScopeCode;
@@ -60,379 +50,740 @@ import org.opengis.referencing.Reference
 import org.opengis.temporal.Duration;
 import org.opengis.util.InternationalString;
 
+
 /**
- * Default simple metadata implementation.
+ * An empty implementation of ISO 19115 metadata for dataset (not for services).
+ * This simple implementation presumes that the metadata describes exactly one dataset,
+ * which is described by implementing methods from the {@link DataIdentification} interface.
+ * The identification information itself presumes that the dataset is referenced by exactly one citation.
+ *
+ * <p>Unless specified otherwise, all methods in this class returns {@code null} or an empty collection by default.
+ * The exceptions to this rules are the following methods:</p>
+ * <ul>
+ *   <li>{@link #getMetadataScopes()} returns {@code this}</li>
+ *   <li>{@link #getResourceScope()} returns {@link ScopeCode#DATASET}</li>
+ *   <li>{@link #getIdentificationInfo()} returns {@code this}</li>
+ *   <li>{@link #getCitation()} returns {@code this}</li>
+ *   <li>{@link #getSpatialRepresentationTypes()} returns {@link SpatialRepresentationType#VECTOR}</li>
+ *   <li>{@link #getTopicCategories()} returns {@link TopicCategory#LOCATION}</li>
+ *   <li>{@link #getPresentationForms()} returns {@link PresentationForm#TABLE_DIGITAL}</li>
+ * </ul>
+ *
+ * Subclasses are encouraged to override the following methods (typically with hard-coded values):
  *
- * @author Johann Sorel (Geomatys)
+ * <ul>
+ *   <li>{@link #getSpatialRepresentationTypes()} if the metadata describe gridded data instead than vector data.</li>
+ *   <li>{@link #getTopicCategories()} if the data represent something else than locations.</li>
+ *   <li>{@link #getResourceFormats()} with a hard-coded value provided by the data store implementation.</li>
+ *   <li>{@link #getPresentationForms()} if the data represent something else than tabular data.</li>
+ * </ul>
+ *
+ * @author  Johann Sorel (Geomatys)
  * @since   0.8
  * @version 0.8
  * @module
  */
-public class SimpleMetadata implements Metadata, DataIdentification, Citation {
+public class SimpleMetadata implements Metadata, MetadataScope, DataIdentification, Citation {
+    /**
+     * Creates a new metadata object.
+     */
+    protected SimpleMetadata() {
+    }
 
+    /**
+     * Unique identifier for this metadata record.
+     */
     @Override
     public Identifier getMetadataIdentifier() {
         return null;
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataIdentifier()}
+     *             in order to include the codespace attribute.
+     */
     @Override
+    @Deprecated
     public String getFileIdentifier() {
         return null;
     }
 
+    /**
+     * Language(s) used for documenting metadata.
+     * Also the language(s) used within the data.
+     */
     @Override
     public Collection<Locale> getLanguages() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of GeoAPI 3.1, replaced by {@link #getLanguages()}.
+     */
     @Override
+    @Deprecated
     public Locale getLanguage() {
         return null;
     }
 
+    /**
+     * @deprecated As of GeoAPI 3.1, replaced by {@link #getLanguages()}.
+     */
     @Override
+    @Deprecated
     public Collection<Locale> getLocales() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptySet();
     }
 
+    /**
+     * The character coding standard used for the metadata set.
+     * Also the character coding standard(s) used for the dataset.
+     */
     @Override
     public Collection<Charset> getCharacterSets() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of GeoAPI 3.1, replaced by {@link #getCharacterSets()}.
+     */
     @Override
+    @Deprecated
     public CharacterSet getCharacterSet() {
         return null;
     }
 
+    /**
+     * Identification of the parent metadata record.
+     */
     @Override
     public Citation getParentMetadata() {
         return null;
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getParentMetadata()}.
+     */
     @Override
+    @Deprecated
     public String getParentIdentifier() {
         return null;
     }
 
+    /**
+     * The scope or type of resource for which metadata is provided.
+     * This method returns {@code this} for allowing call to {@link #getResourceScope()}.
+     *
+     * @see #getResourceScope()
+     * @see #getName()
+     */
     @Override
-    public Collection<? extends MetadataScope> getMetadataScopes() {
-        return Collections.EMPTY_LIST;
+    public Collection<MetadataScope> getMetadataScopes() {
+        return Collections.singleton(this);
     }
 
+    /**
+     * Code for the metadata scope, fixed to {@link ScopeCode#DATASET} by default. This is part of the information
+     * provided by {@link #getMetadataScopes()}. The {@code DATASET} default value is consistent with the fact that
+     * {@code SimpleMetadata} implements {@link DataIdentification}.
+     */
     @Override
+    public ScopeCode getResourceScope() {
+        return ScopeCode.DATASET;
+    }
+
+    /**
+     * Description of the metadata scope.
+     * This is part of the information provided by {@link #getMetadataScopes()}.
+     */
+    @Override
+    public InternationalString getName() {
+        return null;
+    }
+
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}
+     *             followed by {@link MetadataScope#getResourceScope()}.
+     */
+    @Override
+    @Deprecated
     public Collection<ScopeCode> getHierarchyLevels() {
-        return Collections.EMPTY_LIST;
+        return Collections.singleton(getResourceScope());
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}
+     *             followed by {@link MetadataScope#getName()}.
+     */
     @Override
+    @Deprecated
     public Collection<String> getHierarchyLevelNames() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptySet();
     }
 
+    /**
+     * Parties responsible for the metadata information.
+     */
     @Override
-    public Collection<? extends Responsibility> getContacts() {
-        return Collections.EMPTY_LIST;
+    public Collection<Responsibility> getContacts() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Date(s) associated with the metadata.
+     */
     @Override
-    public Collection<? extends CitationDate> getDateInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<CitationDate> getDateInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getDateInfo()}.
+     */
     @Override
+    @Deprecated
     public Date getDateStamp() {
         return null;
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataStandards()}
+     *             followed by {@link Citation#getTitle()}.
+     */
     @Override
+    @Deprecated
     public String getMetadataStandardName() {
         return null;
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataStandards()}
+     *             followed by {@link Citation#getEdition()}.
+     */
     @Override
+    @Deprecated
     public String getMetadataStandardVersion() {
         return null;
     }
 
+    /**
+     * Citation(s) for the standard(s) to which the metadata conform.
+     */
     @Override
-    public Collection<? extends Citation> getMetadataStandards() {
-        return Collections.EMPTY_LIST;
+    public Collection<Citation> getMetadataStandards() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Citation(s) for the profile(s) of the metadata standard to which the metadata conform.
+     */
     @Override
-    public Collection<? extends Citation> getMetadataProfiles() {
-        return Collections.EMPTY_LIST;
+    public Collection<Citation> getMetadataProfiles() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Reference(s) to alternative metadata or metadata in a non-ISO standard for the same resource.
+     */
     @Override
-    public Collection<? extends Citation> getAlternativeMetadataReferences() {
-        return Collections.EMPTY_LIST;
+    public Collection<Citation> getAlternativeMetadataReferences() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Online location(s) where the metadata is available.
+     */
     @Override
-    public Collection<? extends OnlineResource> getMetadataLinkages() {
-        return Collections.EMPTY_LIST;
+    public Collection<OnlineResource> getMetadataLinkages() {
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getIdentificationInfo()} followed by
+     *    {@link Identification#getCitation()} followed by {@link Citation#getOnlineResources()}.
+     */
     @Override
+    @Deprecated
     public String getDataSetUri() {
         return null;
     }
 
+    /**
+     * Digital representation of spatial information in the dataset.
+     */
     @Override
-    public Collection<? extends SpatialRepresentation> getSpatialRepresentationInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<SpatialRepresentation> getSpatialRepresentationInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Description of the spatial and temporal reference systems used in the dataset.
+     */
     @Override
-    public Collection<? extends ReferenceSystem> getReferenceSystemInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<ReferenceSystem> getReferenceSystemInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information describing metadata extensions.
+     */
     @Override
-    public Collection<? extends MetadataExtensionInformation> getMetadataExtensionInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<MetadataExtensionInformation> getMetadataExtensionInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Basic information about the resource(s) to which the metadata applies.
+     * This method returns {@code this} for allowing call to {@link #getCitation()}.
+     * and other methods.
+     *
+     * @see #getCitation()
+     * @see #getAbstract()
+     * @see #getPointOfContacts()
+     * @see #getSpatialRepresentationTypes()
+     * @see #getSpatialResolutions()
+     * @see #getTemporalResolutions()
+     * @see #getTopicCategories()
+     * @see #getExtents()
+     * @see #getResourceFormats()
+     * @see #getDescriptiveKeywords()
+     */
     @Override
-    public Collection<? extends Identification> getIdentificationInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<DataIdentification> getIdentificationInfo() {
+        return Collections.singleton(this);
     }
 
+    /**
+     * Information about the feature and coverage characteristics.
+     */
     @Override
-    public Collection<? extends ContentInformation> getContentInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<ContentInformation> getContentInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about the distributor of and options for obtaining the resource(s).
+     */
     @Override
-    public Collection<? extends Distribution> getDistributionInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<Distribution> getDistributionInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Overall assessment of quality of a resource(s).
+     */
     @Override
-    public Collection<? extends DataQuality> getDataQualityInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<DataQuality> getDataQualityInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about the catalogue of rules defined for the portrayal of a resource(s).
+     */
     @Override
-    public Collection<? extends PortrayalCatalogueReference> getPortrayalCatalogueInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<PortrayalCatalogueReference> getPortrayalCatalogueInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Restrictions on the access and use of data.
+     */
     @Override
-    public Collection<? extends Constraints> getMetadataConstraints() {
-        return Collections.EMPTY_LIST;
+    public Collection<Constraints> getMetadataConstraints() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about the conceptual schema of a dataset.
+     */
     @Override
-    public Collection<? extends ApplicationSchemaInformation> getApplicationSchemaInfo() {
-        return Collections.EMPTY_LIST;
+    public Collection<ApplicationSchemaInformation> getApplicationSchemaInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about the acquisition of the data.
+     */
     @Override
-    public Collection<? extends AcquisitionInformation> getAcquisitionInformation() {
-        return Collections.EMPTY_LIST;
+    public Collection<AcquisitionInformation> getAcquisitionInformation() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about the frequency of metadata updates, and the scope of those updates.
+     */
     @Override
     public MaintenanceInformation getMetadataMaintenance() {
         return null;
     }
 
+    /**
+     * Information about the provenance, sources and/or the production processes applied to the resource.
+     */
     @Override
-    public Collection<? extends Lineage> getResourceLineages() {
-        return Collections.EMPTY_LIST;
+    public Collection<Lineage> getResourceLineages() {
+        return Collections.emptySet();
     }
 
-    @Override
-    public InternationalString getEnvironmentDescription() {
-        return null;
-    }
 
-    @Override
-    public InternationalString getSupplementalInformation() {
-        return null;
-    }
+    /* -------------------------------------------------------------------------------------------------
+     * Implementation of the DataIdentification object returned by Metadata.getIdentificationInfo().
+     * ------------------------------------------------------------------------------------------------- */
 
+    /**
+     * Citation for the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     * This method returns {@code this} for allowing call to {@link #getTitle()} and other methods.
+     */
     @Override
     public Citation getCitation() {
-        return null;
+        return this;
     }
 
+    /**
+     * Brief narrative summary of the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
     public InternationalString getAbstract() {
         return null;
     }
 
+    /**
+     * Summary of the intentions with which the resource was developed.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
     public InternationalString getPurpose() {
         return null;
     }
 
-    @Override
-    public Collection<? extends InternationalString> getCredits() {
-        return Collections.EMPTY_LIST;
+    /**
+     * Recognition of those who contributed to the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
+    @Override
+    public Collection<InternationalString> getCredits() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Status of the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
     public Collection<Progress> getStatus() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptySet();
     }
 
+    /**
+     * Identification of, and means of communication with, person(s) and organisations associated with the resource(s).
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Responsibility> getPointOfContacts() {
-        return Collections.EMPTY_LIST;
+    public Collection<Responsibility> getPointOfContacts() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Methods used to spatially represent geographic information.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     * Default implementation returns {@link SpatialRepresentationType#VECTOR}.
+     * Subclasses should override this method if they represent gridded data instead than vector data.
+     */
     @Override
     public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {
-        return Collections.EMPTY_LIST;
+        return Collections.singleton(SpatialRepresentationType.VECTOR);
     }
 
+    /**
+     * Factor which provides a general understanding of the density of spatial data in the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Resolution> getSpatialResolutions() {
-        return Collections.EMPTY_LIST;
+    public Collection<Resolution> getSpatialResolutions() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Smallest resolvable temporal period in a resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Duration> getTemporalResolutions() {
-        return Collections.EMPTY_LIST;
+    public Collection<Duration> getTemporalResolutions() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Main theme(s) of the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     * Default implementation returns {@link TopicCategory#LOCATION}.
+     * Subclasses should override this method if they represent other kind of data.
+     */
     @Override
     public Collection<TopicCategory> getTopicCategories() {
-        return Collections.EMPTY_LIST;
+        return Collections.singleton(TopicCategory.LOCATION);
     }
 
+    /**
+     * Spatial and temporal extent of the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Extent> getExtents() {
-        return Collections.EMPTY_LIST;
+    public Collection<Extent> getExtents() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Other documentation associated with the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Citation> getAdditionalDocumentations() {
-        return Collections.EMPTY_LIST;
+    public Collection<Citation> getAdditionalDocumentations() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Code that identifies the level of processing in the producers coding system of a resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
     public Identifier getProcessingLevel() {
         return null;
     }
 
+    /**
+     * Information about the frequency of resource updates, and the scope of those updates.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends MaintenanceInformation> getResourceMaintenances() {
-        return Collections.EMPTY_LIST;
+    public Collection<MaintenanceInformation> getResourceMaintenances() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Graphic that illustrates the resource(s) (should include a legend for the graphic).
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends BrowseGraphic> getGraphicOverviews() {
-        return Collections.EMPTY_LIST;
+    public Collection<BrowseGraphic> getGraphicOverviews() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Description of the format of the resource(s).
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Format> getResourceFormats() {
-        return Collections.EMPTY_LIST;
+    public Collection<Format> getResourceFormats() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Category keywords, their type, and reference source.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Keywords> getDescriptiveKeywords() {
-        return Collections.EMPTY_LIST;
+    public Collection<Keywords> getDescriptiveKeywords() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Basic information about specific application(s) for which the resource(s)
+     * has/have been or is being used by different users.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Usage> getResourceSpecificUsages() {
-        return Collections.EMPTY_LIST;
+    public Collection<Usage> getResourceSpecificUsages() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Information about constraints which apply to the resource(s).
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends Constraints> getResourceConstraints() {
-        return Collections.EMPTY_LIST;
+    public Collection<Constraints> getResourceConstraints() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Associated resource information.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends AssociatedResource> getAssociatedResources() {
-        return Collections.EMPTY_LIST;
+    public Collection<AssociatedResource> getAssociatedResources() {
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getAssociatedResources()}.
+     */
     @Override
-    public Collection<? extends AggregateInformation> getAggregationInfo() {
-        return Collections.EMPTY_LIST;
+    @Deprecated
+    public Collection<AggregateInformation> getAggregationInfo() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Description of the resource in the producer's processing environment, including items
+     * such as the software, the computer operating system, file name, and the dataset size.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public InternationalString getTitle() {
+    public InternationalString getEnvironmentDescription() {
         return null;
     }
 
+    /**
+     * Any other descriptive information about the resource.
+     * This is part of the information returned by {@link #getIdentificationInfo()}.
+     */
     @Override
-    public Collection<? extends InternationalString> getAlternateTitles() {
-        return Collections.EMPTY_LIST;
+    public InternationalString getSupplementalInformation() {
+        return null;
     }
 
+
+    /* -------------------------------------------------------------------------------------------------
+     * Implementation of the Citation object returned by DataIdentification.getCitation().
+     * ------------------------------------------------------------------------------------------------- */
+
+    /**
+     * Name by which the cited resource is known.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Collection<? extends CitationDate> getDates() {
-        return Collections.EMPTY_LIST;
+    public InternationalString getTitle() {
+        return null;
     }
 
+    /**
+     * Short names or other language names by which the cited information is known.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public InternationalString getEdition() {
-        return null;
+    public Collection<InternationalString> getAlternateTitles() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Reference dates for the cited resource.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Date getEditionDate() {
-        return null;
+    public Collection<CitationDate> getDates() {
+        return Collections.emptySet();
     }
 
+    /**
+     * Version of the cited resource.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Collection<? extends Identifier> getIdentifiers() {
-        return Collections.EMPTY_LIST;
+    public InternationalString getEdition() {
+        return null;
     }
 
+    /**
+     * Date of the edition.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Collection<? extends Responsibility> getCitedResponsibleParties() {
-        return Collections.EMPTY_LIST;
+    public Date getEditionDate() {
+        return null;
     }
 
+    /**
+     * Unique identifier for the resource.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
+    @Override
+    public Collection<Identifier> getIdentifiers() {
+        return Collections.emptySet();
+    }
+
+    /**
+     * Role, name, contact and position information for individuals or organisations
+     * that are responsible for the resource.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
+    @Override
+    public Collection<Responsibility> getCitedResponsibleParties() {
+        return Collections.emptySet();
+    }
+
+    /**
+     * Mode in which the resource is represented.
+     * This is part of the information returned by {@link #getCitation()}.
+     * Default implementation returns {@link PresentationForm#TABLE_DIGITAL}.
+     * Subclasses should override this method if they represent other kind of data.
+     */
     @Override
     public Collection<PresentationForm> getPresentationForms() {
-        return Collections.EMPTY_LIST;
+        return Collections.singleton(PresentationForm.TABLE_DIGITAL);
     }
 
+    /**
+     * Information about the series, or aggregate dataset, of which the dataset is a part.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
     public Series getSeries() {
         return null;
     }
 
+    /**
+     * Other information required to complete the citation that is not recorded elsewhere.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Collection<? extends InternationalString> getOtherCitationDetails() {
-        return Collections.EMPTY_LIST;
+    public Collection<InternationalString> getOtherCitationDetails() {
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated Removed as of ISO 19115:2014.
+     */
     @Override
+    @Deprecated
     public InternationalString getCollectiveTitle() {
         return null;
     }
 
+    /**
+     * International Standard Book Number.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
     public String getISBN() {
         return null;
     }
 
+    /**
+     * International Standard Serial Number.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
     public String getISSN() {
         return null;
     }
 
+    /**
+     * Online references to the cited resource.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
+    @Override
+    public Collection<OnlineResource> getOnlineResources() {
+        return Collections.emptySet();
+    }
+
+    /**
+     * Citation graphics or logo for cited party.
+     * This is part of the information returned by {@link #getCitation()}.
+     */
     @Override
-    public Collection<? extends OnlineResource> getOnlineResources() {
-        return Collections.EMPTY_LIST;
+    public Collection<BrowseGraphic> getGraphics() {
+        return Collections.emptySet();
     }
-
-    @Override
-    public Collection<? extends BrowseGraphic> getGraphics() {
-        return Collections.EMPTY_LIST;
-    }
-
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -24,8 +24,9 @@
  * may change in incompatible ways in any future version without notice.
  *
  * @author  Martin Desruisseaux (Geomatys)
+ * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 package org.apache.sis.internal.simple;

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -16,37 +16,15 @@
  */
 package org.apache.sis.test.mock;
 
-import java.util.Date;
 import java.util.Locale;
 import java.util.Collection;
 import java.util.Collections;
-import java.nio.charset.Charset;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.opengis.metadata.Identifier;
 import org.opengis.metadata.Metadata;
-import org.opengis.metadata.MetadataScope;
-import org.opengis.metadata.MetadataExtensionInformation;
-import org.opengis.metadata.ApplicationSchemaInformation;
-import org.opengis.metadata.PortrayalCatalogueReference;
-import org.opengis.metadata.acquisition.AcquisitionInformation;
-import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.citation.CitationDate;
-import org.opengis.metadata.citation.OnlineResource;
-import org.opengis.metadata.citation.Responsibility;
-import org.opengis.metadata.constraint.Constraints;
-import org.opengis.metadata.content.ContentInformation;
-import org.opengis.metadata.distribution.Distribution;
-import org.opengis.metadata.identification.CharacterSet;
-import org.opengis.metadata.identification.Identification;
-import org.opengis.metadata.maintenance.MaintenanceInformation;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.metadata.quality.DataQuality;
-import org.opengis.metadata.lineage.Lineage;
-import org.opengis.metadata.spatial.SpatialRepresentation;
-import org.opengis.referencing.ReferenceSystem;
 import org.apache.sis.internal.jaxb.gmd.LocaleAdapter;
+import org.apache.sis.internal.simple.SimpleMetadata;
 import org.apache.sis.xml.Namespaces;
 
 
@@ -59,7 +37,7 @@ import org.apache.sis.xml.Namespaces;
  * @module
  */
 @XmlRootElement(name = "MD_Metadata", namespace = Namespaces.GMD)
-public final strictfp class MetadataMock implements Metadata {
+public final strictfp class MetadataMock extends SimpleMetadata {
     /**
      * The language used for documenting metadata.
      */
@@ -85,25 +63,6 @@ public final strictfp class MetadataMock
     }
 
     /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Identifier getMetadataIdentifier() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getFileIdentifier() {
-        return null;
-    }
-
-    /**
      * Returns {@link #language} in a singleton set or an empty set.
      *
      * @return {@link #language}
@@ -123,292 +82,4 @@ public final strictfp class MetadataMock
     public Locale getLanguage() {
         return language;
     }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<Locale> getLocales() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<Charset> getCharacterSets() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public CharacterSet getCharacterSet() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Citation getParentMetadata() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getParentIdentifier() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends MetadataScope> getMetadataScopes() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<ScopeCode> getHierarchyLevels() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<String> getHierarchyLevelNames() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Responsibility> getContacts() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends CitationDate> getDateInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Date getDateStamp() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getMetadataStandards() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getMetadataStandardName() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getMetadataStandardVersion() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getMetadataProfiles() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getAlternativeMetadataReferences() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends OnlineResource> getMetadataLinkages() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getDataSetUri() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends SpatialRepresentation> getSpatialRepresentationInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ReferenceSystem> getReferenceSystemInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends MetadataExtensionInformation> getMetadataExtensionInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Identification> getIdentificationInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ContentInformation> getContentInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Distribution> getDistributionInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends DataQuality> getDataQualityInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends PortrayalCatalogueReference> getPortrayalCatalogueInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Constraints> getMetadataConstraints() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ApplicationSchemaInformation> getApplicationSchemaInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public MaintenanceInformation getMetadataMaintenance() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends AcquisitionInformation> getAcquisitionInformation() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Lineage> getResourceLineages() {
-        return null;
-    }
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Copyright.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Copyright.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Copyright.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Copyright.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -51,9 +51,9 @@ import org.opengis.util.InternationalStr
  * This element provides 3 properties:
  *
  * <ul>
- *   <li>The {@linkplaon #author}, which is the only mandatory property.</li>
+ *   <li>The {@linkplain #author}, which is the only mandatory property.</li>
  *   <li>The copyright {@linkplain #year} (optional).</li>
- *   <li>An URI to the license (optional).</li>
+ *   <li>An URI to the {@linkplain #license} (optional).</li>
  * </ul>
  *
  * Those properties can be read or modified directly. All methods defined in this class are bridges to
@@ -487,13 +487,10 @@ public final class Copyright implements
      * Compares this {@code Copyright} with the given object for equality.
      *
      * @param  obj  the object to compare with this {@code Copyright}.
-     * @return {@code true} if both object are equal.
+     * @return {@code true} if both objects are equal.
      */
     @Override
     public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
         if (obj instanceof Copyright) {
             final Copyright that = (Copyright) obj;
             return Objects.equals(this.author,  that.author) &&
@@ -515,6 +512,13 @@ public final class Copyright implements
 
     /**
      * Returns a string representation of the copyright statement.
+     * The statement is formatted in a way similar to the copyright statements found in file header.
+     * Example:
+     *
+     * <blockquote>
+     * Copyright 2016 John Smith
+     * http://john.smith.com
+     * </blockquote>
      *
      * @return a string representation of the copyright statement.
      */

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXReader.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXReader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXReader.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -71,7 +71,7 @@ import static org.apache.sis.internal.gp
  */
 public class GPXReader extends StaxStreamReader {
 
-    private MetaData metadata;
+    private Metadata metadata;
     private Feature current;
     private int wayPointInc = 0;
     private int routeInc = 0;
@@ -116,14 +116,14 @@ public class GPXReader extends StaxStrea
                         if(version == GPXVersion.v1_0_0){
                             baseNamespace = GPX_NAMESPACE_V10;
                             //we wont found a metadata tag, must read the tags here.
-                            metadata = parseMetaData100();
+                            metadata = parseMetadata100();
                             break searchLoop;
                         }else{
                             baseNamespace = GPX_NAMESPACE_V11;
                         }
 
                     }else if(TAG_METADATA.equalsIgnoreCase(typeName)){
-                        metadata = parseMetaData110();
+                        metadata = parseMetadata110();
                         break searchLoop;
                     }else if(  TAG_WPT.equalsIgnoreCase(typeName)
                             || TAG_TRK.equalsIgnoreCase(typeName)
@@ -152,7 +152,7 @@ public class GPXReader extends StaxStrea
      *
      * @return Metadata or null if input is not set.
      */
-    public MetaData getMetadata() {
+    public Metadata getMetadata() {
         return metadata;
     }
 
@@ -234,12 +234,12 @@ public class GPXReader extends StaxStrea
      * Parse current metadata element.
      * The stax reader must be placed to the start element of the metadata.
      *
-     * @return MetaData
+     * @return Metadata
      */
-    private MetaData parseMetaData100() throws IOException, XMLStreamException {
+    private Metadata parseMetadata100() throws IOException, XMLStreamException {
         final XMLStreamReader reader = getReader();
 
-        final MetaData metadata = new MetaData();
+        final Metadata metadata = new Metadata();
 
         searchLoop:
         while (reader.hasNext()) {
@@ -253,11 +253,11 @@ public class GPXReader extends StaxStrea
                     }else if(TAG_DESC.equalsIgnoreCase(localName)) {
                         metadata.description = reader.getElementText();
                     }else if(TAG_AUTHOR.equalsIgnoreCase(localName)) {
-                        if(metadata.person == null) metadata.person = new Person();
-                        metadata.person.name = reader.getElementText();
+                        if(metadata.author == null) metadata.author = new Person();
+                        metadata.author.name = reader.getElementText();
                     }else if(TAG_AUTHOR_EMAIL.equalsIgnoreCase(localName)) {
-                        if(metadata.person == null) metadata.person = new Person();
-                        metadata.person.email = reader.getElementText();
+                        if(metadata.author == null) metadata.author = new Person();
+                        metadata.author.email = reader.getElementText();
                     }else if(TAG_URL.equalsIgnoreCase(localName)){
                         try {
                             metadata.links.add(new URI(reader.getElementText()));
@@ -289,11 +289,11 @@ public class GPXReader extends StaxStrea
      * Parse current metadata element.
      * The stax reader must be placed to the start element of the metadata.
      *
-     * @return MetaData
+     * @return Metadata
      */
-    private MetaData parseMetaData110() throws IOException, XMLStreamException {
+    private Metadata parseMetadata110() throws IOException, XMLStreamException {
         final XMLStreamReader reader = getReader();
-        final MetaData metadata = new MetaData();
+        final Metadata metadata = new Metadata();
 
         while (reader.hasNext()) {
             final int type = reader.next();
@@ -306,9 +306,9 @@ public class GPXReader extends StaxStrea
                     }else if(TAG_DESC.equalsIgnoreCase(localName)){
                         metadata.description = reader.getElementText();
                     }else if(TAG_AUTHOR.equalsIgnoreCase(localName)){
-                        metadata.person = parsePerson();
+                        metadata.author = parsePerson();
                     }else if(TAG_COPYRIGHT.equalsIgnoreCase(localName)){
-                        metadata.copyRight = parseCopyright();
+                        metadata.copyright = parseCopyright();
                     }else if(TAG_LINK.equalsIgnoreCase(localName)){
                         metadata.links.add(parseLink());
                     }else if(TAG_METADATA_TIME.equalsIgnoreCase(localName)){

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter100.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter100.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter100.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter100.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -125,7 +125,7 @@ public class GPXWriter100 extends StaxSt
      * @param tracks can be null
      * @throws XMLStreamException if underlying xml stax writer encounter an error
      */
-    public void write(final MetaData metadata, final Collection<? extends Feature> wayPoints,
+    public void write(final Metadata metadata, final Collection<? extends Feature> wayPoints,
             final Collection<? extends Feature> routes, final Collection<? extends Feature> tracks) throws XMLStreamException {
 
         writeGPXTag();
@@ -203,13 +203,13 @@ public class GPXWriter100 extends StaxSt
      * @param metadata no null
      * @throws XMLStreamException if underlying xml stax writer encounter an error
      */
-    public void write(final MetaData metadata) throws XMLStreamException {
+    public void write(final Metadata metadata) throws XMLStreamException {
         writeSimpleTag(namespace, TAG_NAME, metadata.name);
         writeSimpleTag(namespace, TAG_DESC, metadata.description);
 
-        if (metadata.person != null) {
-            writeSimpleTag(namespace, TAG_AUTHOR, metadata.person.name);
-            writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, metadata.person.email);
+        if (metadata.author != null) {
+            writeSimpleTag(namespace, TAG_AUTHOR, metadata.author.name);
+            writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, metadata.author.email);
         }
 
         //model is based on 1.1 so not all attributs can be written

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter110.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter110.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter110.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXWriter110.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -58,12 +58,12 @@ public class GPXWriter110 extends GPXWri
      * @throws XMLStreamException if underlying xml stax writer encounter an error
      */
     @Override
-    public void write(final MetaData metadata) throws XMLStreamException {
+    public void write(final Metadata metadata) throws XMLStreamException {
         writer.writeStartElement(namespace, TAG_METADATA);
         writeSimpleTag(namespace, TAG_NAME, metadata.name);
         writeSimpleTag(namespace, TAG_DESC, metadata.description);
-        writePerson(metadata.person);
-        writeCopyright(metadata.copyRight);
+        writePerson(metadata.author);
+        writeCopyright(metadata.copyright);
         for (URI uri : metadata.links) {
             writeLink(uri);
         }

Copied: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Metadata.java (from r1768245, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/MetaData.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Metadata.java?p2=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Metadata.java&p1=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/MetaData.java&r1=1768245&r2=1768246&rev=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/MetaData.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Metadata.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.internal.gpx;
 
-import java.io.IOException;
-import java.io.StringWriter;
 import java.net.URI;
 import java.time.Instant;
 import java.time.temporal.Temporal;
@@ -28,14 +26,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 import java.util.logging.Level;
-import org.apache.sis.io.TableAppender;
-import org.apache.sis.metadata.iso.DefaultIdentifier;
-import org.apache.sis.metadata.iso.citation.DefaultCitationDate;
-import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
-import org.apache.sis.metadata.iso.extent.DefaultExtent;
-import org.apache.sis.metadata.iso.identification.DefaultKeywords;
-import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.util.logging.Logging;
+import javax.xml.bind.annotation.XmlElement;
 
 import org.opengis.geometry.Envelope;
 import org.opengis.metadata.Identifier;
@@ -49,27 +40,103 @@ import org.opengis.metadata.identificati
 import org.opengis.referencing.operation.TransformException;
 import org.opengis.util.InternationalString;
 
+import org.apache.sis.internal.simple.SimpleMetadata;
+import org.apache.sis.io.TableAppender;
+import org.apache.sis.metadata.iso.DefaultIdentifier;
+import org.apache.sis.metadata.iso.citation.DefaultCitationDate;
+import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
+import org.apache.sis.metadata.iso.extent.DefaultExtent;
+import org.apache.sis.metadata.iso.identification.DefaultKeywords;
+import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.util.logging.Logging;
+
+
 /**
- * Metadata object as defined in GPX.
+ * Information about the GPX file, author, and copyright restrictions.
+ * This is the root of the {@code <metadata>} element in a GPX file.
+ * At most one such element may appear in the document.
+ * The XML content is like below:
  *
- * @author Johann Sorel (Geomatys)
- * @since   0.7
+ * {@preformat java
+ *   <metadata>
+ *     <name> String </name>
+ *     <desc> String </desc>
+ *     <author> Person </author>
+ *     <copyright> Copyright </copyright>
+ *     <link> URI </link>
+ *     <time> Temporal </time>
+ *     <keywords> String </keywords>
+ *     <bounds> Envelope </bounds>
+ *     <extensions> (ignored) </extensions>
+ *   </metadata>
+ * }
+ *
+ * Those properties can be read or modified directly. All methods defined in this class are bridges to
+ * the ISO 19115 metadata model and can be ignored if the user only wants to manipulate the GPX model.
+ *
+ * @author  Johann Sorel (Geomatys)
+ * @since   0.8
  * @version 0.8
  * @module
  */
-public class MetaData extends SimpleMetadata {
-
+public final class Metadata extends SimpleMetadata {
+    /**
+     * The name of the GPX file.
+     */
+    @XmlElement
     public String name;
+
+    /**
+     * A description of the contents of the GPX file.
+     */
+    @XmlElement(name = "desc")
     public String description;
-    public Person person;
-    public Copyright copyRight;
+
+    /**
+     * The person or organization who created the GPX file.
+     */
+    @XmlElement
+    public Person author;
+
+    /**
+     * Copyright and license information governing use of the file.
+     */
+    @XmlElement
+    public Copyright copyright;
+
+    /**
+     * URLs associated with the location described in the file.
+     */
+    @XmlElement(name = "link")
     public final List<URI> links = new ArrayList<>();
+
+    /**
+     * The creation date of the file.
+     */
+    @XmlElement
     public Temporal time;
+
+    /**
+     * Keywords associated with the file.
+     * Search engines or databases can use this information to classify the data.
+     */
+    @XmlElement
     public String keywords;
+
+    /**
+     * Minimum and maximum coordinates which describe the extent of the coordinates in the file.
+     */
+    @XmlElement
     public Envelope bounds;
 
+    /**
+     * Creates an initially empty metadata object.
+     */
+    public Metadata() {
+    }
+
     @Override
-    public Collection<? extends Identifier> getIdentifiers() {
+    public Collection<Identifier> getIdentifiers() {
         if (name != null) {
             return Collections.singleton(new DefaultIdentifier(name));
         }
@@ -85,7 +152,7 @@ public class MetaData extends SimpleMeta
     }
 
     @Override
-    public Collection<? extends Keywords> getDescriptiveKeywords() {
+    public Collection<Keywords> getDescriptiveKeywords() {
         if (keywords != null) {
             return Collections.singleton(new DefaultKeywords(keywords));
         }
@@ -93,23 +160,23 @@ public class MetaData extends SimpleMeta
     }
 
     @Override
-    public Collection<? extends Responsibility> getPointOfContacts() {
-        if (person != null) {
-            return Collections.singletonList(person);
+    public Collection<Responsibility> getPointOfContacts() {
+        if (author != null) {
+            return Collections.singletonList(author);
         }
         return super.getPointOfContacts();
     }
 
     @Override
-    public Collection<? extends Constraints> getResourceConstraints() {
-        if (copyRight != null) {
-            return Collections.singleton(copyRight);
+    public Collection<Constraints> getResourceConstraints() {
+        if (copyright != null) {
+            return Collections.singleton(copyright);
         }
         return super.getResourceConstraints();
     }
 
     @Override
-    public Collection<? extends Extent> getExtents() {
+    public Collection<Extent> getExtents() {
         if (bounds != null) {
             final DefaultExtent ext = new DefaultExtent();
             try {
@@ -123,7 +190,7 @@ public class MetaData extends SimpleMeta
     }
 
     @Override
-    public Collection<? extends OnlineResource> getOnlineResources() {
+    public Collection<OnlineResource> getOnlineResources() {
         if (!links.isEmpty()) {
             final List<OnlineResource> resources = new ArrayList<>();
             for (URI uri : links) {
@@ -135,7 +202,7 @@ public class MetaData extends SimpleMeta
     }
 
     @Override
-    public Collection<? extends CitationDate> getDates() {
+    public Collection<CitationDate> getDates() {
         if (time != null) {
             final CitationDate date = new DefaultCitationDate(Date.from(Instant.from(time)), DateType.CREATION);
             return Collections.singleton(date);
@@ -143,102 +210,84 @@ public class MetaData extends SimpleMeta
         return super.getDates();
     }
 
-    @Override
-    public String toString() {
-        final StringWriter writer = new StringWriter();
-        final TableAppender tablewriter = new TableAppender(writer);
-
-        tablewriter.appendHorizontalSeparator();
-        tablewriter.append("GPX-Metadata\t \n");
-        tablewriter.appendHorizontalSeparator();
-
-        tablewriter.append("Name\t"+name+"\n");
-        tablewriter.append("Desc\t"+description+"\n");
-        tablewriter.append("Time\t"+time+"\n");
-        tablewriter.append("Keywords\t"+keywords+"\n");
-        tablewriter.append("Bounds\t"+bounds+"\n");
-
-        if(person != null){
-            tablewriter.append("Person - Name\t"+person.name+"\n");
-            tablewriter.append("Person - EMail\t"+person.email+"\n");
-            tablewriter.append("Person - Link\t"+person.link+"\n");
-        }else{
-            tablewriter.append("Person\t"+person+"\n");
-        }
-
-        if(copyRight != null){
-            tablewriter.append("Copyright - Author\t"+copyRight.author+"\n");
-            tablewriter.append("Copyright - Year\t"+copyRight.year+"\n");
-            tablewriter.append("Copyright - License\t"+copyRight.license+"\n");
-        }else{
-            tablewriter.append("Copyright\t"+copyRight+"\n");
-        }
-
-        tablewriter.append("Links\t");
-        if(links.isEmpty()){
-            tablewriter.append("None\n");
-        }else{
-            tablewriter.append("\n");
-            for(final URI uri : links){
-                tablewriter.append("\t"+uri+"\n");
-            }
-        }
-
-        tablewriter.appendHorizontalSeparator();
-
-        try {
-            tablewriter.flush();
-            writer.flush();
-        } catch (IOException ex) {
-            //will never happen is this case
-            ex.printStackTrace();
-        }
-
-        return writer.getBuffer().toString();
-    }
-
+    /**
+     * Compares this {@code Metadata} with the given object for equality.
+     *
+     * @param  obj  the object to compare with this {@code Metadata}.
+     * @return {@code true} if both objects are equal.
+     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final MetaData other = (MetaData) obj;
-        if (!Objects.equals(this.name, other.name)) {
-            return false;
-        }
-        if (!Objects.equals(this.description, other.description)) {
-            return false;
-        }
-        if (!Objects.equals(this.keywords, other.keywords)) {
-            return false;
-        }
-        if (!Objects.equals(this.person, other.person)) {
-            return false;
-        }
-        if (!Objects.equals(this.copyRight, other.copyRight)) {
-            return false;
-        }
-        if (!Objects.equals(this.links, other.links)) {
-            return false;
-        }
-        if (!Objects.equals(this.time, other.time)) {
-            return false;
-        }
-        if (!Objects.equals(this.bounds, other.bounds)) {
-            return false;
-        }
-        return true;
-    }
-
+        if (obj instanceof Metadata) {
+            final Metadata that = (Metadata) obj;
+            return Objects.equals(this.name,        that.name)        &&
+                   Objects.equals(this.description, that.description) &&
+                   Objects.equals(this.author,      that.author)      &&
+                   Objects.equals(this.copyright,   that.copyright)   &&
+                   Objects.equals(this.links,       that.links)       &&
+                   Objects.equals(this.time,        that.time)        &&
+                   Objects.equals(this.keywords,    that.keywords)    &&
+                   Objects.equals(this.bounds,      that.bounds);
+        }
+        return false;
+    }
+
+    /**
+     * Returns a hash code value for this {@code Metadata}.
+     *
+     * @return a hash code value.
+     */
     @Override
     public int hashCode() {
-        return 43;
+        return Objects.hash(name, description, author, copyright, links, time, keywords, bounds);
     }
 
+    /**
+     * Returns a string representation of this metadata object.
+     *
+     * @return a string representation of this metadata.
+     */
+    @Override
+    public String toString() {
+        final TableAppender table = new TableAppender();
+        table.setMultiLinesCells(true);
+        table.appendHorizontalSeparator();
+        table.append("GPX metadata").nextLine();
+        table.appendHorizontalSeparator();
+        append(table, "Name",        name);
+        append(table, "Description", description);
+        append(table, "Author",      author);
+        append(table, "Copyright",   copyright);
+        String label = "link";
+        for (final URI uri : links) {
+            append(table, label, uri);
+            label = null;
+        }
+        append(table, "Time",     time);
+        append(table, "Keywords", keywords);
+        append(table, "Bounds",   bounds);
+        table.append("Links\t");
+        table.appendHorizontalSeparator();
+        return table.toString();
+    }
+
+    /**
+     * Appends a row to the given table if the given value is non-null.
+     *
+     * @param  table  the table where to append a row.
+     * @param  label  the label, or {@code null} if none.
+     * @param  value  the value, or {@code null} if none.
+     */
+    private static void append(final TableAppender table, final String label, final Object value) {
+        if (value != null) {
+            if (label != null) {
+                table.append(label).append(':');
+            }
+            table.nextColumn();
+            table.append(value.toString()).nextLine();
+        }
+    }
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -20,6 +20,7 @@ import java.net.URI;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Objects;
+import java.util.Set;
 import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.opengis.metadata.citation.Address;
@@ -32,172 +33,359 @@ import org.opengis.metadata.citation.Tel
 import org.opengis.metadata.extent.Extent;
 import org.opengis.util.InternationalString;
 
+
 /**
- * Person object as defined in GPX.
+ * Information about a person or organization.
+ * This element provides 3 optional properties:
+ *
+ * <ul>
+ *   <li>The {@linkplain #name}.</li>
+ *   <li>The person {@linkplain #email}.</li>
+ *   <li>An URI to other information about the person or organization.</li>
+ * </ul>
+ *
+ * Those properties can be read or modified directly. All methods defined in this class are bridges to
+ * the ISO 19115 metadata model and can be ignored if the user only wants to manipulate the GPX model.
  *
- * @author Johann Sorel (Geomatys)
- * @since   0.7
+ * <p>Note that {@link Party} is an abstract type in ISO 19115 model. We are supposed to implement a subtype
+ * ({@link org.opengis.metadata.citation.Individual} or {@link org.opengis.metadata.citation.Organisation}).
+ * However the GPX metadata does not specifies whether the "person" is actually an individual or an organization.
+ * In this situation of doubt, we do not select a subtype for avoiding to provide a wrong information.</p>
+ *
+ * @author  Johann Sorel (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.8
  * @version 0.8
  * @module
  */
-public class Person implements Party, Contact, Address, Responsibility {
-
+public final class Person implements Responsibility, Party, Contact, Address {
+    /**
+     * Name of person or organization.
+     *
+     * @see #getName()
+     */
     public String name;
+
+    /**
+     * Email address.
+     *
+     * @see #getElectronicMailAddresses()
+     */
     public String email;
+
+    /**
+     * Link to Web site or other external information about person.
+     *
+     * @see #getOnlineResources()
+     */
     public URI link;
 
+    /**
+     * Creates a new initially empty instance.
+     */
+    public Person() {
+    }
+
+    /**
+     * ISO 19115 metadata property fixed to {@link Role#ORIGINATOR}.
+     *
+     * @return function performed by the responsible party.
+     */
+    @Override
+    public Role getRole() {
+        return Role.ORIGINATOR;
+    }
+
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return spatial or temporal extent of the role.
+     */
+    @Override
+    public Collection<Extent> getExtents() {
+        return Collections.emptyList();
+    }
+
+    /**
+     * ISO 19115 metadata property determined by the {@link #name}, {@link #email} and {@link #link} fields.
+     * Invoking this method is one of the steps in the path from the {@code Responsibility} root to the
+     * {@link #getName()}, {@link #getElectronicMailAddresses()} and {@link #getOnlineResources()} methods.
+     *
+     * @return information about the parties.
+     *
+     * @see #getName()
+     * @see #getContactInfo()
+     */
+    @Override
+    public Collection<Party> getParties() {
+        return thisOrEmpty(this, name != null || email != null || link != null);
+    }
+
+
+    /* ---------------------------------------------------------------------------------
+     * Implementation of the Party object returned by Responsibility.getParties().
+     * Contains information about 'name', 'email' and 'link'.
+     * --------------------------------------------------------------------------------- */
+
+    /**
+     * ISO 19115 metadata property determined by the {@link #name} field.
+     *
+     * @return name of the party, or {@code null} if none.
+     */
+    @Override
+    public InternationalString getName() {
+        return (name != null) ? new SimpleInternationalString(name) : null;
+    }
+
+    /**
+     * ISO 19115 metadata property determined by the {@link #email} and {@link #link} fields.
+     * Invoking this method is one of the steps in the path from the {@code Responsibility} root
+     * to the {@link #getElectronicMailAddresses()} and {@link #getOnlineResources()} methods.
+     *
+     * @return contact information for the party.
+     *
+     * @see #getAddresses()
+     * @see #getOnlineResources()
+     */
     @Override
     public Collection<Contact> getContactInfo() {
-        return Collections.singleton(this);
+        return thisOrEmpty(this, email != null || link != null);
     }
 
+
+    /* ---------------------------------------------------------------------------------
+     * Implementation of the Contact object returned by Party.getContactInfo().
+     * Contains information about 'email' and 'link' only (not 'name').
+     * --------------------------------------------------------------------------------- */
+
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return telephone numbers at which the organization or individual may be contacted.
+     */
     @Override
     public Collection<Telephone> getPhones() {
         return Collections.emptyList();
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getPhones()}.
+     */
     @Override
+    @Deprecated
     public Telephone getPhone() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property determined by the {@link #email} field.
+     * Invoking this method is one of the steps in the path from the {@code Responsibility} root
+     * to the {@link #getElectronicMailAddresses()} method.
+     *
+     * @return physical and email addresses at which the organization or individual may be contacted.
+     *
+     * @see #getElectronicMailAddresses()
+     */
     @Override
     public Collection<Address> getAddresses() {
-        return Collections.singleton(this);
+        return thisOrEmpty(this, email != null);
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getAddresses()}.
+     */
     @Override
+    @Deprecated
     public Address getAddress() {
-        return this;
+        return (email != null) ? this : null;
     }
 
+    /**
+     * ISO 19115 metadata property determined by the {@link #link} field.
+     *
+     * @return on-line information that can be used to contact the individual or organization.
+     */
     @Override
     public Collection<OnlineResource> getOnlineResources() {
-        if (link!=null) {
+        if (link != null) {
             return Collections.singleton(new DefaultOnlineResource(link));
         }
-        return Collections.emptyList();
+        return Collections.emptySet();
     }
 
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getOnlineResources()}.
+     */
     @Override
+    @Deprecated
     public OnlineResource getOnlineResource() {
-        if (link!=null) {
-            return new DefaultOnlineResource(link);
-        }
-        return null;
+        return (link != null) ? new DefaultOnlineResource(link) : null;
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return time period when individuals can contact the organization or individual.
+     */
     @Override
     public Collection<InternationalString> getHoursOfService() {
         return Collections.emptyList();
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return supplemental instructions on how or when to contact the individual or organization.
+     */
     @Override
     public InternationalString getContactInstructions() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return type of the contact.
+     */
     @Override
     public InternationalString getContactType() {
         return null;
     }
 
-    @Override
-    public InternationalString getName() {
-        if (name!=null) {
-            return new SimpleInternationalString(name);
-        }
-        return null;
-    }
 
+    /* ---------------------------------------------------------------------------------
+     * Implementation of the Address object returned by Contact.getAddresses().
+     * Contains information about 'email' only (not 'name' or 'link').
+     * --------------------------------------------------------------------------------- */
+
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return address line for the location.
+     */
     @Override
     public Collection<InternationalString> getDeliveryPoints() {
         return Collections.emptyList();
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return the city of the location.
+     */
     @Override
     public InternationalString getCity() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return state, province of the location.
+     */
     @Override
     public InternationalString getAdministrativeArea() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return ZIP or other postal code, or {@code null}.
+     */
     @Override
     public String getPostalCode() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property not specified by GPX.
+     *
+     * @return country of the physical address, or {@code null}.
+     */
     @Override
     public InternationalString getCountry() {
         return null;
     }
 
+    /**
+     * ISO 19115 metadata property determined by the {@link #email} field.
+     *
+     * @return address of the electronic mailbox of the responsible organization or individual.
+     */
     @Override
     public Collection<String> getElectronicMailAddresses() {
         if (email != null) {
             return Collections.singleton(email);
         }
-        return Collections.emptyList();
+        return Collections.emptySet();
     }
 
     /**
-     * ISO 19115 metadata property fixed to {@link Role#ORIGINATOR}.
+     * Returns the given object as a singleton if the given condition is {@code true},
+     * or an empty set if the given condition is {@code false}.
      *
-     * @return function performed by the responsible party.
+     * @param  obj  the object (usually {@code this}) to return in a singleton if the condition is true.
      */
-    @Override
-    public Role getRole() {
-        return Role.ORIGINATOR;
+    private static <T> Set<T> thisOrEmpty(final T obj, final boolean condition) {
+        return condition ? Collections.singleton(obj) : Collections.emptySet();
     }
 
+    /**
+     * Compares this {@code Person} with the given object for equality.
+     *
+     * @param  obj  the object to compare with this {@code Person}.
+     * @return {@code true} if both objects are equal.
+     */
     @Override
-    public Collection<Extent> getExtents() {
-        return Collections.emptyList();
+    public boolean equals(final Object obj) {
+        if (obj instanceof Person) {
+            final Person that = (Person) obj;
+            return Objects.equals(this.name,  that.name) &&
+                   Objects.equals(this.email, that.email) &&
+                   Objects.equals(this.link,  that.link);
+        }
+        return false;
     }
 
+    /**
+     * Returns a hash code value for this {@code Person}.
+     *
+     * @return a hash code value.
+     */
     @Override
-    public Collection<Party> getParties() {
-        return Collections.singleton(this);
+    public int hashCode() {
+        return Objects.hash(name, email, link);
     }
 
+    /**
+     * Returns a string representation of this person statement.
+     * The statement is formatted in a way similar to the email address in client softwares.
+     * Example:
+     *
+     * <blockquote>
+     * John Smith {@literal <john.smith@somewhere.com>}
+     * http://john.smith.com
+     * </blockquote>
+     *
+     * @return a string representation of this person.
+     */
     @Override
     public String toString() {
-        final StringBuilder sb = new StringBuilder("Person(");
-        sb.append(name).append(',').append(email).append(',').append(link);
-        sb.append(')');
-        return sb.toString();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
+        final StringBuilder sb = new StringBuilder();
+        if (name != null) {
+            sb.append(name);
         }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final Person other = (Person) obj;
-        if (!Objects.equals(this.name, other.name)) {
-            return false;
-        }
-        if (!Objects.equals(this.email, other.email)) {
-            return false;
+        if (email != null) {
+            if (sb.length() != 0) sb.append(' ');
+            sb.append('<').append(email).append('>');
         }
-        if (!Objects.equals(this.link, other.link)) {
-            return false;
+        if (link != null) {
+            if (sb.length() != 0) {
+                sb.append(System.lineSeparator());
+            }
+            sb.append(link);
         }
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        return 45;
+        return sb.toString();
     }
-
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/package-info.java?rev=1768246&r1=1768245&r2=1768246&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/package-info.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/package-info.java [UTF-8] Sat Nov  5 16:51:40 2016
@@ -22,7 +22,7 @@
  * Example (from Wikipedia):
  *
  * {@preformat xml
- *   <gpx>
+ *   <gpx version="1.1" creator="Oregon 400t">
  *     <metadata>
  *       <link href="http://www.garmin.com">
  *         <text>Garmin International</text>
@@ -49,6 +49,12 @@
  *   </gpx>
  * }
  *
+ * The GPX 1.1 specification enforces the following conventions:
+ * <ul>
+ *   <li>All coordinates are relative to the WGS84 datum.</li>
+ *   <li>All measurements are in metric units.</li>
+ * </ul>
+ *
  * @see <a href="https://en.wikipedia.org/wiki/GPS_Exchange_Format">GPS Exchange Format on Wikipedia</a>
  * @see <a href="http://www.topografix.com/GPX/1/1/">GPX 1.1 Schema Documentation</a>
  *
@@ -57,4 +63,11 @@
  * @version 0.8
  * @module
  */
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = GPXConstants.GPX_NAMESPACE_V11, xmlns = {
+    @XmlNs(prefix = "gpx", namespaceURI = GPXConstants.GPX_NAMESPACE_V11)
+})
 package org.apache.sis.internal.gpx;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;



Mime
View raw message