sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject svn commit: r1754280 - in /sis/branches/JDK8/storage/sis-xmlstore/src: main/java/org/apache/sis/internal/gpx/ test/java/org/apache/sis/internal/gpx/
Date Wed, 27 Jul 2016 15:23:21 GMT
Author: jsorel
Date: Wed Jul 27 15:23:20 2016
New Revision: 1754280

URL: http://svn.apache.org/viewvc?rev=1754280&view=rev
Log:
Make GPX metadata implement ISO Metadata, add TestSuite class

Added:
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java
    sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXTestSuite.java
      - copied, changed from r1753972, sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/test/suite/ShapefileTestSuite.java
Modified:
    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/GPXConstants.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/MetaData.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Person.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

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=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -17,74 +17,207 @@
 package org.apache.sis.internal.gpx;
 
 import java.net.URI;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
 import java.util.Objects;
+import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
+import org.apache.sis.util.iso.SimpleInternationalString;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.Contact;
+import org.opengis.metadata.citation.DateType;
+import org.opengis.metadata.citation.OnlineResource;
+import org.opengis.metadata.citation.Party;
+import org.opengis.metadata.citation.PresentationForm;
+import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.Role;
+import org.opengis.metadata.citation.Series;
+import org.opengis.metadata.constraint.LegalConstraints;
+import org.opengis.metadata.constraint.Releasability;
+import org.opengis.metadata.constraint.Restriction;
+import org.opengis.metadata.extent.Extent;
+import org.opengis.metadata.identification.BrowseGraphic;
+import org.opengis.metadata.maintenance.Scope;
+import org.opengis.util.InternationalString;
 
 /**
  * Copyright object as defined in GPX.
  * 
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
-public class CopyRight {
+public class CopyRight implements LegalConstraints, Responsibility, Party, Citation, CitationDate {
 
-    private String author;
-    private Integer year;
-    private URI license;
-
-    /**
-     * Returns the author value.
-     *
-     * @return author, may be null
-     */
-    public String getAuthor() {
-        return author;
-    }
-
-    /**
-     * Set author value.
-     *
-     * @param author, can be null
-     */
-    public void setAuthor(String author) {
-        this.author = author;
-    }
-
-    /**
-     * Returns the copyright year.
-     *
-     * @return copyright year, may be null
-     */
-    public Integer getYear() {
-        return year;
-    }
-
-    /**
-     * Set copyright year value.
-     *
-     * @param year, can be null
-     */
-    public void setYear(Integer year) {
-        this.year = year;
-    }
-
-    /**
-     * Returns the license URI.
-     *
-     * @return license, may be null
-     */
-    public URI getLicense() {
-        return license;
-    }
-
-    /**
-     * Set license URI.
-     *
-     * @param license, can be null
-     */
-    public void setLicense(URI license) {
-        this.license = license;
+    public String author;
+    public Integer year;
+    public URI license;
+
+    @Override
+    public Collection<Restriction> getAccessConstraints() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<Restriction> getUseConstraints() {
+        if (license!=null) {
+            return Arrays.asList(Restriction.LICENCE,Restriction.COPYRIGHT);
+        } else {
+            return Collections.singleton(Restriction.COPYRIGHT);
+        }
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getOtherConstraints() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getUseLimitations() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Scope getConstraintApplicationScope() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends BrowseGraphic> getGraphics() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Citation> getReferences() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public Releasability getReleasability() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getResponsibleParties() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public InternationalString getTitle() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getAlternateTitles() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends CitationDate> getDates() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public InternationalString getEdition() {
+        return null;
+    }
+
+    @Override
+    public Date getEditionDate() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Identifier> getIdentifiers() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getCitedResponsibleParties() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<PresentationForm> getPresentationForms() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Series getSeries() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getOtherCitationDetails() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getCollectiveTitle() {
+        return null;
+    }
+
+    @Override
+    public String getISBN() {
+        return null;
+    }
+
+    @Override
+    public String getISSN() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends OnlineResource> getOnlineResources() {
+        if (license != null) {
+            return Collections.singleton(new DefaultOnlineResource(license));
+        }
+        return null;
+    }
+
+    @Override
+    public Date getDate() {
+        if (year != null) {
+            return new Date(year, 0, 0);
+        }
+        return null;
+    }
+
+    @Override
+    public DateType getDateType() {
+        return DateType.IN_FORCE;
+    }
+
+    @Override
+    public Role getRole() {
+        return Role.OWNER;
+    }
+
+    @Override
+    public Collection<? extends Extent> getExtents() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Party> getParties() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public InternationalString getName() {
+        if (author != null){
+            return new SimpleInternationalString(author);
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Contact> getContactInfo() {
+        return Collections.EMPTY_LIST;
     }
 
     @Override
@@ -123,5 +256,5 @@ public class CopyRight {
     public int hashCode() {
         return 44;
     }
-
+    
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java?rev=1754280&r1=1754279&r2=1754280&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java [UTF-8] Wed Jul 27 15:23:20 2016
@@ -35,6 +35,7 @@ import org.apache.sis.internal.feature.A
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.util.Static;
+import org.apache.sis.util.iso.Names;
 
 // Branch-dependent imports
 import org.opengis.feature.FeatureType;
@@ -46,7 +47,7 @@ import org.opengis.feature.PropertyType;
  *
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class GPXConstants extends Static {
@@ -229,13 +230,13 @@ public final class GPXConstants extends
 
     static {
         final NameFactory   factory  = DefaultFactories.forBuildin(NameFactory.class);
-        final LocalName     geomName = AttributeConvention.GEOMETRY_PROPERTY;
+        final LocalName     geomName = Names.createTypeName(null, ":", "geometry");
         final Map<String,?> geomInfo = Collections.singletonMap(AbstractIdentifiedType.NAME_KEY, geomName);
 
         //-------------------- GENERIC GPX ENTITY ------------------------------
         FeatureTypeBuilder builder = new FeatureTypeBuilder(null, factory, null);
         builder.setDefaultScope(GPX_NAMESPACE).setName("GPXEntity").setAbstract(true);
-        builder.addAttribute(Integer.class).setName("index");
+        builder.addAttribute(Integer.class).setName("index").addRole(AttributeRole.IDENTIFIER_COMPONENT);
         TYPE_GPX_ENTITY = builder.build();
 
         //------------------- WAY POINT TYPE -----------------------------------

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=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -33,7 +33,6 @@ import java.util.List;
 import javax.xml.stream.XMLStreamException;
 import org.opengis.geometry.Envelope;
 import org.opengis.feature.Feature;
-import org.opengis.metadata.Metadata;
 
 import javax.xml.stream.XMLStreamReader;
 import org.apache.sis.geometry.ImmutableEnvelope;
@@ -67,12 +66,12 @@ import static org.apache.sis.internal.gp
  *
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class GPXReader extends StaxStreamReader {
 
-    MetaData metadata; // TODO
+    private MetaData metadata;
     private Feature current;
     private int wayPointInc = 0;
     private int routeInc = 0;
@@ -153,8 +152,8 @@ public class GPXReader extends StaxStrea
      *
      * @return Metadata or null if input is not set.
      */
-    public Metadata getMetadata() {
-        return null;    // TODO
+    public MetaData getMetadata() {
+        return metadata;
     }
 
     /**
@@ -250,29 +249,29 @@ public class GPXReader extends StaxStrea
                 case START_ELEMENT:
                     final String localName = reader.getLocalName();
                     if(TAG_NAME.equalsIgnoreCase(localName)){
-                        metadata.setName(reader.getElementText());
-                    }else if(TAG_DESC.equalsIgnoreCase(localName)){
-                        metadata.setDescription(reader.getElementText());
-                    }else if(TAG_AUTHOR.equalsIgnoreCase(localName)){
-                        if(metadata.getPerson()==null) metadata.setPerson(new Person());
-                        metadata.getPerson().setName(reader.getElementText());
-                    }else if(TAG_AUTHOR_EMAIL.equalsIgnoreCase(localName)){
-                        if(metadata.getPerson()==null) metadata.setPerson(new Person());
-                        metadata.getPerson().setEmail(reader.getElementText());
+                        metadata.name = reader.getElementText();
+                    }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();
+                    }else if(TAG_AUTHOR_EMAIL.equalsIgnoreCase(localName)) {
+                        if(metadata.person == null) metadata.person = new Person();
+                        metadata.person.email = reader.getElementText();
                     }else if(TAG_URL.equalsIgnoreCase(localName)){
                         try {
-                            metadata.getLinks().add(new URI(reader.getElementText()));
+                            metadata.links.add(new URI(reader.getElementText()));
                         } catch (URISyntaxException ex) {
                             throw new XMLStreamException(ex);
                         }
                     }else if(TAG_URLNAME.equalsIgnoreCase(localName)){
                         //reader.getElementText();
                     }else if(TAG_METADATA_TIME.equalsIgnoreCase(localName)){
-                        metadata.setTime(parseTime(reader.getElementText()));
+                        metadata.time = parseTime(reader.getElementText());
                     }else if(TAG_METADATA_KEYWORDS.equalsIgnoreCase(localName)){
-                        metadata.setKeywords(reader.getElementText());
+                        metadata.keywords = reader.getElementText();
                     }else if(TAG_BOUNDS.equalsIgnoreCase(localName)){
-                        metadata.setBounds(parseBound());
+                        metadata.bounds = parseBound();
                     }else if(  TAG_WPT.equalsIgnoreCase(localName)
                             || TAG_TRK.equalsIgnoreCase(localName)
                             || TAG_RTE.equalsIgnoreCase(localName)){
@@ -303,21 +302,21 @@ public class GPXReader extends StaxStrea
                 case START_ELEMENT:
                     final String localName = reader.getLocalName();
                     if(TAG_NAME.equalsIgnoreCase(localName)){
-                        metadata.setName(reader.getElementText());
+                        metadata.name = reader.getElementText();
                     }else if(TAG_DESC.equalsIgnoreCase(localName)){
-                        metadata.setDescription(reader.getElementText());
+                        metadata.description = reader.getElementText();
                     }else if(TAG_AUTHOR.equalsIgnoreCase(localName)){
-                        metadata.setPerson(parsePerson());
+                        metadata.person = parsePerson();
                     }else if(TAG_COPYRIGHT.equalsIgnoreCase(localName)){
-                        metadata.setCopyRight(parseCopyRight());
+                        metadata.copyRight = parseCopyRight();
                     }else if(TAG_LINK.equalsIgnoreCase(localName)){
-                        metadata.getLinks().add(parseLink());
+                        metadata.links.add(parseLink());
                     }else if(TAG_METADATA_TIME.equalsIgnoreCase(localName)){
-                        metadata.setTime(parseTime(reader.getElementText()));
+                        metadata.time = parseTime(reader.getElementText());
                     }else if(TAG_METADATA_KEYWORDS.equalsIgnoreCase(localName)){
-                        metadata.setKeywords(reader.getElementText());
+                        metadata.keywords = reader.getElementText();
                     }else if(TAG_BOUNDS.equalsIgnoreCase(localName)){
-                        metadata.setBounds(parseBound());
+                        metadata.bounds = parseBound();
                     }
                     break;
                 case END_ELEMENT:
@@ -341,7 +340,7 @@ public class GPXReader extends StaxStrea
     private CopyRight parseCopyRight() throws IOException, XMLStreamException {
         final XMLStreamReader reader = getReader();
         final CopyRight copyright = new CopyRight();
-        copyright.setAuthor(reader.getAttributeValue(null, ATT_COPYRIGHT_AUTHOR));
+        copyright.author = reader.getAttributeValue(null, ATT_COPYRIGHT_AUTHOR);
 
         while (reader.hasNext()) {
             final int type = reader.next();
@@ -350,10 +349,10 @@ public class GPXReader extends StaxStrea
                 case START_ELEMENT:
                     final String localName = reader.getLocalName();
                     if(TAG_COPYRIGHT_YEAR.equalsIgnoreCase(localName)){
-                        copyright.setYear(Integer.valueOf(reader.getElementText()));
+                        copyright.year = Integer.valueOf(reader.getElementText());
                     }else if(TAG_COPYRIGHT_LICENSE.equalsIgnoreCase(localName)){
                         try {
-                            copyright.setLicense( new URI(reader.getElementText()));
+                            copyright.license = new URI(reader.getElementText());
                         } catch (URISyntaxException ex) {
                             throw new XMLStreamException(ex);
                         }
@@ -426,11 +425,11 @@ public class GPXReader extends StaxStrea
                 case START_ELEMENT:
                     final String localName = reader.getLocalName();
                     if(TAG_NAME.equalsIgnoreCase(localName)){
-                        person.setName(reader.getElementText());
+                        person.name = reader.getElementText();
                     }else if(TAG_AUTHOR_EMAIL.equalsIgnoreCase(localName)){
-                        person.setEmail(reader.getElementText());
+                        person.email = reader.getElementText();
                     }else if(TAG_LINK.equalsIgnoreCase(localName)){
-                        person.setLink(parseLink());
+                        person.link = parseLink();
                     }
                     break;
                 case END_ELEMENT:

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=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -45,7 +45,7 @@ import org.opengis.feature.Property;
  *
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class GPXWriter100 extends StaxStreamWriter {
@@ -204,25 +204,23 @@ public class GPXWriter100 extends StaxSt
      * @throws XMLStreamException if underlying xml stax writer encounter an error
      */
     public void write(final MetaData metadata) throws XMLStreamException {
-        writeSimpleTag(namespace, TAG_NAME, metadata.getName());
-        writeSimpleTag(namespace, TAG_DESC, metadata.getDescription());
+        writeSimpleTag(namespace, TAG_NAME, metadata.name);
+        writeSimpleTag(namespace, TAG_DESC, metadata.description);
 
-        final Person person = metadata.getPerson();
-        if (person != null) {
-            writeSimpleTag(namespace, TAG_AUTHOR, person.getName());
-            writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, person.getEmail());
+        if (metadata.person != null) {
+            writeSimpleTag(namespace, TAG_AUTHOR, metadata.person.name);
+            writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, metadata.person.email);
         }
 
         //model is based on 1.1 so not all attributs can be written
-        writeLinkURIs(metadata.getLinks());
+        writeLinkURIs(metadata.links);
 
-        final Temporal d = metadata.getTime();
-        if (d != null) {
-            writeSimpleTag(namespace, TAG_METADATA_TIME, toString(d));
+        if (metadata.time != null) {
+            writeSimpleTag(namespace, TAG_METADATA_TIME, toString(metadata.time));
         }
 
-        writeSimpleTag(namespace, TAG_METADATA_KEYWORDS, metadata.getKeywords());
-        writeBounds(metadata.getBounds());
+        writeSimpleTag(namespace, TAG_METADATA_KEYWORDS, metadata.keywords);
+        writeBounds(metadata.bounds);
         writer.flush();
     }
 

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=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -29,7 +29,7 @@ import static org.apache.sis.internal.gp
  *
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class GPXWriter110 extends GPXWriter100{
@@ -60,21 +60,21 @@ public class GPXWriter110 extends GPXWri
     @Override
     public void write(final MetaData metadata) throws XMLStreamException {
         writer.writeStartElement(namespace, TAG_METADATA);
-        writeSimpleTag(namespace, TAG_NAME, metadata.getName());
-        writeSimpleTag(namespace, TAG_DESC, metadata.getDescription());
-        writePerson(metadata.getPerson());
-        writeCopyRight(metadata.getCopyRight());
-        for (URI uri : metadata.getLinks()) {
+        writeSimpleTag(namespace, TAG_NAME, metadata.name);
+        writeSimpleTag(namespace, TAG_DESC, metadata.description);
+        writePerson(metadata.person);
+        writeCopyRight(metadata.copyRight);
+        for (URI uri : metadata.links) {
             writeLink(uri);
         }
 
-        final Temporal d = metadata.getTime();
+        final Temporal d = metadata.time;
         if (d != null) {
             writeSimpleTag(namespace, TAG_METADATA_TIME, toString(d));
         }
 
-        writeSimpleTag(namespace, TAG_METADATA_KEYWORDS, metadata.getKeywords());
-        writeBounds(metadata.getBounds());
+        writeSimpleTag(namespace, TAG_METADATA_KEYWORDS, metadata.keywords);
+        writeBounds(metadata.bounds);
 
         writer.writeEndElement();
         writer.flush();
@@ -91,8 +91,8 @@ public class GPXWriter110 extends GPXWri
 
         writer.writeStartElement(namespace, TAG_AUTHOR);
         writeSimpleTag(namespace, TAG_NAME, person.getName());
-        writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, person.getEmail());
-        writeLink(person.getLink());
+        writeSimpleTag(namespace, TAG_AUTHOR_EMAIL, person.email);
+        writeLink(person.link);
         writer.writeEndElement();
     }
 
@@ -136,12 +136,12 @@ public class GPXWriter110 extends GPXWri
         if (copyRight == null) return;
 
         writer.writeStartElement(namespace, TAG_COPYRIGHT);
-        final String author = copyRight.getAuthor();
+        final String author = copyRight.author;
         if (author != null) {
             writer.writeAttribute(ATT_COPYRIGHT_AUTHOR, author);
         }
-        writeSimpleTag(namespace, TAG_COPYRIGHT_YEAR, copyRight.getYear());
-        writeSimpleTag(namespace, TAG_COPYRIGHT_LICENSE, copyRight.getLicense());
+        writeSimpleTag(namespace, TAG_COPYRIGHT_YEAR, copyRight.year);
+        writeSimpleTag(namespace, TAG_COPYRIGHT_LICENSE, copyRight.license);
         writer.writeEndElement();
     }
 

Modified: 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?rev=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -19,170 +19,131 @@ 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;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+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 org.opengis.geometry.Envelope;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.DateType;
+import org.opengis.metadata.citation.OnlineResource;
+import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.constraint.Constraints;
+import org.opengis.metadata.extent.Extent;
+import org.opengis.metadata.identification.Keywords;
+import org.opengis.referencing.operation.TransformException;
+import org.opengis.util.InternationalString;
 
 /**
  * Metadata object as defined in GPX.
  *
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
-public class MetaData {
+public class MetaData extends SimpleMetadata {
 
-    private String name;
-    private String description;
-    private Person person;
-    private CopyRight copyRight;
-    private final List<URI> links = new ArrayList<>();
-    private Temporal time;
-    private String keywords;
-    private Envelope bounds;
-
-    /**
-     * Returns the dataset name.
-     *
-     * @return name, may be null
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Set dataset name.
-     *
-     * @param name, can be null
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Returns the dataset description.
-     *
-     * @return description, may be null
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Set dataset description.
-     *
-     * @param description, can be null
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Returns dataset author person.
-     *
-     * @return Person, may be null
-     */
-    public Person getPerson() {
-        return person;
-    }
-
-    /**
-     * Set dataset author person.
-     *
-     * @param person, can be null
-     */
-    public void setPerson(Person person) {
-        this.person = person;
-    }
-
-    /**
-     * Returns the dataset copyright
-     *
-     * @return copyright, may be null
-     */
-    public CopyRight getCopyRight() {
-        return copyRight;
-    }
-
-    /**
-     * Set dataset copyright.
-     *
-     * @param copyRight, can be null
-     */
-    public void setCopyRight(CopyRight copyRight) {
-        this.copyRight = copyRight;
-    }
-
-    /**
-     * Returns the dataset links
-     * The returned list is modifiable.
-     *
-     * @return list of links, never null
-     */
-    public List<URI> getLinks() {
-        return links;
-    }
-
-    /**
-     * Returns the dataset creation time.
-     *
-     * @return Temporal, may be null
-     */
-    public Temporal getTime() {
-        return time;
-    }
-
-    /**
-     * Set dataset creation time.
-     *
-     * @param time, can be null
-     */
-    public void setTime(Temporal time) {
-        this.time = time;
-    }
-
-    /**
-     * Returns dataset keywords.
-     *
-     * @return keywords, may be null
-     */
-    public String getKeywords() {
-        return keywords;
-    }
-
-    /**
-     * Set dataset keywords.
-     *
-     * @param keywords, can be null
-     */
-    public void setKeywords(String keywords) {
-        this.keywords = keywords;
-    }
-
-    /**
-     * Returns the dataset bounding box.
-     *
-     * @return Envelope, may be null
-     */
-    public Envelope getBounds() {
-        return bounds;
-    }
-
-    /**
-     * Set dataset bounding box.
-     *
-     * @param bounds, can be null
-     */
-    public void setBounds(Envelope bounds) {
-        this.bounds = bounds;
+    public String name;
+    public String description;
+    public Person person;
+    public CopyRight copyRight;
+    public final List<URI> links = new ArrayList<>();
+    public Temporal time;
+    public String keywords;
+    public Envelope bounds;
+
+    @Override
+    public Collection<? extends Identifier> getIdentifiers() {
+        if (name != null) {
+            return Collections.singleton(new DefaultIdentifier(name));
+        }
+        return super.getIdentifiers();
+    }
+
+    @Override
+    public InternationalString getAbstract() {
+        if (description != null) {
+            return new SimpleInternationalString(description);
+        }
+        return super.getAbstract();
+    }
+
+    @Override
+    public Collection<? extends Keywords> getDescriptiveKeywords() {
+        if (keywords != null) {
+            return Collections.singleton(new DefaultKeywords(keywords));
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getPointOfContacts() {
+        if (person != null) {
+            return Collections.singletonList(person);
+        }
+        return super.getPointOfContacts();
+    }
+
+    @Override
+    public Collection<? extends Constraints> getResourceConstraints() {
+        if (copyRight != null) {
+            return Collections.singleton(copyRight);
+        }
+        return super.getResourceConstraints();
+    }
+
+    @Override
+    public Collection<? extends Extent> getExtents() {
+        if (bounds != null) {
+            final DefaultExtent ext = new DefaultExtent();
+            try {
+                ext.addElements(bounds);
+            } catch (TransformException ex) {
+                Logging.getLogger("oeg.apache.storage").log(Level.WARNING, ex.getMessage(),ex);
+            }
+            return Collections.singleton(ext);
+        }
+        return super.getExtents();
     }
 
     @Override
+    public Collection<? extends OnlineResource> getOnlineResources() {
+        if (!links.isEmpty()) {
+            final List<OnlineResource> resources = new ArrayList<>();
+            for (URI uri : links) {
+                resources.add(new DefaultOnlineResource(uri));
+            }
+            return resources;
+        }
+        return super.getOnlineResources();
+    }
+
+    @Override
+    public Collection<? extends CitationDate> getDates() {
+        if (time != null) {
+            final CitationDate date = new DefaultCitationDate(Date.from(Instant.from(time)), DateType.CREATION);
+            return Collections.singleton(date);
+        }
+        return super.getDates();
+    }
+    
+    @Override
     public String toString() {
         final StringWriter writer = new StringWriter();
         final TableAppender tablewriter = new TableAppender(writer);
@@ -191,37 +152,34 @@ public class MetaData {
         tablewriter.append("GPX-Metadata\t \n");
         tablewriter.appendHorizontalSeparator();
 
-        tablewriter.append("Name\t"+getName()+"\n");
-        tablewriter.append("Desc\t"+getDescription()+"\n");
-        tablewriter.append("Time\t"+getTime()+"\n");
-        tablewriter.append("Keywords\t"+getKeywords()+"\n");
-        tablewriter.append("Bounds\t"+getBounds()+"\n");
+        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");
 
-        final Person person = getPerson();
         if(person != null){
-            tablewriter.append("Person - Name\t"+person.getName()+"\n");
-            tablewriter.append("Person - EMail\t"+person.getEmail()+"\n");
-            tablewriter.append("Person - Link\t"+person.getLink()+"\n");
+            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");
         }
 
-        final CopyRight copyright = getCopyRight();
-        if(copyright != null){
-            tablewriter.append("CopyRight - Author\t"+copyright.getAuthor()+"\n");
-            tablewriter.append("CopyRight - Year\t"+copyright.getYear()+"\n");
-            tablewriter.append("CopyRight - License\t"+copyright.getLicense()+"\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("CopyRight\t"+copyRight+"\n");
         }
 
         tablewriter.append("Links\t");
-        final List<URI> links = getLinks();
         if(links.isEmpty()){
             tablewriter.append("None\n");
         }else{
             tablewriter.append("\n");
-            for(final URI uri : getLinks()){
+            for(final URI uri : links){
                 tablewriter.append("\t"+uri+"\n");
             }
         }

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=1754280&r1=1754279&r2=1754280&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] Wed Jul 27 15:23:20 2016
@@ -17,74 +17,145 @@
 package org.apache.sis.internal.gpx;
 
 import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Objects;
+import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
+import org.apache.sis.util.iso.SimpleInternationalString;
+import org.opengis.metadata.citation.Address;
+import org.opengis.metadata.citation.Contact;
+import org.opengis.metadata.citation.OnlineResource;
+import org.opengis.metadata.citation.Party;
+import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.Role;
+import org.opengis.metadata.citation.Telephone;
+import org.opengis.metadata.extent.Extent;
+import org.opengis.util.InternationalString;
 
 /**
  * Person object as defined in GPX.
  * 
  * @author Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
-public class Person {
+public class Person implements Party, Contact, Address, Responsibility {
 
-    private String name;
-    private String email;
-    private URI link;
-
-    /**
-     * Returns the person name.
-     *
-     * @return name, may be null
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Set person name.
-     *
-     * @param name, can be null
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Returns the person email.
-     *
-     * @return email, may be null
-     */
-    public String getEmail() {
-        return email;
-    }
-
-    /**
-     * Set person email.
-     *
-     * @param email, can be null
-     */
-    public void setEmail(String email) {
-        this.email = email;
-    }
-
-    /**
-     * Returns the person information link.
-     *
-     * @return uri, may be null
-     */
-    public URI getLink() {
-        return link;
-    }
-
-    /**
-     * Set person information link.
-     *
-     * @param link, can be null
-     */
-    public void setLink(URI link) {
-        this.link = link;
+    public String name;
+    public String email;
+    public URI link;
+
+    @Override
+    public Collection<? extends Contact> getContactInfo() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public Collection<? extends Telephone> getPhones() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Telephone getPhone() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Address> getAddresses() {
+        return Collections.singleton(this);
+    }
+
+    @Override
+    public Address getAddress() {
+        return this;
+    }
+
+    @Override
+    public Collection<? extends OnlineResource> getOnlineResources() {
+        if (link!=null) {
+            return Collections.singleton(new DefaultOnlineResource(link));
+        }
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public OnlineResource getOnlineResource() {
+        if (link!=null) {
+            return new DefaultOnlineResource(link);
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getHoursOfService() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getContactInstructions() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getContactType() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getName() {
+        if (name!=null) {
+            return new SimpleInternationalString(name);
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getDeliveryPoints() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getCity() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getAdministrativeArea() {
+        return null;
+    }
+
+    @Override
+    public String getPostalCode() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getCountry() {
+        return null;
+    }
+
+    @Override
+    public Collection<String> getElectronicMailAddresses() {
+        if (email != null) {
+            return Collections.singleton(email);
+        }
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Role getRole() {
+        return Role.ORIGINATOR;
+    }
+
+    @Override
+    public Collection<? extends Extent> getExtents() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Party> getParties() {
+        return Collections.singleton(this);
     }
 
     @Override

Added: 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/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java?rev=1754280&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java (added)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/SimpleMetadata.java Wed Jul 27 15:23:20 2016
@@ -0,0 +1,438 @@
+/*
+ * 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.
+ */
+package org.apache.sis.internal.gpx;
+
+import java.nio.charset.Charset;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Locale;
+import org.opengis.metadata.ApplicationSchemaInformation;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.MetadataExtensionInformation;
+import org.opengis.metadata.MetadataScope;
+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.PresentationForm;
+import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.Series;
+import org.opengis.metadata.constraint.Constraints;
+import org.opengis.metadata.content.ContentInformation;
+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.lineage.Lineage;
+import org.opengis.metadata.maintenance.MaintenanceInformation;
+import org.opengis.metadata.maintenance.ScopeCode;
+import org.opengis.metadata.quality.DataQuality;
+import org.opengis.metadata.spatial.SpatialRepresentation;
+import org.opengis.metadata.spatial.SpatialRepresentationType;
+import org.opengis.referencing.ReferenceSystem;
+import org.opengis.temporal.Duration;
+import org.opengis.util.InternationalString;
+
+/**
+ * Default simple metadata implementation.
+ *
+ * @author Johann Sorel (Geomatys)
+ * @since   0.8
+ * @version 0.8
+ * @module
+ */
+public class SimpleMetadata implements Metadata, DataIdentification, Citation {
+
+    @Override
+    public Identifier getMetadataIdentifier() {
+        return null;
+    }
+
+    @Override
+    public String getFileIdentifier() {
+        return null;
+    }
+
+    @Override
+    public Collection<Locale> getLanguages() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Locale getLanguage() {
+        return null;
+    }
+
+    @Override
+    public Collection<Locale> getLocales() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<Charset> getCharacterSets() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public CharacterSet getCharacterSet() {
+        return null;
+    }
+
+    @Override
+    public Citation getParentMetadata() {
+        return null;
+    }
+
+    @Override
+    public String getParentIdentifier() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends MetadataScope> getMetadataScopes() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<ScopeCode> getHierarchyLevels() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<String> getHierarchyLevelNames() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getContacts() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends CitationDate> getDateInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Date getDateStamp() {
+        return null;
+    }
+
+    @Override
+    public String getMetadataStandardName() {
+        return null;
+    }
+
+    @Override
+    public String getMetadataStandardVersion() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Citation> getMetadataStandards() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Citation> getMetadataProfiles() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Citation> getAlternativeMetadataReferences() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends OnlineResource> getMetadataLinkages() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public String getDataSetUri() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends SpatialRepresentation> getSpatialRepresentationInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends ReferenceSystem> getReferenceSystemInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends MetadataExtensionInformation> getMetadataExtensionInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Identification> getIdentificationInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends ContentInformation> getContentInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Distribution> getDistributionInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends DataQuality> getDataQualityInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends PortrayalCatalogueReference> getPortrayalCatalogueInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Constraints> getMetadataConstraints() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends ApplicationSchemaInformation> getApplicationSchemaInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends AcquisitionInformation> getAcquisitionInformation() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public MaintenanceInformation getMetadataMaintenance() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Lineage> getResourceLineages() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getEnvironmentDescription() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getSupplementalInformation() {
+        return null;
+    }
+
+    @Override
+    public Citation getCitation() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getAbstract() {
+        return null;
+    }
+
+    @Override
+    public InternationalString getPurpose() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getCredits() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<Progress> getStatus() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getPointOfContacts() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Resolution> getSpatialResolutions() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Duration> getTemporalResolutions() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<TopicCategory> getTopicCategories() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Extent> getExtents() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Citation> getAdditionalDocumentations() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Identifier getProcessingLevel() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends MaintenanceInformation> getResourceMaintenances() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends BrowseGraphic> getGraphicOverviews() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Format> getResourceFormats() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Keywords> getDescriptiveKeywords() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Usage> getResourceSpecificUsages() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Constraints> getResourceConstraints() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends AssociatedResource> getAssociatedResources() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends AggregateInformation> getAggregationInfo() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getTitle() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getAlternateTitles() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends CitationDate> getDates() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getEdition() {
+        return null;
+    }
+
+    @Override
+    public Date getEditionDate() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends Identifier> getIdentifiers() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends Responsibility> getCitedResponsibleParties() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<PresentationForm> getPresentationForms() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Series getSeries() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends InternationalString> getOtherCitationDetails() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public InternationalString getCollectiveTitle() {
+        return null;
+    }
+
+    @Override
+    public String getISBN() {
+        return null;
+    }
+
+    @Override
+    public String getISSN() {
+        return null;
+    }
+
+    @Override
+    public Collection<? extends OnlineResource> getOnlineResources() {
+        return Collections.EMPTY_LIST;
+    }
+
+    @Override
+    public Collection<? extends BrowseGraphic> getGraphics() {
+        return Collections.EMPTY_LIST;
+    }
+
+}

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXReaderTest.java?rev=1754280&r1=1754279&r2=1754280&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXReaderTest.java [UTF-8] Wed Jul 27 15:23:20 2016
@@ -38,6 +38,7 @@ import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.Temporal;
 import java.time.temporal.TemporalAccessor;
+import org.apache.sis.test.TestCase;
 import org.opengis.feature.Feature;
 
 
@@ -49,7 +50,7 @@ import org.opengis.feature.Feature;
  * @version 0.7
  * @module
  */
-public class GPXReaderTest {
+public class GPXReaderTest extends TestCase{
 
     private static final double DELTA = 0.000001;
 
@@ -67,22 +68,22 @@ public class GPXReaderTest {
     @Test
     public void testMetadataRead100() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_metadata100.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertEquals("sample", data.getName());
-            assertEquals("sample gpx test file", data.getDescription());
-            assertEquals(parseTime("2010-03-01"), data.getTime());
-            assertEquals("sample,metadata", data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-
-            assertEquals("Jean-Pierre", data.getPerson().getName());
-            assertEquals("jean.pierre@test.com", data.getPerson().getEmail());
-            assertNull(data.getPerson().getLink());
+            assertEquals("sample", data.name);
+            assertEquals("sample gpx test file", data.description);
+            assertEquals(parseTime("2010-03-01"), data.time);
+            assertEquals("sample,metadata", data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+
+            assertEquals("Jean-Pierre", data.person.name);
+            assertEquals("jean.pierre@test.com", data.person.email);
+            assertNull(data.person.link);
 
-            assertNull(data.getCopyRight());
+            assertNull(data.copyRight);
 
-            assertEquals(1, data.getLinks().size());
-            assertEquals("http://first-adress.org", data.getLinks().get(0).toString());
+            assertEquals(1, data.links.size());
+            assertEquals("http://first-adress.org", data.links.get(0).toString());
         }
     }
 
@@ -94,26 +95,26 @@ public class GPXReaderTest {
     @Test
     public void testMetadataRead110() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_metadata110.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertEquals("sample", data.getName());
-            assertEquals("sample gpx test file", data.getDescription());
-            assertEquals(parseTime("2010-03-01"), data.getTime());
-            assertEquals("sample,metadata", data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-
-            assertEquals("Jean-Pierre", data.getPerson().getName());
-            assertEquals("jean.pierre@test.com", data.getPerson().getEmail());
-            assertEquals("http://someone-site.org", data.getPerson().getLink().toString());
-
-            assertEquals("gnu", data.getCopyRight().getAuthor());
-            assertEquals(2010, data.getCopyRight().getYear().intValue());
-            assertEquals("http://www.gnu.org/licenses/lgpl-3.0-standalone.html", data.getCopyRight().getLicense().toString());
-
-            assertEquals(3, data.getLinks().size());
-            assertEquals("http://first-adress.org", data.getLinks().get(0).toString());
-            assertEquals("http://second-adress.org", data.getLinks().get(1).toString());
-            assertEquals("http://third-adress.org", data.getLinks().get(2).toString());
+            assertEquals("sample", data.name);
+            assertEquals("sample gpx test file", data.description);
+            assertEquals(parseTime("2010-03-01"), data.time);
+            assertEquals("sample,metadata", data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+
+            assertEquals("Jean-Pierre", data.person.name);
+            assertEquals("jean.pierre@test.com", data.person.email);
+            assertEquals("http://someone-site.org", data.person.link.toString());
+
+            assertEquals("gnu", data.copyRight.author);
+            assertEquals(2010, data.copyRight.year.intValue());
+            assertEquals("http://www.gnu.org/licenses/lgpl-3.0-standalone.html", data.copyRight.license.toString());
+
+            assertEquals(3, data.links.size());
+            assertEquals("http://first-adress.org", data.links.get(0).toString());
+            assertEquals("http://second-adress.org", data.links.get(1).toString());
+            assertEquals("http://third-adress.org", data.links.get(2).toString());
         }
     }
 
@@ -126,16 +127,16 @@ public class GPXReaderTest {
     @Test
     public void testWayPointRead100() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_waypoint100.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             checkPoint(f, 0, false);
@@ -155,16 +156,16 @@ public class GPXReaderTest {
     @Test
     public void testWayPointRead110() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_waypoint110.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             checkPoint(f, 0, true);
@@ -185,16 +186,16 @@ public class GPXReaderTest {
     @Test
     public void testRouteRead100() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_route100.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             assertEquals("route name",          f.getPropertyValue("name"));
@@ -250,16 +251,16 @@ public class GPXReaderTest {
     @Test
     public void testRouteRead110() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_route110.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             assertEquals("route name",          f.getPropertyValue("name"));
@@ -317,16 +318,16 @@ public class GPXReaderTest {
     @Test
     public void testTrackRead100() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_track100.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             assertEquals("track name",          f.getPropertyValue("name"));
@@ -387,16 +388,16 @@ public class GPXReaderTest {
     @Test
     public void testTrackRead110() throws Exception {
         try (final GPXReader reader = create("/org/apache/sis/gpx/sample_track110.xml")) {
-            final MetaData data = reader.metadata;
+            final MetaData data = reader.getMetadata();
 
-            assertNull(data.getName());
-            assertNull(data.getDescription());
-            assertNull(data.getTime());
-            assertNull(data.getKeywords());
-            assertEquals(createEnvelope(-20, 30, 10, 40), data.getBounds());
-            assertNull(data.getPerson());
-            assertNull(data.getCopyRight());
-            assertEquals(0, data.getLinks().size());
+            assertNull(data.name);
+            assertNull(data.description);
+            assertNull(data.time);
+            assertNull(data.keywords);
+            assertEquals(createEnvelope(-20, 30, 10, 40), data.bounds);
+            assertNull(data.person);
+            assertNull(data.copyRight);
+            assertEquals(0, data.links.size());
 
             Feature f = reader.next();
             assertEquals("track name",          f.getPropertyValue("name"));

Copied: sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXTestSuite.java (from r1753972, sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/test/suite/ShapefileTestSuite.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXTestSuite.java?p2=sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXTestSuite.java&p1=sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/test/suite/ShapefileTestSuite.java&r1=1753972&r2=1754280&rev=1754280&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/test/suite/ShapefileTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXTestSuite.java [UTF-8] Wed Jul 27 15:23:20 2016
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.test.suite;
+package org.apache.sis.internal.gpx;
 
 import org.apache.sis.test.TestSuite;
 import org.junit.runners.Suite;
@@ -22,23 +22,20 @@ import org.junit.BeforeClass;
 
 
 /**
- * All tests from the {@code sis-shapefile} module, in approximative dependency order.
+ * All tests from the {@code sis-xmlstore} module, in approximative dependency order.
  */
 @Suite.SuiteClasses({
-    org.apache.sis.storage.shapefile.ShapeFileTest.class,
-    org.apache.sis.internal.shapefile.jdbc.DBFConnectionTest.class,
-    org.apache.sis.internal.shapefile.jdbc.DBFStatementTest.class,
-    org.apache.sis.internal.shapefile.jdbc.DBFResultSetTest.class,
-    org.apache.sis.internal.shapefile.jdbc.sql.WhereClauseTest.class
+    org.apache.sis.internal.gpx.GPXReaderTest.class,
+    org.apache.sis.internal.gpx.GPXWriterTest.class
 })
-public final strictfp class ShapefileTestSuite extends TestSuite {
+public final strictfp class GPXTestSuite extends TestSuite {
     /**
      * Verifies the list of tests before to run the suite.
      * See {@link #verifyTestList(Class, Class[])} for more information.
      */
     @BeforeClass
     public static void verifyTestList() {
-        assertNoMissingTest(ShapefileTestSuite.class);
-        verifyTestList(ShapefileTestSuite.class);
+        assertNoMissingTest(GPXTestSuite.class);
+        verifyTestList(GPXTestSuite.class);
     }
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXWriterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXWriterTest.java?rev=1754280&r1=1754279&r2=1754280&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXWriterTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/gpx/GPXWriterTest.java [UTF-8] Wed Jul 27 15:23:20 2016
@@ -26,12 +26,17 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import com.esri.core.geometry.Point;
+import java.io.IOException;
+import javax.xml.stream.XMLStreamException;
 import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.geometry.ImmutableEnvelope;
 import org.apache.sis.referencing.CommonCRS;
 import org.junit.Test;
 
 import static org.apache.sis.internal.gpx.GPXConstants.*;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.test.TestCase;
 import static org.junit.Assert.*;
 
 // Branch-dependent imports
@@ -46,7 +51,14 @@ import org.opengis.feature.Feature;
  * @version 0.7
  * @module
  */
-public final strictfp class GPXWriterTest {
+public final strictfp class GPXWriterTest extends TestCase{
+
+
+    private static GPXReader create(final File resource) throws DataStoreException, IOException, XMLStreamException {
+        StorageConnector storage = new StorageConnector(resource);
+        return new GPXReader(storage.getStorage(), storage);
+    }
+
     /**
      * Test writing gpx metadata.
      *
@@ -60,36 +72,36 @@ public final strictfp class GPXWriterTes
         final GPXWriter110 writer = new GPXWriter110("Apache SIS", f);
 
         final Person person = new Person();
-        person.setName("Jean-Pierre");
-        person.setEmail("jean-pierre@test.com");
-        person.setLink(new URI("http://son-site.com"));
+        person.name = "Jean-Pierre";
+        person.email = "jean-pierre@test.com";
+        person.link = new URI("http://son-site.com");
 
         final CopyRight copyright = new CopyRight();
-        copyright.setAuthor("GNU");
-        copyright.setYear(2010);
-        copyright.setLicense(new URI("http://gnu.org"));
+        copyright.author = "GNU";
+        copyright.year = 2010;
+        copyright.license = new URI("http://gnu.org");
 
         final GeneralEnvelope bounds = new GeneralEnvelope(CommonCRS.defaultGeographic());
         bounds.setRange(0, -10, 20);
         bounds.setRange(1, -30, 40);
 
         final MetaData metaData = new MetaData();
-        metaData.setName("name");
-        metaData.setDescription("description");
-        metaData.setPerson(person);
-        metaData.setCopyRight(copyright);
-        metaData.getLinks().addAll(Arrays.asList(new URI("http://adress1.org"),new URI("http://adress2.org")));
-        metaData.setTime(Instant.now());
-        metaData.setKeywords("test,sample");
-        metaData.setBounds(new ImmutableEnvelope(bounds));
+        metaData.name = "name";
+        metaData.description = "description";
+        metaData.person = person;
+        metaData.copyRight = copyright;
+        metaData.links.addAll(Arrays.asList(new URI("http://adress1.org"),new URI("http://adress2.org")));
+        metaData.time = Instant.now();
+        metaData.keywords = "test,sample";
+        metaData.bounds = new ImmutableEnvelope(bounds);
 
         writer.writeStartDocument();
         writer.write(metaData, null, null, null);
         writer.writeEndDocument();
         writer.close();
 
-        try (GPXReader reader = new GPXReader(f, null)) {
-            assertEquals(metaData, reader.metadata);
+        try (GPXReader reader = create(f)) {
+            assertEquals(metaData, reader.getMetadata());
         }
 
         if (f.exists()) f.delete();
@@ -247,7 +259,7 @@ public final strictfp class GPXWriterTes
         writer.writeEndDocument();
         writer.close();
 
-        final GPXReader reader = new GPXReader(f, null);
+        final GPXReader reader = create(f);
 
         //testing on toString since JTS geometry always fail on equals method.
         assertEquals(point1.toString(), reader.next().toString());



Mime
View raw message