Author: pauls Date: Thu Mar 23 14:27:49 2017 New Revision: 1788254 URL: http://svn.apache.org/viewvc?rev=1788254&view=rev Log: Add a johnzon wrapper bundle (SLING-6700).
Added: sling/trunk/bundles/commons/johnzon/ sling/trunk/bundles/commons/johnzon/pom.xml sling/trunk/bundles/commons/johnzon/src/ sling/trunk/bundles/commons/johnzon/src/main/ sling/trunk/bundles/commons/johnzon/src/main/java/ sling/trunk/bundles/commons/johnzon/src/main/java/javax/ sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/ sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/ sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/JsonProvider.java Added: sling/trunk/bundles/commons/johnzon/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/johnzon/pom.xml?rev=1788254&view=auto ============================================================================== --- sling/trunk/bundles/commons/johnzon/pom.xml (added) +++ sling/trunk/bundles/commons/johnzon/pom.xml Thu Mar 23 14:27:49 2017 @@ -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> Added: sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/JsonProvider.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/JsonProvider.java?rev=1788254&view=auto ============================================================================== --- sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/JsonProvider.java (added) +++ sling/trunk/bundles/commons/johnzon/src/main/java/javax/json/spi/JsonProvider.java Thu Mar 23 14:27:49 2017 @@ -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); +} +