sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1627310 - in /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd: CodeListAdapter.java CodeListProxy.java
Date Wed, 24 Sep 2014 13:22:28 GMT
Author: desruisseaux
Date: Wed Sep 24 13:22:27 2014
New Revision: 1627310

URL: http://svn.apache.org/r1627310
Log:
Minor anticipation on GEO-199 resolution (replacement of 2 CodeList by Enum).

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java?rev=1627310&r1=1627309&r2=1627310&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java
[UTF-8] Wed Sep 24 13:22:27 2014
@@ -121,8 +121,15 @@ public abstract class CodeListAdapter<Va
         if (value == null) {
             return null;
         }
-        return wrap(isEnum() ? new CodeListProxy(Types.getCodeName(value))
-                             : new CodeListProxy(Context.current(), value));
+        final CodeListProxy p;
+        if (isEnum()) {
+            // To be removed after GEO-199 resolution.
+            p = new CodeListProxy();
+            p.value = Types.getCodeName(value);
+        } else {
+            p = new CodeListProxy(Context.current(), value);
+        }
+        return wrap(p);
     }
 
     /**
@@ -130,6 +137,11 @@ public abstract class CodeListAdapter<Va
      * returns {@code false} in every cases, since there is very few enums in ISO 19115.
      *
      * @return {@code true} if this code list is actually an enum.
+     *
+     * @todo Remove this method after we refactored enum wrappers as {@link EnumAdapter}
subclasses
+     *       instead of {@code CodeListAdapter}. This requires the resolution of GEO-199
first.
+     *
+     * @see <a href="http://jira.codehaus.org/browse/GEO-199">GEO-199</a>
      */
     protected boolean isEnum() {
         return false;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java?rev=1627310&r1=1627309&r2=1627310&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListProxy.java
[UTF-8] Wed Sep 24 13:22:27 2014
@@ -103,20 +103,6 @@ public final class CodeListProxy {
     }
 
     /**
-     * Creates a new code list for the given enum.
-     *
-     * @param value The ISO 19115 identifier of the enum.
-     *
-     * @todo Replace the argument type by {@link Enum} if we fix the type of ISO 19115
-     *       code lists which are supposed to be enum.
-     *
-     * @see <a href="http://jira.codehaus.org/browse/GEO-199">GEO-199</a>
-     */
-    CodeListProxy(final String value) {
-        this.value = value;
-    }
-
-    /**
      * Builds a code list with the given attributes.
      *
      * @param context       The current (un)marshalling context, or {@code null} if none.



Mime
View raw message