You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/20 14:35:29 UTC

[sling-org-apache-sling-commons-johnzon] 01/11: Add a johnzon wrapper bundle (SLING-6700).

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-johnzon.git

commit bb85832fea1e4d0de81da4b9e343576647683ae8
Author: Karl Pauls <pa...@apache.org>
AuthorDate: Thu Mar 23 14:27:49 2017 +0000

    Add a johnzon wrapper bundle (SLING-6700).
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788254 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                        | 75 +++++++++++++++++++++++
 src/main/java/javax/json/spi/JsonProvider.java | 82 ++++++++++++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..cdaa4d1
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>30</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.commons.johnzon</artifactId>
+    <packaging>bundle</packaging>
+    <version>0.1.0-SNAPSHOT</version>
+
+    <name>Apache Johnzon Wrapper Library</name>
+    <description>Apache Johnzon powered javax.json library</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/johnzon</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/johnzon</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/commons/johnzon</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>
+                            javax.json.*;-split-package:=first
+                        </Export-Package>
+                        <Private-Package>org.apache.johnzon.core</Private-Package>
+                        <Import-Package />
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+            <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-json_1.0_spec</artifactId>
+            <version>1.0-alpha-1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.johnzon</groupId>
+            <artifactId>johnzon-core</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/javax/json/spi/JsonProvider.java b/src/main/java/javax/json/spi/JsonProvider.java
new file mode 100644
index 0000000..5464ce6
--- /dev/null
+++ b/src/main/java/javax/json/spi/JsonProvider.java
@@ -0,0 +1,82 @@
+/*
+ * 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 javax.json.spi;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Map;
+
+import javax.json.JsonArrayBuilder;
+import javax.json.JsonBuilderFactory;
+import javax.json.JsonObjectBuilder;
+import javax.json.JsonReader;
+import javax.json.JsonReaderFactory;
+import javax.json.JsonWriter;
+import javax.json.JsonWriterFactory;
+import javax.json.stream.JsonGenerator;
+import javax.json.stream.JsonGeneratorFactory;
+import javax.json.stream.JsonParser;
+import javax.json.stream.JsonParserFactory;
+
+public abstract class JsonProvider {
+    private static final class Holder {
+        private static final JsonProvider DEFAULT = new org.apache.johnzon.core.JsonProviderImpl();
+    }
+    
+    protected JsonProvider() {
+        // no-op
+    }
+
+    public static JsonProvider provider() {
+        return Holder.DEFAULT;
+    }
+
+    public abstract JsonParser createParser(Reader reader);
+
+    public abstract JsonParser createParser(InputStream in);
+
+    public abstract JsonParserFactory createParserFactory(Map<String, ?> config);
+
+    public abstract JsonGenerator createGenerator(Writer writer);
+
+    public abstract JsonGenerator createGenerator(OutputStream out);
+
+    public abstract JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config);
+
+    public abstract JsonReader createReader(Reader reader);
+
+    public abstract JsonReader createReader(InputStream in);
+
+    public abstract JsonWriter createWriter(Writer writer);
+
+    public abstract JsonWriter createWriter(OutputStream out);
+
+    public abstract JsonWriterFactory createWriterFactory(Map<String, ?> config);
+
+    public abstract JsonReaderFactory createReaderFactory(Map<String, ?> config);
+
+    public abstract JsonObjectBuilder createObjectBuilder();
+
+    public abstract JsonArrayBuilder createArrayBuilder();
+
+    public abstract JsonBuilderFactory createBuilderFactory(Map<String, ?> config);
+}
+

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.