sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1773845 [2/2] - in /sis/branches/JDK8/storage/sis-xmlstore/src: main/java/org/apache/sis/internal/gpx/ test/java/org/apache/sis/internal/gpx/
Date Mon, 12 Dec 2016 18:40:26 GMT
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=1773845&r1=1773844&r2=1773845&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] Mon Dec 12 18:40:26 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.internal.gpx;
 
-import java.net.URI;
 import java.time.Instant;
 import java.time.temporal.Temporal;
 import java.util.ArrayList;
@@ -41,7 +40,6 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.internal.simple.SimpleMetadata;
 import org.apache.sis.io.TableAppender;
 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;
@@ -79,32 +77,32 @@ public final class Metadata extends Simp
     /**
      * The name of the GPX file.
      */
-    @XmlElement(name = Constants.TAG_NAME)
+    @XmlElement(name = Tags.NAME)
     public String name;
 
     /**
      * A description of the contents of the GPX file.
      */
-    @XmlElement(name = Constants.TAG_DESC)
+    @XmlElement(name = Tags.DESCRIPTION)
     public String description;
 
     /**
      * The person or organization who created the GPX file.
      */
-    @XmlElement(name = Constants.TAG_AUTHOR)
+    @XmlElement(name = Tags.AUTHOR)
     public Person author;
 
     /**
      * Copyright and license information governing use of the file.
      */
-    @XmlElement(name = Constants.TAG_COPYRIGHT)
+    @XmlElement(name = Tags.COPYRIGHT)
     public Copyright copyright;
 
     /**
      * URLs associated with the location described in the file.
      */
-    @XmlElement(name = Constants.TAG_LINK)
-    public final List<URI> links = new ArrayList<>();
+    @XmlElement(name = Tags.LINK)
+    public final List<Link> links = new ArrayList<>();
 
     /**
      * The creation date of the file.
@@ -228,8 +226,8 @@ public final class Metadata extends Simp
         final int size = links.size();
         if (size != 0) {
             final List<OnlineResource> resources = new ArrayList<>(size);
-            for (URI uri : links) {
-                resources.add(new DefaultOnlineResource(uri));
+            for (final Link link : links) {
+                resources.add(link);
             }
             return resources;
         }
@@ -288,8 +286,8 @@ public final class Metadata extends Simp
         append(table, "Author",      author);
         append(table, "Copyright",   copyright);
         String label = "Link(s)";
-        for (final URI uri : links) {
-            append(table, label, uri);
+        for (final Link link : links) {
+            append(table, label, link);
             label = null;
         }
         append(table, "Time",     time);

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=1773845&r1=1773844&r2=1773845&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] Mon Dec 12 18:40:26 2016
@@ -16,11 +16,9 @@
  */
 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;
@@ -57,7 +55,7 @@ import org.opengis.util.InternationalStr
  * @version 0.8
  * @module
  */
-public final class Person extends Element implements Responsibility, Party, Contact, Address {
+public final class Person implements Responsibility, Party, Contact, Address {
     /**
      * Name of person or organization.
      *
@@ -77,10 +75,10 @@ public final class Person extends Elemen
      *
      * @see #getOnlineResources()
      */
-    public URI link;
+    public Link link;
 
     /**
-     * Creates a new initially empty instance.
+     * Creates an initially empty instance.
      */
     public Person() {
     }
@@ -116,8 +114,8 @@ public final class Person extends Elemen
      * @see #getContactInfo()
      */
     @Override
-    public Collection<Party> getParties() {
-        return thisOrEmpty(this, name != null || email != null || link != null);
+    public Collection<? extends Party> getParties() {
+        return thisOrEmpty(name != null || email != null || link != null);
     }
 
 
@@ -147,8 +145,8 @@ public final class Person extends Elemen
      * @see #getOnlineResources()
      */
     @Override
-    public Collection<Contact> getContactInfo() {
-        return thisOrEmpty(this, email != null || link != null);
+    public Collection<? extends Contact> getContactInfo() {
+        return thisOrEmpty(email != null || link != null);
     }
 
 
@@ -186,8 +184,8 @@ public final class Person extends Elemen
      * @see #getElectronicMailAddresses()
      */
     @Override
-    public Collection<Address> getAddresses() {
-        return thisOrEmpty(this, email != null);
+    public Collection<? extends Address> getAddresses() {
+        return thisOrEmpty(email != null);
     }
 
     /**
@@ -206,10 +204,7 @@ public final class Person extends Elemen
      */
     @Override
     public Collection<OnlineResource> getOnlineResources() {
-        if (link != null) {
-            return Collections.singleton(new DefaultOnlineResource(link));
-        }
-        return Collections.emptySet();
+        return (link != null) ? Collections.singleton(link) : Collections.emptySet();
     }
 
     /**
@@ -218,7 +213,7 @@ public final class Person extends Elemen
     @Override
     @Deprecated
     public OnlineResource getOnlineResource() {
-        return (link != null) ? new DefaultOnlineResource(link) : null;
+        return link;
     }
 
     /**
@@ -314,10 +309,15 @@ public final class Person extends Elemen
      */
     @Override
     public Collection<String> getElectronicMailAddresses() {
-        if (email != null) {
-            return Collections.singleton(email);
-        }
-        return Collections.emptySet();
+        return (email != null) ? Collections.singleton(email) : Collections.emptySet();
+    }
+
+    /**
+     * Returns this object as a singleton if the given condition is {@code true},
+     * or an empty set if the given condition is {@code false}.
+     */
+    private Collection<Person> thisOrEmpty(final boolean condition) {
+        return condition ? Collections.singleton(this) : Collections.emptySet();
     }
 
     /**

Copied: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Tags.java (from r1773750, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Constants.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Tags.java?p2=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Tags.java&p1=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Constants.java&r1=1773750&r2=1773845&rev=1773845&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Constants.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Tags.java [UTF-8] Mon Dec 12 18:40:26 2016
@@ -20,169 +20,72 @@ import org.apache.sis.util.Static;
 
 
 /**
- * GPX XML tag and attribute names.
+ * GPX tag names in XML files and their namespaces. Also used for feature property names.
+ * Unless otherwise noticed by a "(v1.0)" or "(v1.1)" text in the javadoc, tags in this class
+ * apply to all supported GPX versions.
  *
  * @author  Johann Sorel (Geomatys)
  * @since   0.8
  * @version 0.8
  * @module
  */
-final class Constants extends Static {
-    /*
-     * Main GPX XML tags.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_GPX = "gpx";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_GPX_VERSION = "version";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_GPX_CREATOR = "creator";
-
-    /*
-     * Attributes used a bit everywhere.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_NAME = "name";
-    /** Used in version 1.0. */
-    public static final String TAG_URL = "url";
-    /** Used in version 1.0. */
-    public static final String TAG_URLNAME = "urlname";
-    /** Used in version 1.1. */
-    public static final String TAG_LINK = "link";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_DESC = "desc";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_CMT = "cmt";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_SRC = "src";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_TYPE = "type";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_NUMBER = "number";
-
-    /*
-     * Metadata tags.
-     */
-    /** Used in version 1.1. */
-    public static final String TAG_METADATA = "metadata";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_METADATA_TIME = "time";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_METADATA_KEYWORDS = "keywords";
-
-    /*
-     * Person tags.
-     */
-    /** Used in version 1.0 (as attribute) and 1.1 (as tag) */
-    public static final String TAG_AUTHOR = "author";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_AUTHOR_EMAIL = "email";
-
-    /*
-     * Copyright tags.
-     */
-    /** Used in version 1.1. */
-    public static final String TAG_COPYRIGHT = "copyright";
-    /** Used in version 1.1. */
-    public static final String TAG_COPYRIGHT_YEAR = "year";
-    /** Used in version 1.1. */
-    public static final String TAG_COPYRIGHT_LICENSE = "license";
-    /** Used in version 1.1. */
-    public static final String ATT_COPYRIGHT_AUTHOR = "author";
-
-    /*
-     * Bounds tags.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_BOUNDS = "bounds";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_BOUNDS_MINLAT = "minlat";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_BOUNDS_MINLON = "minlon";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_BOUNDS_MAXLAT = "maxlat";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_BOUNDS_MAXLON = "maxlon";
-
-    /*
-     * Link tags.
-     */
-    /** Used in version 1.1. */
-    public static final String TAG_LINK_TEXT = "text";
-    /** Used in version 1.1. */
-    public static final String TAG_LINK_TYPE = "type";
-    /** Used in version 1.1. */
-    public static final String ATT_LINK_HREF = "href";
-
-    /*
-     * WPT tags.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT = "wpt";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_WPT_LAT = "lat";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String ATT_WPT_LON = "lon";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_ELE = "ele";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_TIME = "time";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_MAGVAR = "magvar";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_GEOIHEIGHT = "geoidheight";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_SYM = "sym";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_FIX = "fix";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_SAT = "sat";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_HDOP = "hdop";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_VDOP = "vdop";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_PDOP = "pdop";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_AGEOFGPSDATA = "ageofdgpsdata";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_WPT_DGPSID = "dgpsid";
-
-    /*
-     * RTE tags.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_RTE = "rte";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_RTE_RTEPT = "rtept";
-
-    /*
-     * TRK tags.
-     */
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_TRK = "trk";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_TRK_SEG = "trkseg";
-    /** Used in versions 1.0 and 1.1. */
-    public static final String TAG_TRK_SEG_PT = "trkpt";
-
+final class Tags extends Static {
     /**
      * GPX scope name used for feature type names.
      */
-    public static final String NAMESPACE = "http://www.topografix.com";
+    static final String NAMESPACE = "http://www.topografix.com";
 
     /**
-     * GPX 1.1 XML namespace.
+     * GPX 1.0 XML namespace (v1.0).
      */
-    public static final String NAMESPACE_V11 = "http://www.topografix.com/GPX/1/1";
+    static final String NAMESPACE_V10 = "http://www.topografix.com/GPX/1/0";
+
     /**
-     * GPX 1.0 XML namespace.
+     * GPX 1.1 XML namespace (v1.1).
      */
-    public static final String NAMESPACE_V10 = "http://www.topografix.com/GPX/1/0";
+    static final String NAMESPACE_V11 = "http://www.topografix.com/GPX/1/1";
+
+    /** Main GPX XML tags.              */  static final String GPX             = "gpx";
+    /** A tag used a bit everywhere.    */  static final String NAME            = "name";
+    /** A tag used a bit everywhere.    */  static final String URL             = "url";
+    /** A tag used a bit everywhere.    */  static final String URL_NAME        = "urlname";
+    /** A tag used a bit everywhere.    */  static final String LINK            = "link";
+    /** A tag used a bit everywhere.    */  static final String DESCRIPTION     = "desc";
+    /** A tag used a bit everywhere.    */  static final String COMMENT         = "cmt";
+    /** A tag used a bit everywhere.    */  static final String SOURCE          = "src";
+    /** A tag used a bit everywhere.    */  static final String TYPE            = "type";
+    /** A tag used a bit everywhere.    */  static final String NUMBER          = "number";
+    /** A metadata tag (v1.1+).         */  static final String METADATA        = "metadata";
+    /** A metadata tag.                 */  static final String TIME            = "time";
+    /** A metadata tag.                 */  static final String KEYWORDS        = "keywords";
+    /** Attribute in v1.0, tag in v1.1. */  static final String AUTHOR          = "author";
+    /** A person tag.                   */  static final String EMAIL           = "email";
+    /** A copyright tag (v1.1+).        */  static final String COPYRIGHT       = "copyright";
+    /** A copyright tag (v1.1+).        */  static final String YEAR            = "year";
+    /** A copyright tag (v1.1+).        */  static final String LICENSE         = "license";
+    /** A bounds tag.                   */  static final String BOUNDS          = "bounds";
+    /** A link tag (v1.1+).             */  static final String TEXT            = "text";
+    /** A way Point tag.                */  static final String WAY_POINT       = "wpt";
+    /** A way Point tag.                */  static final String ELEVATION       = "ele";
+    /** A way Point tag.                */  static final String MAGNETIC_VAR    = "magvar";
+    /** A way Point tag.                */  static final String GEOID_HEIGHT    = "geoidheight";
+    /** A way Point tag.                */  static final String SYMBOL          = "sym";
+    /** A way Point tag.                */  static final String FIX             = "fix";
+    /** A way Point tag.                */  static final String SATELITTES      = "sat";
+    /** A way Point tag.                */  static final String HDOP            = "hdop";
+    /** A way Point tag.                */  static final String VDOP            = "vdop";
+    /** A way Point tag.                */  static final String PDOP            = "pdop";
+    /** A way Point tag.                */  static final String AGE_OF_GPS_DATA = "ageofdgpsdata";
+    /** A way Point tag.                */  static final String DGPS_ID         = "dgpsid";
+    /** A route tag.                    */  static final String ROUTES          = "rte";
+    /** A route tag.                    */  static final String ROUTE_POINTS    = "rtept";
+    /** A track tag.                    */  static final String TRACKS          = "trk";
+    /** A track tag.                    */  static final String TRACK_SEGMENTS  = "trkseg";
+    /** A track tag.                    */  static final String TRACK_POINTS    = "trkpt";
 
     /**
      * Do not allow instantiation of this class.
      */
-    private Constants() {
+    private Tags() {
     }
 }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Types.java?rev=1773845&r1=1773844&r2=1773845&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Types.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Types.java [UTF-8] Mon Dec 12 18:40:26 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.internal.gpx;
 
-import java.net.URI;
 import java.util.Collections;
 import java.util.Locale;
 import java.util.Map;
@@ -25,6 +24,7 @@ import com.esri.core.geometry.Point;
 import org.opengis.util.LocalName;
 import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
+import org.opengis.metadata.citation.OnlineResource;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.feature.AbstractIdentifiedType;
 import org.apache.sis.feature.FeatureOperations;
@@ -35,8 +35,6 @@ import org.apache.sis.internal.system.De
 import org.apache.sis.util.iso.DefaultNameFactory;
 import org.apache.sis.util.Static;
 
-import static org.apache.sis.internal.gpx.Constants.*;
-
 // Branch-dependent imports
 import org.opengis.feature.FeatureType;
 
@@ -81,7 +79,7 @@ final class Types extends Static {
         try {
             DEFAULT = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class), null);
         } catch (FactoryException e) {
-            throw new AssertionError(e);    // Should never happen with DefaultNameFactory implementation.
+            throw new AssertionError(e);        // Should never happen with DefaultNameFactory implementation.
         }
     }
 
@@ -109,94 +107,94 @@ final class Types extends Static {
          * └─────────────┴─────────┴─────────────┘
          */
         FeatureTypeBuilder builder = new FeatureTypeBuilder(null, factory, locale);
-        builder.setDefaultScope(NAMESPACE).setName("GPXEntity").setAbstract(true);
+        builder.setDefaultScope(Tags.NAMESPACE).setName("GPXEntity").setAbstract(true);
         builder.addAttribute(Integer.class).setName(AttributeConvention.IDENTIFIER_PROPERTY);
         final FeatureType parent = builder.build();
         /*
          * http://www.topografix.com:WayPoint ⇾ GPXEntity
-         * ┌───────────────┬──────────┬────────────────────────┬─────────────┐
-         * │ Name          │ Type     │ XML type               │ Cardinality │
-         * ├───────────────┼──────────┼────────────────────────┼─────────────┤
-         * │ @identifier   │ Integer  │                        │   [1 … 1]   │
-         * │ @envelope     │ Envelope │                        │   [1 … 1]   │
-         * │ @geometry     │ Point    │ (lat,lon) attributes   │   [1 … 1]   │
-         * │ ele           │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ time          │ Temporal │ xsd:dateTime           │   [0 … 1]   │
-         * │ magvar        │ Double   │ gpx:degreesType        │   [0 … 1]   │
-         * │ geoidheight   │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ name          │ String   │ xsd:string             │   [0 … 1]   │
-         * │ cmt           │ String   │ xsd:string             │   [0 … 1]   │
-         * │ desc          │ String   │ xsd:string             │   [0 … 1]   │
-         * │ src           │ String   │ xsd:string             │   [0 … 1]   │
-         * │ link          │ URI      │ gpx:linkType           │   [0 … ∞]   │
-         * │ sym           │ String   │ xsd:string             │   [0 … 1]   │
-         * │ type          │ String   │ xsd:string             │   [0 … 1]   │
-         * │ fix           │ String   │ gpx:fixType            │   [0 … 1]   │
-         * │ sat           │ Integer  │ xsd:nonNegativeInteger │   [0 … 1]   │
-         * │ hdop          │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ vdop          │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ pdop          │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ ageofdgpsdata │ Double   │ xsd:decimal            │   [0 … 1]   │
-         * │ dgpsid        │ Integer  │ gpx:dgpsStationType    │   [0 … 1]   │
-         * └───────────────┴──────────┴────────────────────────┴─────────────┘
+         * ┌───────────────┬────────────────┬────────────────────────┬─────────────┐
+         * │ Name          │ Type           │ XML type               │ Cardinality │
+         * ├───────────────┼────────────────┼────────────────────────┼─────────────┤
+         * │ @identifier   │ Integer        │                        │   [1 … 1]   │
+         * │ @envelope     │ Envelope       │                        │   [1 … 1]   │
+         * │ @geometry     │ Point          │ (lat,lon) attributes   │   [1 … 1]   │
+         * │ ele           │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ time          │ Temporal       │ xsd:dateTime           │   [0 … 1]   │
+         * │ magvar        │ Double         │ gpx:degreesType        │   [0 … 1]   │
+         * │ geoidheight   │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ name          │ String         │ xsd:string             │   [0 … 1]   │
+         * │ cmt           │ String         │ xsd:string             │   [0 … 1]   │
+         * │ desc          │ String         │ xsd:string             │   [0 … 1]   │
+         * │ src           │ String         │ xsd:string             │   [0 … 1]   │
+         * │ link          │ OnlineResource │ gpx:linkType           │   [0 … ∞]   │
+         * │ sym           │ String         │ xsd:string             │   [0 … 1]   │
+         * │ type          │ String         │ xsd:string             │   [0 … 1]   │
+         * │ fix           │ String         │ gpx:fixType            │   [0 … 1]   │
+         * │ sat           │ Integer        │ xsd:nonNegativeInteger │   [0 … 1]   │
+         * │ hdop          │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ vdop          │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ pdop          │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ ageofdgpsdata │ Double         │ xsd:decimal            │   [0 … 1]   │
+         * │ dgpsid        │ Integer        │ gpx:dgpsStationType    │   [0 … 1]   │
+         * └───────────────┴────────────────┴────────────────────────┴─────────────┘
          */
         builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(NAMESPACE).setName("WayPoint");
+        builder.setDefaultScope(Tags.NAMESPACE).setName("WayPoint");
         builder.addAttribute(Point.class).setName(geomName)
                 .setCRS(CommonCRS.WGS84.normalizedGeographic())
                 .addRole(AttributeRole.DEFAULT_GEOMETRY);
         builder.setDefaultCardinality(0, 1);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_ELE);
-        builder.addAttribute(Temporal.class).setName(TAG_WPT_TIME);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_MAGVAR);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_GEOIHEIGHT);
-        builder.addAttribute(String  .class).setName(TAG_NAME);
-        builder.addAttribute(String  .class).setName(TAG_CMT);
-        builder.addAttribute(String  .class).setName(TAG_DESC);
-        builder.addAttribute(String  .class).setName(TAG_SRC);
-        builder.addAttribute(URI     .class).setName(TAG_LINK).setMaximumOccurs(Integer.MAX_VALUE);
-        builder.addAttribute(String  .class).setName(TAG_WPT_SYM);
-        builder.addAttribute(String  .class).setName(TAG_TYPE);
-        builder.addAttribute(String  .class).setName(TAG_WPT_FIX);
-        builder.addAttribute(Integer .class).setName(TAG_WPT_SAT);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_HDOP);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_VDOP);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_PDOP);
-        builder.addAttribute(Double  .class).setName(TAG_WPT_AGEOFGPSDATA);
-        builder.addAttribute(Integer .class).setName(TAG_WPT_DGPSID);
+        builder.addAttribute(Double        .class).setName(Tags.ELEVATION);
+        builder.addAttribute(Temporal      .class).setName(Tags.TIME);
+        builder.addAttribute(Double        .class).setName(Tags.MAGNETIC_VAR);
+        builder.addAttribute(Double        .class).setName(Tags.GEOID_HEIGHT);
+        builder.addAttribute(String        .class).setName(Tags.NAME);
+        builder.addAttribute(String        .class).setName(Tags.COMMENT);
+        builder.addAttribute(String        .class).setName(Tags.DESCRIPTION);
+        builder.addAttribute(String        .class).setName(Tags.SOURCE);
+        builder.addAttribute(OnlineResource.class).setName(Tags.LINK).setMaximumOccurs(Integer.MAX_VALUE);
+        builder.addAttribute(String        .class).setName(Tags.SYMBOL);
+        builder.addAttribute(String        .class).setName(Tags.TYPE);
+        builder.addAttribute(String        .class).setName(Tags.FIX);
+        builder.addAttribute(Integer       .class).setName(Tags.SATELITTES);
+        builder.addAttribute(Double        .class).setName(Tags.HDOP);
+        builder.addAttribute(Double        .class).setName(Tags.VDOP);
+        builder.addAttribute(Double        .class).setName(Tags.PDOP);
+        builder.addAttribute(Double        .class).setName(Tags.AGE_OF_GPS_DATA);
+        builder.addAttribute(Integer       .class).setName(Tags.DGPS_ID);
         wayPoint = builder.build();
         /*
          * http://www.topografix.com:Route ⇾ GPXEntity
-         * ┌─────────────┬──────────┬────────────────────────┬─────────────┐
-         * │ Name        │ Type     │ XML type               │ Cardinality │
-         * ├─────────────┼──────────┼────────────────────────┼─────────────┤
-         * │ @identifier │ Integer  │                        │   [1 … 1]   │
-         * │ @envelope   │ Envelope │                        │   [1 … 1]   │
-         * │ @geometry   │ Polyline │                        │   [1 … 1]   │
-         * │ name        │ String   │ xsd:string             │   [0 … 1]   │
-         * │ cmt         │ String   │ xsd:string             │   [0 … 1]   │
-         * │ desc        │ String   │ xsd:string             │   [0 … 1]   │
-         * │ src         │ String   │ xsd:string             │   [0 … 1]   │
-         * │ link        │ URI      │ gpx:linkType           │   [0 … ∞]   │
-         * │ number      │ Integer  │ xsd:nonNegativeInteger │   [0 … 1]   │
-         * │ type        │ String   │ xsd:string             │   [0 … 1]   │
-         * │ rtept       │ WayPoint │ gpx:wptType            │   [0 … ∞]   │
-         * └─────────────┴──────────┴────────────────────────┴─────────────┘
+         * ┌─────────────┬────────────────┬────────────────────────┬─────────────┐
+         * │ Name        │ Type           │ XML type               │ Cardinality │
+         * ├─────────────┼────────────────┼────────────────────────┼─────────────┤
+         * │ @identifier │ Integer        │                        │   [1 … 1]   │
+         * │ @envelope   │ Envelope       │                        │   [1 … 1]   │
+         * │ @geometry   │ Polyline       │                        │   [1 … 1]   │
+         * │ name        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ cmt         │ String         │ xsd:string             │   [0 … 1]   │
+         * │ desc        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ src         │ String         │ xsd:string             │   [0 … 1]   │
+         * │ link        │ OnlineResource │ gpx:linkType           │   [0 … ∞]   │
+         * │ number      │ Integer        │ xsd:nonNegativeInteger │   [0 … 1]   │
+         * │ type        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ rtept       │ WayPoint       │ gpx:wptType            │   [0 … ∞]   │
+         * └─────────────┴────────────────┴────────────────────────┴─────────────┘
          */
-        GroupAsPolylineOperation groupOp = new GroupPointsAsPolylineOperation(geomInfo, TAG_RTE_RTEPT, geomName.toString());
+        GroupAsPolylineOperation groupOp = new GroupPointsAsPolylineOperation(geomInfo, Tags.ROUTE_POINTS);
         builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(NAMESPACE).setName("Route");
+        builder.setDefaultScope(Tags.NAMESPACE).setName("Route");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
-        builder.addProperty(wayPoint.getProperty(TAG_NAME));
-        builder.addProperty(wayPoint.getProperty(TAG_CMT));
-        builder.addProperty(wayPoint.getProperty(TAG_DESC));
-        builder.addProperty(wayPoint.getProperty(TAG_SRC));
-        builder.addProperty(wayPoint.getProperty(TAG_LINK));
-        builder.addAttribute(Integer.class).setName(TAG_NUMBER);
-        builder.addProperty(wayPoint.getProperty(TAG_TYPE));
-        builder.addAssociation(wayPoint).setName(TAG_RTE_RTEPT).setMaximumOccurs(Integer.MAX_VALUE);
+        builder.addProperty(wayPoint.getProperty(Tags.NAME));
+        builder.addProperty(wayPoint.getProperty(Tags.COMMENT));
+        builder.addProperty(wayPoint.getProperty(Tags.DESCRIPTION));
+        builder.addProperty(wayPoint.getProperty(Tags.SOURCE));
+        builder.addProperty(wayPoint.getProperty(Tags.LINK));
+        builder.addAttribute(Integer.class).setName(Tags.NUMBER);
+        builder.addProperty(wayPoint.getProperty(Tags.TYPE));
+        builder.addAssociation(wayPoint).setName(Tags.ROUTE_POINTS).setMaximumOccurs(Integer.MAX_VALUE);
         route = builder.build();
         /*
          * http://www.topografix.com:TrackSegment ⇾ GPXEntity
@@ -209,46 +207,46 @@ final class Types extends Static {
          * │ trkpt       │ WayPoint │ gpx:wptType │   [0 … ∞]   │
          * └─────────────┴──────────┴─────────────┴─────────────┘
          */
-        groupOp = new GroupPointsAsPolylineOperation(geomInfo, TAG_TRK_SEG_PT, geomName.toString());
+        groupOp = new GroupPointsAsPolylineOperation(geomInfo, Tags.TRACK_POINTS);
         builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(NAMESPACE).setName("TrackSegment");
+        builder.setDefaultScope(Tags.NAMESPACE).setName("TrackSegment");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
-        builder.addAssociation(wayPoint).setName(TAG_TRK_SEG_PT).setMaximumOccurs(Integer.MAX_VALUE);
+        builder.addAssociation(wayPoint).setName(Tags.TRACK_POINTS).setMaximumOccurs(Integer.MAX_VALUE);
         trackSegment = builder.build();
         /*
          * http://www.topografix.com:Track ⇾ GPXEntity
-         * ┌─────────────┬──────────────┬────────────────────────┬─────────────┐
-         * │ Name        │ Type         │ XML type               │ Cardinality │
-         * ├─────────────┼──────────────┼────────────────────────┼─────────────┤
-         * │ @identifier │ Integer      │                        │   [1 … 1]   │
-         * │ @envelope   │ Envelope     │                        │   [1 … 1]   │
-         * │ @geometry   │ Polyline     │                        │   [1 … 1]   │
-         * │ name        │ String       │ xsd:string             │   [0 … 1]   │
-         * │ cmt         │ String       │ xsd:string             │   [0 … 1]   │
-         * │ desc        │ String       │ xsd:string             │   [0 … 1]   │
-         * │ src         │ String       │ xsd:string             │   [0 … 1]   │
-         * │ link        │ URI          │ gpx:linkType           │   [0 … ∞]   │
-         * │ number      │ Integer      │ xsd:nonNegativeInteger │   [0 … 1]   │
-         * │ type        │ String       │ xsd:string             │   [0 … 1]   │
-         * │ trkseg      │ TrackSegment │ gpx:trksegType         │   [0 … ∞]   │
-         * └─────────────┴──────────────┴────────────────────────┴─────────────┘
+         * ┌─────────────┬────────────────┬────────────────────────┬─────────────┐
+         * │ Name        │ Type           │ XML type               │ Cardinality │
+         * ├─────────────┼────────────────┼────────────────────────┼─────────────┤
+         * │ @identifier │ Integer        │                        │   [1 … 1]   │
+         * │ @envelope   │ Envelope       │                        │   [1 … 1]   │
+         * │ @geometry   │ Polyline       │                        │   [1 … 1]   │
+         * │ name        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ cmt         │ String         │ xsd:string             │   [0 … 1]   │
+         * │ desc        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ src         │ String         │ xsd:string             │   [0 … 1]   │
+         * │ link        │ OnlineResource │ gpx:linkType           │   [0 … ∞]   │
+         * │ number      │ Integer        │ xsd:nonNegativeInteger │   [0 … 1]   │
+         * │ type        │ String         │ xsd:string             │   [0 … 1]   │
+         * │ trkseg      │ TrackSegment   │ gpx:trksegType         │   [0 … ∞]   │
+         * └─────────────┴────────────────┴────────────────────────┴─────────────┘
          */
-        groupOp = new GroupAsPolylineOperation(geomInfo, TAG_TRK_SEG, geomName.toString());
+        groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_SEGMENTS);
         builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(NAMESPACE).setName("Track");
+        builder.setDefaultScope(Tags.NAMESPACE).setName("Track");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
-        builder.addProperty(route.getProperty(TAG_NAME));
-        builder.addProperty(route.getProperty(TAG_CMT));
-        builder.addProperty(route.getProperty(TAG_DESC));
-        builder.addProperty(route.getProperty(TAG_SRC));
-        builder.addProperty(route.getProperty(TAG_LINK));
-        builder.addProperty(route.getProperty(TAG_NUMBER));
-        builder.addProperty(route.getProperty(TAG_TYPE));
-        builder.addAssociation(trackSegment).setName(TAG_TRK_SEG).setMaximumOccurs(Integer.MAX_VALUE);
+        builder.addProperty(route.getProperty(Tags.NAME));
+        builder.addProperty(route.getProperty(Tags.COMMENT));
+        builder.addProperty(route.getProperty(Tags.DESCRIPTION));
+        builder.addProperty(route.getProperty(Tags.SOURCE));
+        builder.addProperty(route.getProperty(Tags.LINK));
+        builder.addProperty(route.getProperty(Tags.NUMBER));
+        builder.addProperty(route.getProperty(Tags.TYPE));
+        builder.addAssociation(trackSegment).setName(Tags.TRACK_SEGMENTS).setMaximumOccurs(Integer.MAX_VALUE);
         track = builder.build();
     }
 }

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=1773845&r1=1773844&r2=1773845&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] Mon Dec 12 18:40:26 2016
@@ -63,8 +63,8 @@
  * @version 0.8
  * @module
  */
-@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Constants.NAMESPACE_V11, xmlns = {
-    @XmlNs(prefix = "gpx", namespaceURI = Constants.NAMESPACE_V11)
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Tags.NAMESPACE_V11, xmlns = {
+    @XmlNs(prefix = "gpx", namespaceURI = Tags.NAMESPACE_V11)
 })
 package org.apache.sis.internal.gpx;
 

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=1773845&r1=1773844&r2=1773845&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] Mon Dec 12 18:40:26 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.internal.gpx;
 
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -107,7 +106,8 @@ public class GPXReaderTest extends TestC
 
             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("http://www.gnu.org/licenses/lgpl-3.0-standalone.html",
+                         data.copyright.license.getLinkage().toString());
 
             assertEquals(3, data.links.size());
             assertEquals("http://first-adress.org", data.links.get(0).toString());
@@ -203,7 +203,7 @@ public class GPXReaderTest extends TestC
             assertEquals("route type",          f.getPropertyValue("type"));
             assertEquals(7,                     f.getPropertyValue("number"));
 
-            List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(1,links.size());
             assertEquals("http://route-adress1.org", links.get(0).toString());
 
@@ -228,7 +228,7 @@ public class GPXReaderTest extends TestC
             assertEquals(null,                  f.getPropertyValue("type"));
             assertEquals(null,                  f.getPropertyValue("number"));
 
-            links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(0,links.size());
 
             points = new ArrayList<>((Collection<Feature>) f.getPropertyValue("rtept"));
@@ -268,7 +268,7 @@ public class GPXReaderTest extends TestC
             assertEquals("route type",          f.getPropertyValue("type"));
             assertEquals(7,                     f.getPropertyValue("number"));
 
-            List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(3,links.size());
             assertEquals("http://route-adress1.org", links.get(0).toString());
             assertEquals("http://route-adress2.org", links.get(1).toString());
@@ -295,7 +295,7 @@ public class GPXReaderTest extends TestC
             assertEquals(null,                  f.getPropertyValue("type"));
             assertEquals(null,                  f.getPropertyValue("number"));
 
-            links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(0,links.size());
 
             points = new ArrayList<>((Collection<Feature>) f.getPropertyValue("rtept"));
@@ -335,7 +335,7 @@ public class GPXReaderTest extends TestC
             assertEquals("track type",          f.getPropertyValue("type"));
             assertEquals(7,                     f.getPropertyValue("number"));
 
-            List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(1,links.size());
             assertEquals("http://track-adress1.org", links.get(0).toString());
 
@@ -365,7 +365,7 @@ public class GPXReaderTest extends TestC
             assertEquals(null,                  f.getPropertyValue("type"));
             assertEquals(null,                  f.getPropertyValue("number"));
 
-            links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(0,links.size());
 
             segments = new ArrayList<>((Collection<Feature>) f.getPropertyValue("trkseg"));
@@ -405,7 +405,7 @@ public class GPXReaderTest extends TestC
             assertEquals("track type",          f.getPropertyValue("type"));
             assertEquals(7,                     f.getPropertyValue("number"));
 
-            List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(3,links.size());
             assertEquals("http://track-adress1.org", links.get(0).toString());
             assertEquals("http://track-adress2.org", links.get(1).toString());
@@ -437,7 +437,7 @@ public class GPXReaderTest extends TestC
             assertEquals(null,                  f.getPropertyValue("type"));
             assertEquals(null,                  f.getPropertyValue("number"));
 
-            links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(0,links.size());
 
             segments = new ArrayList<>((Collection<Feature>) f.getPropertyValue("trkseg"));
@@ -474,7 +474,7 @@ public class GPXReaderTest extends TestC
             assertEquals(55.55,                 f.getPropertyValue("ageofdgpsdata"));
             assertEquals(256,                   f.getPropertyValue("dgpsid"));
 
-            final List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            final List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             if (v11) {
                 assertEquals(3,links.size());
                 assertEquals("http://first-adress1.org", links.get(0).toString());
@@ -513,7 +513,7 @@ public class GPXReaderTest extends TestC
             assertEquals(null,                  f.getPropertyValue("ageofdgpsdata"));
             assertEquals(null,                  f.getPropertyValue("dgpsid"));
 
-            final List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            final List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             assertEquals(0,links.size());
 
             final Envelope bbox = (Envelope) f.getPropertyValue("@envelope");
@@ -544,7 +544,7 @@ public class GPXReaderTest extends TestC
             assertEquals(85.55,                 f.getPropertyValue("ageofdgpsdata"));
             assertEquals(456,                   f.getPropertyValue("dgpsid"));
 
-            final List<URI> links = new ArrayList<>((Collection<URI>) f.getPropertyValue("link"));
+            final List<Link> links = new ArrayList<>((Collection<Link>) f.getPropertyValue("link"));
             if (v11) {
                 assertEquals(2,links.size());
                 assertEquals("http://third-adress1.org", links.get(0).toString());

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=1773845&r1=1773844&r2=1773845&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] Mon Dec 12 18:40:26 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.internal.gpx;
 
 import java.io.File;
-import java.net.URI;
 import java.time.Instant;
 import java.time.LocalDate;
 import java.util.ArrayList;
@@ -71,12 +70,12 @@ public final strictfp class GPXWriterTes
         final Person person = new Person();
         person.name = "Jean-Pierre";
         person.email = "jean-pierre@test.com";
-        person.link = new URI("http://son-site.com");
+        person.link = new Link("http://son-site.com");
 
         final Copyright copyright = new Copyright();
         copyright.author = "GNU";
         copyright.year = 2010;
-        copyright.license = new URI("http://gnu.org");
+        copyright.license = new Link("http://gnu.org");
 
         final GeographicBoundingBox bounds = new DefaultGeographicBoundingBox(-10, 20, -30, 40);
 
@@ -85,7 +84,7 @@ public final strictfp class GPXWriterTes
         metaData.description = "description";
         metaData.author = person;
         metaData.copyright = copyright;
-        metaData.links.addAll(Arrays.asList(new URI("http://adress1.org"),new URI("http://adress2.org")));
+        metaData.links.addAll(Arrays.asList(new Link("http://adress1.org"), new Link("http://adress2.org")));
         metaData.time = Instant.now();
         metaData.keywords = "test,sample";
         metaData.bounds = bounds;
@@ -128,7 +127,7 @@ public final strictfp class GPXWriterTes
         point1.setPropertyValue("cmt", "fdrt");
         point1.setPropertyValue("desc", "ffe");
         point1.setPropertyValue("src", "aaz");
-        point1.setPropertyValue("link", Collections.singletonList(new URI("http://test.com")));
+        point1.setPropertyValue("link", Collections.singletonList(new Link("http://test.com")));
         point1.setPropertyValue("sym", "fdsg");
         point1.setPropertyValue("type", "klj");
         point1.setPropertyValue("fix", "yy");
@@ -149,7 +148,7 @@ public final strictfp class GPXWriterTes
         point2.setPropertyValue("cmt", "fdrt");
         point2.setPropertyValue("desc", "ffe");
         point2.setPropertyValue("src", "aaz");
-        point2.setPropertyValue("link", Collections.singletonList(new URI("http://test.com")));
+        point2.setPropertyValue("link", Collections.singletonList(new Link("http://test.com")));
         point2.setPropertyValue("sym", "fdsg");
         point2.setPropertyValue("type", "klj");
         point2.setPropertyValue("fix", "yy");
@@ -170,7 +169,7 @@ public final strictfp class GPXWriterTes
         point3.setPropertyValue("cmt", "fdrt");
         point3.setPropertyValue("desc", "ffe");
         point3.setPropertyValue("src", "aaz");
-        point3.setPropertyValue("link", Collections.singletonList(new URI("http://test.com")));
+        point3.setPropertyValue("link", Collections.singletonList(new Link("http://test.com")));
         point3.setPropertyValue("sym", "fdsg");
         point3.setPropertyValue("type", "klj");
         point3.setPropertyValue("fix", "yy");
@@ -193,7 +192,7 @@ public final strictfp class GPXWriterTes
         route1.setPropertyValue("cmt", "cc");
         route1.setPropertyValue("desc", "des");
         route1.setPropertyValue("src", "src");
-        route1.setPropertyValue("link", Collections.singletonList(new URI("http://test.com")));
+        route1.setPropertyValue("link", Collections.singletonList(new Link("http://test.com")));
         route1.setPropertyValue("number", 15);
         route1.setPropertyValue("type", "test");
         route1.setPropertyValue("rtept", wayPoints);
@@ -203,7 +202,7 @@ public final strictfp class GPXWriterTes
         route2.setPropertyValue("cmt", "cc2");
         route2.setPropertyValue("desc", "des2");
         route2.setPropertyValue("src", "src2");
-        route2.setPropertyValue("link", Collections.singletonList(new URI("http://test2.com")));
+        route2.setPropertyValue("link", Collections.singletonList(new Link("http://test2.com")));
         route2.setPropertyValue("number", 15);
         route2.setPropertyValue("type", "test2");
         route2.setPropertyValue("rtept", wayPoints);
@@ -230,7 +229,7 @@ public final strictfp class GPXWriterTes
         track1.setPropertyValue("cmt", "cc");
         track1.setPropertyValue("desc", "des");
         track1.setPropertyValue("src", "src");
-        track1.setPropertyValue("link", Collections.singletonList(new URI("http://test4.com")));
+        track1.setPropertyValue("link", Collections.singletonList(new Link("http://test4.com")));
         track1.setPropertyValue("number", 15);
         track1.setPropertyValue("type", "test");
         track1.setPropertyValue("trkseg", segments);
@@ -240,7 +239,7 @@ public final strictfp class GPXWriterTes
         track2.setPropertyValue("cmt", "cc2");
         track2.setPropertyValue("desc", "des2");
         track2.setPropertyValue("src", "src2");
-        track2.setPropertyValue("link", Collections.singletonList(new URI("http://test5.com")));
+        track2.setPropertyValue("link", Collections.singletonList(new Link("http://test5.com")));
         track2.setPropertyValue("number", 15);
         track2.setPropertyValue("type", "test2");
         track2.setPropertyValue("trkseg", segments);



Mime
View raw message