sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1494932 - in /sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct: ./ CI_OnlineResource.java MD_Keywords.java MetadataAdapter.java package-info.java
Date Thu, 20 Jun 2013 11:25:17 GMT
Author: desruisseaux
Date: Thu Jun 20 11:25:17 2013
New Revision: 1494932

URL: http://svn.apache.org/r1494932
Log:
Ported JAXB adapters for (un)marshalling of some metadata elements without their enclosing
type.
Those adapters are needed for the support of other OGC standards built on top of metadata.

Added:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/CI_OnlineResource.java
  (with props)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MD_Keywords.java
  (with props)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MetadataAdapter.java
  (with props)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/package-info.java
  (with props)

Added: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/CI_OnlineResource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/CI_OnlineResource.java?rev=1494932&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/CI_OnlineResource.java
(added)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/CI_OnlineResource.java
[UTF-8] Thu Jun 20 11:25:17 2013
@@ -0,0 +1,43 @@
+/*
+ * 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.direct;
+
+import org.opengis.metadata.citation.OnlineResource;
+import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @since   0.3 (derived from geotk-3.15)
+ * @version 0.3
+ * @module
+ */
+public final class CI_OnlineResource extends MetadataAdapter<OnlineResource, DefaultOnlineResource>
{
+    /**
+     * Converts a GeoAPI interface to the SIS implementation for XML marshalling.
+     *
+     * @param  value The bound type value, here the GeoAPI interface.
+     * @return The adapter for the given value, here the SIS implementation.
+     */
+    @Override
+    public DefaultOnlineResource marshal(final OnlineResource value) {
+        return DefaultOnlineResource.castOrCopy(value);
+    }
+}

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

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

Added: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MD_Keywords.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MD_Keywords.java?rev=1494932&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MD_Keywords.java
(added)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MD_Keywords.java
[UTF-8] Thu Jun 20 11:25:17 2013
@@ -0,0 +1,43 @@
+/*
+ * 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.direct;
+
+import org.opengis.metadata.identification.Keywords;
+import org.apache.sis.metadata.iso.identification.DefaultKeywords;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @since   0.3 (derived from geotk-3.15)
+ * @version 0.3
+ * @module
+ */
+public final class MD_Keywords extends MetadataAdapter<Keywords, DefaultKeywords> {
+    /**
+     * Converts a GeoAPI interface to the SIS implementation for XML marshalling.
+     *
+     * @param  value The bound type value, here the GeoAPI interface.
+     * @return The adapter for the given value, here the SIS implementation.
+     */
+    @Override
+    public DefaultKeywords marshal(final Keywords value) {
+        return DefaultKeywords.castOrCopy(value);
+    }
+}

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

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

Added: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MetadataAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MetadataAdapter.java?rev=1494932&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MetadataAdapter.java
(added)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/MetadataAdapter.java
[UTF-8] Thu Jun 20 11:25:17 2013
@@ -0,0 +1,52 @@
+/*
+ * 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.direct;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+
+/**
+ * Base class for adapters from GeoAPI interfaces to their SIS implementation.
+ *
+ * @param <BoundType> The GeoAPI interface being adapted.
+ * @param <ValueType> The SIS class implementing the interface.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3 (derived from geotk-3.15)
+ * @version 0.3
+ * @module
+ */
+public abstract class MetadataAdapter<BoundType, ValueType extends BoundType>
+        extends XmlAdapter<ValueType,BoundType>
+{
+    /**
+     * Empty constructor for subclasses only.
+     */
+    protected MetadataAdapter() {
+    }
+
+    /**
+     * Returns the given object unchanged, to be marshalled directly.
+     *
+     * @param  value The metadata value.
+     * @return The value to marshal (which is the same).
+     */
+    @Override
+    public final BoundType unmarshal(final ValueType value) {
+        return value;
+    }
+}

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

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

Added: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/package-info.java?rev=1494932&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/package-info.java
(added)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/direct/package-info.java
[UTF-8] Thu Jun 20 11:25:17 2013
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+/**
+ * JAXB adapters for metadata objects without their wrapper. This package contains adapters
for
+ * the same objects than the ones handled by {@link org.apache.sis.internal.jaxb.metadata},
+ * except that the XML is formatted in a "direct" way, without wrappers.
+ *
+ * <p><b>Example:</b> given an attribute named {@code "myAttribute"} of
type
+ * {@link org.opengis.metadata.citation.OnlineResource}, the adapter provided
+ * in the parent package would marshal that attribute as below:</p>
+ *
+ * {@preformat xml
+ *   <myAttribute>
+ *     <gmd:CI_OnlineResource>
+ *       <gmd:linkage>
+ *         <gmd:URL>http://blabla.com</gmd:URL>
+ *       </gmd:linkage>
+ *     </gmd:CI_OnlineResource>
+ *   </myAttribute>
+ * }
+ *
+ * Using the adapter provided in this class, the result would rather be:
+ *
+ * {@preformat xml
+ *   <myAttribute>
+ *     <gmd:linkage>
+ *       <gmd:URL>http://blabla.com</gmd:URL>
+ *     </gmd:linkage>
+ *   </myAttribute>
+ * }
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @since   0.3 (derived from geotk-3.15)
+ * @version 0.3
+ * @module
+ */
+package org.apache.sis.internal.jaxb.metadata.direct;

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

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



Mime
View raw message