sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1548703 - in /sis/branches/JDK7/core: sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ sis-utility/src/main/java/org/apache/sis/internal/jaxb/
Date Fri, 06 Dec 2013 19:51:24 GMT
Author: desruisseaux
Date: Fri Dec  6 19:51:23 2013
New Revision: 1548703

URL: http://svn.apache.org/r1548703
Log:
Remove the JAXB elements for GML 3.1 namespace.

Removed:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant31.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriod31.java
Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/GM_Object.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/GM_Object.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/GM_Object.java?rev=1548703&r1=1548702&r2=1548703&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/GM_Object.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/GM_Object.java
[UTF-8] Fri Dec  6 19:51:23 2013
@@ -21,13 +21,11 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.geometry.Geometry;
 import org.apache.sis.xml.Namespaces;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 
 
 /**
- * JAXB adapter for {@link Geometry}, in order to integrate the value in an element
- * complying with OGC/ISO standard. The geometry values are covered by a {@code gml:**}
- * element
+ * JAXB adapter for {@link Geometry}, in order to integrate the value in an element complying
with OGC/ISO standard.
+ * The geometry element names are usually prefixed by {@code gml:}.
  *
  * <p>The default implementation does almost nothing. The geometry objects will <strong>not</strong>
  * create the expected {@link JAXBElement} type. This class is only a hook to be extended
by more
@@ -46,14 +44,6 @@ public class GM_Object extends XmlAdapte
     protected JAXBElement<? extends Geometry> geometry;
 
     /**
-     * Same as {@link #geometry}, but using GML 3.1 namespace.
-     * This is hopefully a temporary patch.
-     */
-    @Deprecated
-    @XmlElementRef(name = "AbstractGeometry", namespace = LegacyNamespaces.GML_IN_JAXB, type
= JAXBElement.class)
-    protected JAXBElement<? extends Geometry> geometry31;
-
-    /**
      * Empty constructor for JAXB and subclasses only.
      */
     public GM_Object() {
@@ -69,10 +59,7 @@ public class GM_Object extends XmlAdapte
     @Override
     public final Geometry unmarshal(final GM_Object value) {
         if (value != null) {
-            JAXBElement<? extends Geometry> g = value.geometry;
-            if (g == null) {
-                g = value.geometry31;
-            }
+            final JAXBElement<? extends Geometry> g = value.geometry;
             if (g != null) {
                 return g.getValue();
             }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java?rev=1548703&r1=1548702&r2=1548703&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java
[UTF-8] Fri Dec  6 19:51:23 2013
@@ -20,7 +20,6 @@ import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.XmlElementDecl;
 import javax.xml.bind.annotation.XmlRegistry;
 import javax.xml.namespace.QName;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.util.Workaround;
 
@@ -40,20 +39,17 @@ public class ObjectFactory {
     /**
      * The qualified name of {@code <AbstractGeometry>}.
      */
-    protected static final QName AbstractGeometry_QNAME   = new QName(Namespaces.GML, "AbstractGeometry"),
-                                 AbstractGeometry31_QNAME = new QName(LegacyNamespaces.GML_IN_JAXB,
"AbstractGeometry");
+    protected static final QName AbstractGeometry_QNAME   = new QName(Namespaces.GML, "AbstractGeometry");
 
     /**
      * The qualified name of {@code <AbstractGML>}.
      */
-    protected static final QName AbstractGML_QNAME   = new QName(Namespaces.GML, "AbstractGML"),
-                                 AbstractGML31_QNAME = new QName(LegacyNamespaces.GML_IN_JAXB,
"AbstractGML");
+    protected static final QName AbstractGML_QNAME   = new QName(Namespaces.GML, "AbstractGML");
 
     /**
      * The qualified name of {@code <AbstractObject>}.
      */
-    protected static final QName AbstractObject_QNAME   = new QName(Namespaces.GML, "AbstractObject"),
-                                 AbstractObject31_QNAME = new QName(LegacyNamespaces.GML_IN_JAXB,
"AbstractObject");
+    protected static final QName AbstractObject_QNAME   = new QName(Namespaces.GML, "AbstractObject");
 
     /**
      * Creates an instance of {@code JAXBElement<Object>}}.
@@ -67,18 +63,6 @@ public class ObjectFactory {
     }
 
     /**
-     * A {@link #createObject(Object)} version for the legacy GML namespace.
-     *
-     * @param  value The {@code Object} value to wrap.
-     * @return The wrapped value in the legacy namespace.
-     */
-    @Deprecated
-    @XmlElementDecl(name = "AbstractObject", namespace = LegacyNamespaces.GML_IN_JAXB)
-    public JAXBElement<Object> createObject31(final Object value) {
-        return new JAXBElement<>(AbstractObject31_QNAME, Object.class, null, value);
-    }
-
-    /**
      * Create an instance of {@code JAXBElement<AbstractGMLType>}}.
      * The type declared in the method signature should be {@code AbstractGMLType}.
      * However it is declared here as {@code Object} in order to avoid a dependency
@@ -97,22 +81,6 @@ public class ObjectFactory {
     }
 
     /**
-     * A {@link #createAbstractGML(Object)} version for the legacy GML namespace.
-     *
-     * @param  value The GML {@code AbstractGMLType} value to wrap.
-     * @return The wrapped value in the legacy namespace.
-     */
-    @Deprecated
-    @Workaround(library = "JAXB", version = "2.1")
-    @XmlElementDecl(name = "AbstractGML",
-            namespace = LegacyNamespaces.GML_IN_JAXB,
-            substitutionHeadName = "AbstractObject",
-            substitutionHeadNamespace = LegacyNamespaces.GML_IN_JAXB) // Not necessary according
javadoc, but appears to be in practice (JAXB 2.1 bug?)
-    public JAXBElement<Object> createAbstractGML31(final Object value) {
-        return new JAXBElement<>(AbstractGML31_QNAME, Object.class, null, value);
-    }
-
-    /**
      * Create an instance of {@code JAXBElement<AbstractGeometryType>}}.
      * The type declared in the method signature should be {@code AbstractGeometryType}.
      * However it is declared here as {@code Object} in order to avoid a dependency
@@ -129,20 +97,4 @@ public class ObjectFactory {
     public JAXBElement<Object> createAbstractGeometry(final Object value) {
         return new JAXBElement<>(AbstractGeometry_QNAME, Object.class, null, value);
     }
-
-    /**
-     * A {@link #createAbstractGeometry(Object)} version for the legacy GML namespace.
-     *
-     * @param  value The {@code AbstractGeometryType} value to wrap.
-     * @return The wrapped value in the legacy namespace.
-     */
-    @Deprecated
-    @Workaround(library = "JAXB", version = "2.1")
-    @XmlElementDecl(name = "AbstractGeometry",
-            namespace = LegacyNamespaces.GML_IN_JAXB,
-            substitutionHeadName = "AbstractGML",
-            substitutionHeadNamespace = LegacyNamespaces.GML_IN_JAXB) // Not necessary according
javadoc, but appears to be in practice (JAXB 2.1 bug?)
-    public JAXBElement<Object> createAbstractGeometry31(final Object value) {
-        return new JAXBElement<>(AbstractGeometry31_QNAME, Object.class, null, value);
-    }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java?rev=1548703&r1=1548702&r2=1548703&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
[UTF-8] Fri Dec  6 19:51:23 2013
@@ -105,23 +105,6 @@ public final class TM_Primitive extends 
     }
 
     /**
-     * Same as {@link #getTimePeriod()}, but using the GML 3.1 namespace.
-     *
-     * @return The time period, or {@code null}.
-     */
-    @Deprecated
-    @XmlElement(name = "TimePeriod", namespace = LegacyNamespaces.GML_IN_JAXB)
-    public TimePeriod31 getTimePeriod31() {
-        if (!skip() && !isGML32()) {
-            final TemporalPrimitive metadata = this.metadata;
-            if (metadata instanceof Period) {
-                return new TimePeriod31((Period) metadata);
-            }
-        }
-        return null;
-    }
-
-    /**
      * Returns the {@link TimeInstant} generated from the metadata value.
      * This method is systematically called at marshalling-time by JAXB.
      *
@@ -139,23 +122,6 @@ public final class TM_Primitive extends 
     }
 
     /**
-     * Same as {@link #getTimeInstant()}, but using the GML 3.1 namespace.
-     *
-     * @return The time instant, or {@code null}.
-     */
-    @Deprecated
-    @XmlElement(name = "TimeInstant", namespace = LegacyNamespaces.GML_IN_JAXB)
-    public TimeInstant31 getTimeInstant31() {
-        if (!skip() && !isGML32()) {
-            final TemporalPrimitive metadata = this.metadata;
-            if (metadata instanceof Instant) {
-                return new TimeInstant31((Instant) metadata);
-            }
-        }
-        return null;
-    }
-
-    /**
      * Sets the value from the {@link TimePeriod}.
      * This method is called at unmarshalling-time by JAXB.
      *
@@ -187,21 +153,6 @@ public final class TM_Primitive extends 
     }
 
     /**
-     * Same as {@link #setTimePeriod(TimePeriod)}, but using the GML 3.1 namespace.
-     *
-     * @param period The wrapper to set.
-     */
-    public void setTimePeriod31(final TimePeriod31 period) {
-        TimePeriod c = null;
-        if (period != null) {
-            c = new TimePeriod();
-            c.begin = period.begin;
-            c.end   = period.end;
-        }
-        setTimePeriod(c);
-    }
-
-    /**
      * Sets the value from the {@link TimeInstant}.
      * This method is called at unmarshalling-time by JAXB.
      *
@@ -221,20 +172,6 @@ public final class TM_Primitive extends 
     }
 
     /**
-     * Same as {@link #setTimeInstant(TimeInstant)}, but using the GML 3.1 namespace.
-     *
-     * @param instant The wrapper to set.
-     */
-    public void setTimeInstant31(final TimeInstant31 instant) {
-        TimeInstant c = null;
-        if (instant != null) {
-            c = new TimeInstant();
-            c.timePosition = instant.timePosition;
-        }
-        setTimeInstant(c);
-    }
-
-    /**
      * Returns the date of the given bounds, or {@code null} if none.
      */
     private static Date toDate(final TimePeriodBound bound) {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java?rev=1548703&r1=1548702&r2=1548703&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
[UTF-8] Fri Dec  6 19:51:23 2013
@@ -44,15 +44,6 @@ public final class LegacyNamespaces {
     public static final String GML = "http://www.opengis.net/gml";
 
     /**
-     * A copy of {@link #GML} used only in JAXB annotations.
-     * We use a separated constant in order to make easier to remove every uses of this namespace
in
-     * all JAXB annotations if we can find a way to share the same Java classes between different
versions.
-     * If such better way is found, then every classes, methods and fields using this constant
should be deleted.
-     */
-    @Deprecated
-    public static final String GML_IN_JAXB = GML;
-
-    /**
      * A non-public (un)marshaller property for controlling usage of {@link org.apache.sis.xml.FilteredNamespaces}.
      * Values can be:
      *



Mime
View raw message