sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1776234 - in /sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal: gpx/ xml/
Date Wed, 28 Dec 2016 07:11:57 GMT
Author: desruisseaux
Date: Wed Dec 28 07:11:57 2016
New Revision: 1776234

URL: http://svn.apache.org/viewvc?rev=1776234&view=rev
Log:
Minor cleanup: class renaming and remove the use of XML.DEFAULT_NAMESPACE which does not work
as expected.

Added:
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/NamespaceEraser.java
      - copied, changed from r1776233, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/DefaultNamespaceStreamWriter.java
Removed:
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/DefaultNamespaceStreamWriter.java
Modified:
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/StoreProvider.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxDataStoreProvider.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxStreamWriter.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/package-info.java

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/StoreProvider.java?rev=1776234&r1=1776233&r2=1776234&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/StoreProvider.java
[UTF-8] Wed Dec 28 07:11:57 2016
@@ -63,16 +63,6 @@ public final class StoreProvider extends
     }
 
     /**
-     * Returns the namespace URI of GPX 1.1 file format.
-     *
-     * @return GPX 1.1 namespace.
-     */
-    @Override
-    protected String getDefaultNamespace() {
-        return Tags.NAMESPACE_V11;
-    }
-
-    /**
      * Returns the JAXB context for the data store. This method is invoked at most once.
      *
      * @return the JAXB context.

Copied: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/NamespaceEraser.java
(from r1776233, sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/DefaultNamespaceStreamWriter.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/NamespaceEraser.java?p2=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/NamespaceEraser.java&p1=sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/DefaultNamespaceStreamWriter.java&r1=1776233&r2=1776234&rev=1776234&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/DefaultNamespaceStreamWriter.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/NamespaceEraser.java
[UTF-8] Wed Dec 28 07:11:57 2016
@@ -31,7 +31,7 @@ import org.apache.sis.internal.util.Stre
  * @version 0.8
  * @module
  */
-final class DefaultNamespaceStreamWriter extends StreamWriterDelegate {
+final class NamespaceEraser extends StreamWriterDelegate {
     /**
      * The default namespace.
      */
@@ -40,7 +40,7 @@ final class DefaultNamespaceStreamWriter
     /**
      * Creates a new filter for the given default namespace.
      */
-    DefaultNamespaceStreamWriter(final XMLStreamWriter out, final String namespaceURI) {
+    NamespaceEraser(final XMLStreamWriter out, final String namespaceURI) {
         super(out);
         defaultNamespace = namespaceURI;
     }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxDataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxDataStoreProvider.java?rev=1776234&r1=1776233&r2=1776234&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxDataStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxDataStoreProvider.java
[UTF-8] Wed Dec 28 07:11:57 2016
@@ -16,13 +16,10 @@
  */
 package org.apache.sis.internal.xml;
 
-import java.util.Map;
-import java.util.Collections;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.xml.MarshallerPool;
-import org.apache.sis.xml.XML;
 
 
 /**
@@ -49,13 +46,6 @@ public abstract class StaxDataStoreProvi
     }
 
     /**
-     * Returns the default namespace URI for the XML documents created by this format.
-     *
-     * @return the default namespace URI.
-     */
-    protected abstract String getDefaultNamespace();
-
-    /**
      * Returns the JAXB context for the data store, or {@code null} if the data stores
      * {@linkplain #open created} by this provided do not use JAXB.
      *
@@ -80,8 +70,7 @@ public abstract class StaxDataStoreProvi
                 if (pool == null) {
                     final JAXBContext context = getJAXBContext();
                     if (context != null) {
-                        Map<String,?> properties = Collections.singletonMap(XML.DEFAULT_NAMESPACE,
getDefaultNamespace());
-                        jaxb = pool = new MarshallerPool(context, properties);
+                        jaxb = pool = new MarshallerPool(context, null);
                     }
                 }
             }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxStreamWriter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxStreamWriter.java?rev=1776234&r1=1776233&r2=1776234&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxStreamWriter.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/StaxStreamWriter.java
[UTF-8] Wed Dec 28 07:11:57 2016
@@ -299,7 +299,7 @@ public abstract class StaxStreamWriter e
         final QName qn;
         XMLStreamWriter out = writer;
         if (hideNS != null) {
-            out = new DefaultNamespaceStreamWriter(out, hideNS);
+            out = new NamespaceEraser(out, hideNS);
             qn  = new QName(hideNS, name);
         } else {
             qn  = new QName(name);

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/package-info.java?rev=1776234&r1=1776233&r2=1776234&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/xml/package-info.java
[UTF-8] Wed Dec 28 07:11:57 2016
@@ -16,7 +16,11 @@
  */
 
 /**
- * Helper classes for reading and writing XML documents using STAX (Streaming API for XML).
+ * Helper classes for reading and writing XML documents using StAX (Streaming API for XML).
+ * This package uses the <cite>cursor API</cite> through {@link javax.xml.stream.XMLStreamReader}
+ * and {@link javax.xml.stream.XMLStreamWriter} interfaces.
+ * Implementations can optionally use JAXB for some specific elements,
+ * typically for metadata before the stream of features.
  *
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)



Mime
View raw message