sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1795621 - in /sis/trunk/core: sis-feature/src/main/java/org/apache/sis/feature/ sis-utility/src/main/java/org/apache/sis/internal/jaxb/
Date Fri, 19 May 2017 16:33:26 GMT
Author: desruisseaux
Date: Fri May 19 16:33:26 2017
New Revision: 1795621

URL: http://svn.apache.org/viewvc?rev=1795621&view=rev
Log:
IdentifierMap entries should extend ReferenceIdentifier (on trunk depending of GeoAPI 3.0;
not needed on branches depensing on GeoAPI 3.1).

Modified:
    sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java?rev=1795621&r1=1795620&r2=1795621&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
[UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
[UTF-8] Fri May 19 16:33:26 2017
@@ -27,8 +27,6 @@ import org.apache.sis.util.Unconvertible
 import org.apache.sis.util.collection.WeakHashSet;
 import org.apache.sis.util.resources.Errors;
 
-// Branch-dependent imports
-
 
 /**
  * A set of pre-defined operations expecting a {@code Feature} as input and producing an
{@code Attribute} as output.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java?rev=1795621&r1=1795620&r2=1795621&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
[UTF-8] Fri May 19 16:33:26 2017
@@ -19,6 +19,10 @@ package org.apache.sis.internal.jaxb;
 import java.util.AbstractMap;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
+import org.apache.sis.internal.util.Citations;
+
+// Branch-dependent imports
+import org.opengis.referencing.ReferenceIdentifier;
 
 
 /**
@@ -31,7 +35,7 @@ import org.opengis.metadata.citation.Cit
  * @since   0.3
  * @module
  */
-final class IdentifierMapEntry extends AbstractMap.SimpleEntry<Citation,String> implements
Identifier {
+final class IdentifierMapEntry extends AbstractMap.SimpleEntry<Citation,String> implements
ReferenceIdentifier {
     /**
      * For cross-version compatibility.
      */
@@ -61,6 +65,30 @@ final class IdentifierMapEntry extends A
     }
 
     /**
+     * Infers a code space from the authority.
+     *
+     * @return the code space, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    @Override
+    public String getCodeSpace() {
+        return Citations.getCodeSpace(getAuthority());
+    }
+
+    /**
+     * Returns {@code null} since this class does not hold version information.
+     *
+     * @return {@code null}.
+     *
+     * @since 0.5
+     */
+    @Override
+    public String getVersion() {
+        return null;
+    }
+
+    /**
      * Same than the above, but as an immutable entry. We use this implementation when the
      * entry has been created on-the-fly at iteration time rather than being stored in the
      * identifier collection.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1795621&r1=1795620&r2=1795621&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
[UTF-8] Fri May 19 16:33:26 2017
@@ -22,7 +22,6 @@ import java.util.UUID;
 import java.util.Objects;
 import java.io.Serializable;
 import java.util.logging.Level;
-import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.xml.XLink;
 import org.apache.sis.xml.IdentifierMap;
@@ -32,6 +31,9 @@ import org.apache.sis.util.Debug;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.internal.util.Citations;
 
+// Branch-dependent imports
+import org.opengis.referencing.ReferenceIdentifier;
+
 
 /**
  * Wraps a {@link XLink}, {@link URI} or {@link UUID} as an identifier in the {@link IdentifierMap}.
@@ -46,7 +48,7 @@ import org.apache.sis.internal.util.Cita
  * @since 0.3
  * @module
  */
-public final class SpecializedIdentifier<T> implements Identifier, Cloneable, Serializable
{
+public final class SpecializedIdentifier<T> implements ReferenceIdentifier, Cloneable,
Serializable {
     /**
      * For cross-version compatibility.
      */
@@ -95,7 +97,7 @@ public final class SpecializedIdentifier
      *
      * @see IdentifierMapAdapter#put(Citation, String)
      */
-    static Identifier parse(final Citation authority, final String code) {
+    static ReferenceIdentifier parse(final Citation authority, final String code) {
         if (authority instanceof NonMarshalledAuthority) {
             final int ordinal = ((NonMarshalledAuthority) authority).ordinal;
             switch (ordinal) {
@@ -186,6 +188,30 @@ public final class SpecializedIdentifier
     }
 
     /**
+     * Infers a code space from the authority.
+     *
+     * @return the code space, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    @Override
+    public String getCodeSpace() {
+        return Citations.getCodeSpace(authority);
+    }
+
+    /**
+     * Returns {@code null} since this class does not hold version information.
+     *
+     * @return {@code null}.
+     *
+     * @since 0.5
+     */
+    @Override
+    public String getVersion() {
+        return null;
+    }
+
+    /**
      * Returns a hash code value for this identifier.
      */
     @Override



Mime
View raw message