sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1677246 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/ sis-referencing/src/main/java/org/apache/sis/referencing/crs/ s...
Date Fri, 01 May 2015 22:40:03 GMT
Author: desruisseaux
Date: Fri May  1 22:40:02 2015
New Revision: 1677246

URL: http://svn.apache.org/r1677246
Log:
Referencing: fixed some JAXB annotations for the recently added CRS and operation classes.

Added:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java

Added: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java?rev=1677246&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
(added)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -0,0 +1,92 @@
+/*
+ * 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.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.PositionalAccuracy;
+import org.apache.sis.metadata.iso.quality.AbstractPositionalAccuracy;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+public final class DQ_PositionalAccuracy extends PropertyType<DQ_PositionalAccuracy, PositionalAccuracy>
{
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public DQ_PositionalAccuracy() {
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     * This method is indirectly invoked by the private constructor
+     * below, so it shall not depend on the state of this object.
+     *
+     * @return {@code PositionalAccuracy.class}
+     */
+    @Override
+    protected Class<PositionalAccuracy> getBoundType() {
+        return PositionalAccuracy.class;
+    }
+
+    /**
+     * Constructor for the {@link #wrap} method only.
+     */
+    private DQ_PositionalAccuracy(final PositionalAccuracy metadata) {
+        super(metadata);
+    }
+
+    /**
+     * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata
value
+     * in a {@code <gmd:DQ_PositionalAccuracy>} XML element.
+     *
+     * @param  metadata The metadata element to marshall.
+     * @return A {@code PropertyType} wrapping the given the metadata element.
+     */
+    @Override
+    protected DQ_PositionalAccuracy wrap(final PositionalAccuracy metadata) {
+        return new DQ_PositionalAccuracy(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at marshalling time for getting the actual metadata to write
+     * inside the {@code <gmd:DQ_PositionalAccuracy>} XML element.
+     * This is the value or a copy of the value given in argument to the {@code wrap} method.
+     *
+     * @return The metadata to be marshalled.
+     */
+    @XmlElementRef
+    public AbstractPositionalAccuracy getElement() {
+        return AbstractPositionalAccuracy.castOrCopy(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+     *
+     * @param metadata The unmarshalled metadata.
+     */
+    public void setElement(final AbstractPositionalAccuracy metadata) {
+        this.metadata = metadata;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_PositionalAccuracy.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java?rev=1677246&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -0,0 +1,92 @@
+/*
+ * 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.jaxb.referencing;
+
+import javax.xml.bind.annotation.XmlElement;
+import org.opengis.referencing.operation.Conversion;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.referencing.operation.DefaultConversion;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+public final class CC_Conversion extends PropertyType<CC_Conversion, Conversion> {
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public CC_Conversion() {
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     * This method is indirectly invoked by the private constructor
+     * below, so it shall not depend on the state of this object.
+     *
+     * @return {@code Conversion.class}
+     */
+    @Override
+    protected Class<Conversion> getBoundType() {
+        return Conversion.class;
+    }
+
+    /**
+     * Constructor for the {@link #wrap} method only.
+     */
+    private CC_Conversion(final Conversion conversion) {
+        super(conversion);
+    }
+
+    /**
+     * Invoked by {@link PropertyType} at marshalling time for wrapping the given value
+     * in a {@code <gml:Conversion>} XML element.
+     *
+     * @param  conversion The element to marshall.
+     * @return A {@code PropertyType} wrapping the given the element.
+     */
+    @Override
+    protected CC_Conversion wrap(final Conversion conversion) {
+        return new CC_Conversion(conversion);
+    }
+
+    /**
+     * Invoked by JAXB at marshalling time for getting the actual element to write
+     * inside the {@code <gml:Conversion>} XML element.
+     * This is the value or a copy of the value given in argument to the {@code wrap} method.
+     *
+     * @return The element to be marshalled.
+     */
+    @XmlElement(name = "Conversion")
+    public DefaultConversion getElement() {
+        return DefaultConversion.castOrCopy(metadata);
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+     *
+     * @param conversion The unmarshalled element.
+     */
+    public void setElement(final DefaultConversion conversion) {
+        metadata = conversion;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_Conversion.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -88,7 +88,7 @@ import java.util.Objects;
 @XmlType(name="AbstractCRSType")
 @XmlRootElement(name = "AbstractCRS")
 @XmlSeeAlso({
-    DefaultProjectedCRS.class,
+    AbstractDerivedCRS.class,
     DefaultGeodeticCRS.class,
     DefaultVerticalCRS.class,
     DefaultTemporalCRS.class,

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -17,7 +17,10 @@
 package org.apache.sis.referencing.crs;
 
 import java.util.Map;
-import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.GeneralDerivedCRS;
@@ -46,7 +49,11 @@ import static org.apache.sis.util.Utilit
  * @version 0.6
  * @module
  */
-@XmlTransient   // TODO: GML not yet investigated
+@XmlType(name="AbstractGeneralDerivedCRSType")
+@XmlRootElement(name = "AbstractGeneralDerivedCRS")
+@XmlSeeAlso({
+    DefaultProjectedCRS.class
+})
 class AbstractDerivedCRS extends AbstractCRS implements GeneralDerivedCRS {
     /**
      * Serial number for inter-operability with different versions.
@@ -57,6 +64,7 @@ class AbstractDerivedCRS extends Abstrac
      * The conversion from the {@linkplain #getBaseCRS() base CRS} to this CRS.
      * The base CRS of this {@code GeneralDerivedCRS} is {@link Conversion#getSourceCRS()}.
      */
+    @XmlElement(name = "conversion", required = true)
     private final Conversion conversionFromBase;
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -85,7 +85,7 @@ public class DefaultEngineeringCRS exten
     /**
      * The datum.
      */
-    @XmlElement(name = "engineeringDatum")
+    @XmlElement(name = "engineeringDatum", required = true)
     private final EngineeringDatum datum;
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -71,7 +71,7 @@ class DefaultGeodeticCRS extends Abstrac
     /**
      * The datum.
      */
-    @XmlElement(name = "geodeticDatum")
+    @XmlElement(name = "geodeticDatum", required = true)
     private final GeodeticDatum datum;
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -67,7 +67,7 @@ public class DefaultImageCRS extends Abs
     /**
      * The datum.
      */
-    @XmlElement(name = "imageDatum")
+    @XmlElement(name = "imageDatum", required = true)
     private final ImageDatum datum;
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -20,6 +20,7 @@ import java.util.Map;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Angle;
 import javax.measure.quantity.Length;
+import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.parameter.ParameterValue;
@@ -66,6 +67,10 @@ import static org.apache.sis.internal.re
  * @version 0.6
  * @module
  */
+@XmlType(name="ProjectedCRSType", propOrder = {
+//  "baseCRS",  // TODO
+    "coordinateSystem"
+})
 @XmlRootElement(name = "ProjectedCRS")
 public class DefaultProjectedCRS extends AbstractDerivedCRS implements ProjectedCRS {
     /**
@@ -195,24 +200,17 @@ public class DefaultProjectedCRS extends
      * @return The datum of the base CRS.
      */
     @Override
-    @XmlElement(name="geodeticDatum")
     public GeodeticDatum getDatum() {
         return (GeodeticDatum) super.getDatum();
     }
 
     /**
-     * Used by JAXB only (invoked by reflection).
-     */
-    private void setDatum(final GeodeticDatum datum) {
-        throw new UnsupportedOperationException(); // TODO
-    }
-
-    /**
      * Returns the base coordinate reference system, which must be geographic.
      *
      * @return The base CRS.
      */
     @Override
+//  @XmlElement(name = "baseGeodeticCRS", required = true)  // Note: older GML version used
"baseGeographicCRS".
     public GeographicCRS getBaseCRS() {
         return (GeographicCRS) super.getBaseCRS();
     }
@@ -231,7 +229,7 @@ public class DefaultProjectedCRS extends
      * Returns the coordinate system.
      */
     @Override
-    @XmlElement(name="cartesianCS")
+    @XmlElement(name="cartesianCS", required = true)
     public CartesianCS getCoordinateSystem() {
         return (CartesianCS) super.getCoordinateSystem();
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -75,7 +75,7 @@ public class DefaultTemporalCRS extends
     /**
      * The datum.
      */
-    @XmlElement(name = "temporalDatum")
+    @XmlElement(name = "temporalDatum", required = true)
     private final TemporalDatum datum;
 
     /**
@@ -229,7 +229,7 @@ public class DefaultTemporalCRS extends
      * @return The coordinate system.
      */
     @Override
-    @XmlElement(name = "timeCS")
+    @XmlElement(name = "timeCS", required = true)
     public TimeCS getCoordinateSystem() {
         return (TimeCS) super.getCoordinateSystem();
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -67,7 +67,7 @@ public class DefaultVerticalCRS extends
     /**
      * The datum.
      */
-    @XmlElement(name = "verticalDatum")
+    @XmlElement(name = "verticalDatum", required = true)
     private final VerticalDatum datum;
 
     /**
@@ -200,7 +200,7 @@ public class DefaultVerticalCRS extends
      * @return The coordinate system.
      */
     @Override
-    @XmlElement(name = "verticalCS")
+    @XmlElement(name = "verticalCS", required = true)
     public VerticalCS getCoordinateSystem() {
         return (VerticalCS) super.getCoordinateSystem();
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -98,6 +98,7 @@
     @XmlJavaTypeAdapter(CS_TimeCS.class),
     @XmlJavaTypeAdapter(CS_UserDefinedCS.class),
     @XmlJavaTypeAdapter(CS_VerticalCS.class),
+    @XmlJavaTypeAdapter(CC_Conversion.class),
     @XmlJavaTypeAdapter(StringAdapter.class),
     @XmlJavaTypeAdapter(InternationalStringConverter.class)
 })

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -19,6 +19,10 @@ package org.apache.sis.referencing.opera
 import java.util.Map;
 import java.util.Collection;
 import java.util.Collections;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.quality.PositionalAccuracy;
@@ -84,6 +88,18 @@ import java.util.Objects;
  * @version 0.6
  * @module
  */
+@XmlType(name="AbstractCoordinateOperationType", propOrder = {
+    "domainOfValidity",
+    "scope",
+    "operationVersion",
+    "coordinateOperationAccuracy",
+//  "sourceCRS",    // TODO
+//  "targetCRS"
+})
+@XmlRootElement(name = "AbstractCoordinateOperation")
+@XmlSeeAlso({
+    AbstractSingleOperation.class
+})
 public class AbstractCoordinateOperation extends AbstractIdentifiedObject implements CoordinateOperation
{
     /**
      * Serial number for inter-operability with different versions.
@@ -95,6 +111,7 @@ public class AbstractCoordinateOperation
      *
      * @see #getSourceCRS()
      */
+//  @XmlElement
     private final CoordinateReferenceSystem sourceCRS;
 
     /**
@@ -102,6 +119,7 @@ public class AbstractCoordinateOperation
      *
      * @see #getTargetCRS()
      */
+//  @XmlElement
     private final CoordinateReferenceSystem targetCRS;
 
     /**
@@ -116,21 +134,25 @@ public class AbstractCoordinateOperation
      * Version of the coordinate transformation
      * (i.e., instantiation due to the stochastic nature of the parameters).
      */
+    @XmlElement
     private final String operationVersion;
 
     /**
      * Estimate(s) of the impact of this operation on point accuracy, or {@code null} if
none.
      */
+    @XmlElement
     private final Collection<PositionalAccuracy> coordinateOperationAccuracy;
 
     /**
      * Area in which this operation is valid, or {@code null} if not available.
      */
+    @XmlElement
     private final Extent domainOfValidity;
 
     /**
      * Description of domain of usage, or limitations of usage, for which this operation
is valid.
      */
+    @XmlElement
     private final InternationalString scope;
 
     /**
@@ -140,6 +162,23 @@ public class AbstractCoordinateOperation
     private final MathTransform transform;
 
     /**
+     * Constructs a new object in which every attributes are set to a null value.
+     * <strong>This is not a valid object.</strong> This constructor is strictly
+     * reserved to JAXB, which will assign values to the fields using reflexion.
+     */
+    AbstractCoordinateOperation() {
+        super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE);
+        sourceCRS = null;
+        targetCRS = null;
+        interpolationCRS = null;
+        operationVersion = null;
+        coordinateOperationAccuracy = null;
+        domainOfValidity = null;
+        scope = null;
+        transform = null;
+    }
+
+    /**
      * Constructs a new coordinate operation with the same values than the specified defining
conversion,
      * together with the specified source and target CRS. This constructor is used by {@link
DefaultConversion} only.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -17,6 +17,9 @@
 package org.apache.sis.referencing.operation;
 
 import java.util.Map;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.referencing.operation.Matrix;
@@ -48,6 +51,14 @@ import java.util.Objects;
  * @version 0.6
  * @module
  */
+@XmlType(name="AbstractSingleOperationType", propOrder = {
+//  "method",   // TODO
+//  "parameters"
+})
+@XmlRootElement(name = "AbstractSingleOperation")
+@XmlSeeAlso({
+    DefaultConversion.class
+})
 class AbstractSingleOperation extends AbstractCoordinateOperation implements SingleOperation,
Parameterized {
     /**
      * Serial number for inter-operability with different versions.
@@ -65,6 +76,16 @@ class AbstractSingleOperation extends Ab
     private final ParameterValueGroup parameters;
 
     /**
+     * Constructs a new object in which every attributes are set to a null value.
+     * <strong>This is not a valid object.</strong> This constructor is strictly
+     * reserved to JAXB, which will assign values to the fields using reflexion.
+     */
+    AbstractSingleOperation() {
+        method = null;
+        parameters = null;
+    }
+
+    /**
      * Creates a coordinate operation from the given properties.
      */
     public AbstractSingleOperation(final Map<String,?>             properties,

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -17,6 +17,8 @@
 package org.apache.sis.referencing.operation;
 
 import java.util.Map;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.MathTransform;
@@ -58,6 +60,8 @@ import org.apache.sis.util.ArgumentCheck
  *
  * @see DefaultTransformation
  */
+@XmlType(name = "ConversionType")
+@XmlRootElement(name = "Conversion")
 public class DefaultConversion extends AbstractSingleOperation implements Conversion {
     /**
      * Serial number for inter-operability with different versions.
@@ -65,6 +69,14 @@ public class DefaultConversion extends A
     private static final long serialVersionUID = -2148164324805562793L;
 
     /**
+     * Constructs a new object in which every attributes are set to a null value.
+     * <strong>This is not a valid object.</strong> This constructor is strictly
+     * reserved to JAXB, which will assign values to the fields using reflexion.
+     */
+    private DefaultConversion() {
+    }
+
+    /**
      * Creates a coordinate conversion from the given properties.
      * The properties given in argument follow the same rules than for the
      * {@linkplain AbstractCoordinateOperation#AbstractCoordinateOperation(Map, CoordinateReferenceSystem,

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java?rev=1677246&r1=1677245&r2=1677246&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
[UTF-8] Fri May  1 22:40:02 2015
@@ -48,4 +48,28 @@
  * @since   0.6
  * @module
  */
+@XmlSchema(elementFormDefault= XmlNsForm.QUALIFIED, namespace = Namespaces.GML, xmlns = {
+    @XmlNs(prefix = "gml", namespaceURI = Namespaces.GML),
+    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+})
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlJavaTypeAdapters({
+    @XmlJavaTypeAdapter(EX_Extent.class),
+    @XmlJavaTypeAdapter(DQ_PositionalAccuracy.class),
+    @XmlJavaTypeAdapter(StringAdapter.class),
+    @XmlJavaTypeAdapter(InternationalStringConverter.class)
+})
 package org.apache.sis.referencing.operation;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.gco.*;
+import org.apache.sis.internal.jaxb.referencing.*;
+import org.apache.sis.internal.jaxb.metadata.EX_Extent;
+import org.apache.sis.internal.jaxb.metadata.DQ_PositionalAccuracy;



Mime
View raw message