sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1496506 - in /sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis: internal/jaxb/gml/SC_VerticalCRS.java metadata/iso/extent/DefaultVerticalExtent.java metadata/iso/extent/package-info.java
Date Tue, 25 Jun 2013 14:59:19 GMT
Author: desruisseaux
Date: Tue Jun 25 14:59:18 2013
New Revision: 1496506

URL: http://svn.apache.org/r1496506
Log:
Enable partial (un)marshalling of SC_VerticalCRS.

Added:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
  (with props)
Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java

Added: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java?rev=1496506&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
(added)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
[UTF-8] Tue Jun 25 14:59:18 2013
@@ -0,0 +1,95 @@
+/*
+ * 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.gml;
+
+import org.opengis.referencing.crs.VerticalCRS;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter for {@link VerticalCRS}, in order to integrate the value in an element
+ * complying with OGC/ISO standard. Note that the CRS is formatted using the GML schema,
+ * not the ISO 19139 one.
+ *
+ * <p>This implementation does not contain any WML element, because doing so would
require
+ * the {@code sis-referencing} module. Module capable to provide an element shall create
a
+ * subclass like below:</p>
+ *
+ * {@preformat java
+ *     public final class MyClass extends SC_VerticalCRS implements AdapterReplacement {
+ *         &#64;Override
+ *         public void register(final Marshaller marshaller) {
+ *             marshaller.setAdapter(SC_VerticalCRS.class, this);
+ *         }
+ *
+ *         &#64;XmlElement(name = "VerticalCRS")
+ *         public DefaultVerticalCRS getElement() {
+ *             return skip() ? null : DefaultVerticalCRS.castOrCopy(metadata);
+ *         }
+ *
+ *         public void setElement(final DefaultVerticalCRS metadata) {
+ *             this.metadata = metadata;
+ *         }
+ *     }
+ * }
+ *
+ * The path to {@code MyClass} shall be provided in the module
+ * {@code META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement} file.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3 (derived from geotk-3.00)
+ * @version 0.3
+ * @module
+ *
+ * @see org.apache.sis.internal.jaxb.AdapterReplacement
+ */
+public class SC_VerticalCRS extends PropertyType<SC_VerticalCRS, VerticalCRS> {
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public SC_VerticalCRS() {
+    }
+
+    /**
+     * Wraps a Vertical CRS value with a {@code <gml:VerticalCRS>} element at marshalling-time.
+     *
+     * @param metadata The metadata value to marshal.
+     */
+    private SC_VerticalCRS(final VerticalCRS metadata) {
+        super(metadata);
+    }
+
+    /**
+     * Returns the Vertical CRS value wrapped by a {@code <gml:VerticalCRS>} element.
+     *
+     * @param value The value to marshal.
+     * @return The adapter which wraps the metadata value.
+     */
+    @Override
+    protected SC_VerticalCRS wrap(final VerticalCRS value) {
+        return new SC_VerticalCRS(value);
+    }
+
+    /**
+     * Returns the GeoAPI interface which is bound by this adapter.
+     */
+    @Override
+    protected final Class<VerticalCRS> getBoundType() {
+        return VerticalCRS.class;
+    }
+}

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

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

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java?rev=1496506&r1=1496505&r2=1496506&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
[UTF-8] Tue Jun 25 14:59:18 2013
@@ -45,7 +45,7 @@ import org.apache.sis.internal.metadata.
 @XmlType(name = "EX_VerticalExtent_Type", propOrder = {
     "minimumValue",
     "maximumValue",
-// TODO    "verticalCRS"
+    "verticalCRS"
 })
 @XmlRootElement(name = "EX_VerticalExtent")
 public class DefaultVerticalExtent extends ISOMetadata implements VerticalExtent {
@@ -178,7 +178,7 @@ public class DefaultVerticalExtent exten
      * identification includes unit of measure.
      */
     @Override
-    // TODO @XmlElement(name = "verticalCRS", required = true)
+    @XmlElement(name = "verticalCRS", required = true)
     public VerticalCRS getVerticalCRS() {
         return verticalCRS;
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java?rev=1496506&r1=1496505&r2=1496506&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] Tue Jun 25 14:59:18 2013
@@ -143,7 +143,7 @@
     @XmlJavaTypeAdapter(EX_VerticalExtent.class),
     @XmlJavaTypeAdapter(GM_Object.class),
     @XmlJavaTypeAdapter(MD_Identifier.class),
-//  @XmlJavaTypeAdapter(SC_VerticalCRS.class), // TODO
+    @XmlJavaTypeAdapter(SC_VerticalCRS.class),
     @XmlJavaTypeAdapter(TM_Primitive.class),
 
     // Java types, primitive types and basic OGC types handling



Mime
View raw message