geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1691851 - in /geronimo/specs/trunk/geronimo-json_1.1_spec: ./ src/main/java/javax/json/ src/main/java/javax/json/spi/ src/main/java/javax/json/stream/
Date Sun, 19 Jul 2015 20:20:23 GMT
Author: salyh
Date: Sun Jul 19 20:20:22 2015
New Revision: 1691851

URL: http://svn.apache.org/r1691851
Log:
Introduce JSONP 1.1 (JSR 374) Spec API skeleton

Added:
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonMergePatch.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatch.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatchBuilder.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPointer.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
Modified:
    geronimo/specs/trunk/geronimo-json_1.1_spec/pom.xml
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonArrayBuilder.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonBuilderFactory.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonObjectBuilder.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonReader.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonStructure.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonWriter.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/spi/JsonProvider.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonParser.java

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/pom.xml?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/pom.xml Sun Jul 19 20:20:22 2015
@@ -20,17 +20,17 @@
 
   <parent>
     <groupId>org.apache.geronimo.genesis</groupId>
-    <artifactId>genesis-java6-flava</artifactId>
-    <version>2.2</version>
+    <artifactId>genesis-java8-flava</artifactId>
+    <version>2.3-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.geronimo.specs</groupId>
-  <artifactId>geronimo-json_1.0_spec</artifactId>
+  <artifactId>geronimo-json_1.1_spec</artifactId>
   <packaging>bundle</packaging>
-  <name>Apache Geronimo JSon Spec 1.0</name>
+  <name>Apache Geronimo JSon Spec 1.1</name>
   <version>1.0-SNAPSHOT</version>
 
-  <description>Apache Geronimo implementation of the JSR-353</description>
+  <description>Apache Geronimo implementation of the JSR-374</description>
   <url>http://geronimo.apache.org/maven/${siteId}/${project.version}</url>
 
   <distributionManagement>
@@ -45,9 +45,9 @@
   </properties>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-json_1.0_spec/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-json_1.0_spec/</developerConnection>
-    <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-json_1.0_spec/</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-json_1.1_spec/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-json_1.1_spec/</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-json_1.1_spec/</url>
   </scm>
 
   <!-- added so the build can find staged depends -->
@@ -73,11 +73,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.1</version>
-        <configuration>
-          <target>1.6</target>
-          <source>1.6</source>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java Sun Jul
19 20:20:22 2015
@@ -21,10 +21,13 @@ import javax.json.stream.JsonGenerator;
 import javax.json.stream.JsonGeneratorFactory;
 import javax.json.stream.JsonParser;
 import javax.json.stream.JsonParserFactory;
+
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
+import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.util.Map;
 
 public class Json {
@@ -91,4 +94,36 @@ public class Json {
     public static JsonBuilderFactory createBuilderFactory(Map<String, ?> config) {
         return JsonProvider.provider().createBuilderFactory(config);
     }
+    
+    public static JsonArrayBuilder createArrayBuilder(JsonArray array) {
+        return JsonProvider.provider().createArrayBuilder(array);
+    }
+    
+    public static JsonObjectBuilder createObjectBuilder(JsonObject object) {
+        return JsonProvider.provider().createObjectBuilder(object);
+    }
+    
+    public static JsonString createValue(String value) {
+        return JsonProvider.provider().createValue(value);
+    }
+
+    public static JsonNumber createValue(int value) {
+        return JsonProvider.provider().createValue(value);
+    }
+
+    public static JsonNumber createValue(long value) {
+        return JsonProvider.provider().createValue(value);
+    }
+
+    public static JsonNumber createValue(double value) {
+        return JsonProvider.provider().createValue(value);
+    }
+
+    public static JsonNumber createValue(BigDecimal value) {
+        return JsonProvider.provider().createValue(value);
+    }
+
+    public static JsonNumber createValue(BigInteger value) {
+        return JsonProvider.provider().createValue(value);
+    }
 }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonArrayBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonArrayBuilder.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonArrayBuilder.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonArrayBuilder.java
Sun Jul 19 20:20:22 2015
@@ -43,4 +43,52 @@ public interface JsonArrayBuilder {
     JsonArrayBuilder add(JsonArrayBuilder builder);
 
     JsonArray build();
+
+    JsonArrayBuilder addAll(JsonArrayBuilder builder);
+
+    JsonArrayBuilder add(int index, JsonValue value);
+
+    JsonArrayBuilder add(int index, String value);
+
+    JsonArrayBuilder add(int index, BigDecimal value);
+
+    JsonArrayBuilder add(int index, BigInteger value);
+
+    JsonArrayBuilder add(int index, int value);
+
+    JsonArrayBuilder add(int index, long value);
+
+    JsonArrayBuilder add(int index, double value);
+
+    JsonArrayBuilder add(int index, boolean value);
+
+    JsonArrayBuilder addNull(int index);
+
+    JsonArrayBuilder add(int index, JsonObjectBuilder builder);
+
+    JsonArrayBuilder add(int index, JsonArrayBuilder builder);
+
+    JsonArrayBuilder set(int index, JsonValue value);
+
+    JsonArrayBuilder set(int index, String value);
+
+    JsonArrayBuilder set(int index, BigDecimal value);
+
+    JsonArrayBuilder set(int index, BigInteger value);
+
+    JsonArrayBuilder set(int index, int value);
+
+    JsonArrayBuilder set(int index, long value);
+
+    JsonArrayBuilder set(int index, double value);
+
+    JsonArrayBuilder set(int index, boolean value);
+
+    JsonArrayBuilder setNull(int index);
+
+    JsonArrayBuilder set(int index, JsonObjectBuilder builder);
+
+    JsonArrayBuilder set(int index, JsonArrayBuilder builder);
+
+    JsonArrayBuilder remove(int index);
 }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonBuilderFactory.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonBuilderFactory.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonBuilderFactory.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonBuilderFactory.java
Sun Jul 19 20:20:22 2015
@@ -24,5 +24,9 @@ public interface JsonBuilderFactory {
     JsonArrayBuilder createArrayBuilder();
 
     Map<String, ?> getConfigInUse();
+
+    JsonObjectBuilder createObjectBuilder(JsonObject object);
+
+    JsonArrayBuilder createArrayBuilder(JsonArray array);
 }
 

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonMergePatch.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonMergePatch.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonMergePatch.java
(added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonMergePatch.java
Sun Jul 19 20:20:22 2015
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+public class JsonMergePatch {
+
+    public static JsonValue mergePatch(JsonValue target, JsonValue patch) {
+
+        return null;
+    }
+
+    public static JsonValue diff(JsonValue source, JsonValue target) {
+        return null;
+    }
+}
+

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonObjectBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonObjectBuilder.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonObjectBuilder.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonObjectBuilder.java
Sun Jul 19 20:20:22 2015
@@ -43,4 +43,8 @@ public interface JsonObjectBuilder {
     JsonObjectBuilder add(String name, JsonArrayBuilder builder);
 
     JsonObject build();
+
+    JsonObjectBuilder addAll(JsonObjectBuilder builder);
+
+    JsonObjectBuilder remove(String name);
 }

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatch.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatch.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatch.java (added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatch.java Sun
Jul 19 20:20:22 2015
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+public class JsonPatch {
+
+    public JsonPatch(JsonArray patch) {
+       
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return super.equals(obj);
+    }
+
+    @Override
+    public int hashCode() {
+        return super.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        return super.toString();
+    }
+
+    public JsonStructure apply(JsonStructure target) {
+        return null;
+    }
+    public JsonObject apply(JsonObject target) {
+        return (JsonObject) apply((JsonStructure)target);
+    }
+
+    public JsonArray apply(JsonArray target) {
+        return (JsonArray) apply((JsonStructure)target);
+    }
+
+    public static JsonArray diff(JsonStructure source, JsonStructure target) {
+        return null;
+    }
+}
+

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatchBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatchBuilder.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatchBuilder.java
(added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPatchBuilder.java
Sun Jul 19 20:20:22 2015
@@ -0,0 +1,107 @@
+/*
+ * 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;
+
+public class JsonPatchBuilder {
+
+    public JsonPatchBuilder(JsonArray patch) {
+
+    }
+
+    public JsonPatchBuilder() {
+
+    }
+
+    public JsonStructure apply(JsonStructure target) {
+        return new JsonPatch(build()).apply(target);
+    }
+
+    public JsonObject apply(JsonObject target) {
+        return new JsonPatch(build()).apply(target);
+    }
+
+    public JsonArray apply(JsonArray target) {
+        return new JsonPatch(build()).apply(target);
+    }
+
+    public JsonPatchBuilder add(String path, JsonValue value) {
+        return null;
+    }
+
+    public JsonPatchBuilder add(String path, String value) {
+        return null;
+    }
+
+    public JsonPatchBuilder add(String path, int value) {
+        return null;
+    }
+
+    public JsonPatchBuilder add(String path, boolean value) {
+        return null;
+    }
+
+    public JsonPatchBuilder remove(String path) {
+        return null;
+    }
+
+    public JsonPatchBuilder replace(String path, JsonValue value) {
+        return null;
+    }
+
+    public JsonPatchBuilder replace(String path, String value) {
+        return null;
+    }
+
+    public JsonPatchBuilder replace(String path, int value) {
+        return null;
+    }
+
+    public JsonPatchBuilder replace(String path, boolean value) {
+        return null;
+    }
+
+    public JsonPatchBuilder move(String path, String from) {
+        return null;
+    }
+ 
+    public JsonPatchBuilder copy(String path, String from) {
+        return null;
+    }
+ 
+
+    public JsonPatchBuilder test(String path, JsonValue value) {
+        return null;
+    }
+
+    public JsonPatchBuilder test(String path, String value) {
+        return null;
+    }
+
+    public JsonPatchBuilder test(String path, int value) {
+        return null;
+    }
+
+    public JsonPatchBuilder test(String path, boolean value) {
+        return null;
+    }
+
+    public JsonArray build() {
+        return null;
+    }
+}
+

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPointer.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPointer.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPointer.java
(added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonPointer.java
Sun Jul 19 20:20:22 2015
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+public final class JsonPointer {
+
+    public JsonPointer(String jsonPointer) {
+        
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return super.equals(obj);
+    }
+
+    @Override
+    public int hashCode() {
+        return super.hashCode();
+    }
+
+    public JsonValue getValue(JsonStructure target) {
+        return null;
+    }
+
+    public JsonStructure add(JsonStructure target, JsonValue value) {
+        return null;
+    }
+
+    public JsonStructure replace(JsonStructure target, JsonValue value) {
+        return null;
+    }
+
+    public JsonStructure remove(JsonStructure target) {
+        return null;
+    }
+
+    public JsonObject add(JsonObject target, JsonValue value) {
+        return (JsonObject) add((JsonStructure) target, value);
+    }
+
+    public JsonArray add(JsonArray target, JsonValue value) {
+        return (JsonArray) add((JsonStructure) target, value);
+    }
+
+    public JsonObject replace(JsonObject target, JsonValue value) {
+        return (JsonObject) replace((JsonStructure) target, value);
+    }
+
+    public JsonArray replace(JsonArray target, JsonValue value) {
+        return (JsonArray) replace((JsonStructure) target, value);
+    }
+
+    public JsonObject remove(JsonObject target) {
+        return (JsonObject) remove((JsonStructure) target);
+    }
+
+    public JsonArray remove(JsonArray target) {
+        return (JsonArray) remove((JsonStructure) target);
+    }
+}

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonReader.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonReader.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonReader.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonReader.java Sun
Jul 19 20:20:22 2015
@@ -27,4 +27,8 @@ public interface JsonReader extends Clos
 
     @Override
     void close();
+    
+    default JsonValue readValue() {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonStructure.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonStructure.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonStructure.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonStructure.java
Sun Jul 19 20:20:22 2015
@@ -17,4 +17,8 @@
 package javax.json;
 
 public interface JsonStructure extends JsonValue {
+
+    default public JsonValue getValue(String jsonPointer) {
+        return new JsonPointer(jsonPointer).getValue(this);
+    }
 }

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java (added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java Sun
Jul 19 20:20:22 2015
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+public class JsonUtil {
+
+    public static JsonValue toJson(String jsonString) {
+        return null;
+    }
+}
+

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java Sun
Jul 19 20:20:22 2015
@@ -17,6 +17,17 @@
 package javax.json;
 
 public interface JsonValue {
+
+    /**
+     * The empty JSON object.
+     */
+    static final JsonObject EMPTY_JSON_OBJECT = Json.createObjectBuilder().build();
+
+    /**
+     * The empty JSON array.
+     */
+    static final JsonArray EMPTY_JSON_ARRAY = Json.createArrayBuilder().build();
+
     static final JsonValue NULL = new JsonValue() {
         @Override
         public ValueType getValueType() {
@@ -92,4 +103,12 @@ public interface JsonValue {
         TRUE, FALSE,
         NULL
     }
+    
+    default JsonObject asJsonObject() {
+        return JsonObject.class.cast(this);
+    }
+
+    default JsonArray asJsonArray() {
+        return JsonArray.class.cast(this);
+    }
 }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonWriter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonWriter.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonWriter.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonWriter.java Sun
Jul 19 20:20:22 2015
@@ -27,4 +27,6 @@ public interface JsonWriter extends Clos
 
     @Override
     void close();
+
+    void write(JsonValue value);
 }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/spi/JsonProvider.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/spi/JsonProvider.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/spi/JsonProvider.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/spi/JsonProvider.java
Sun Jul 19 20:20:22 2015
@@ -16,18 +16,23 @@
  */
 package javax.json.spi;
 
+import javax.json.JsonArray;
 import javax.json.JsonArrayBuilder;
 import javax.json.JsonBuilderFactory;
 import javax.json.JsonException;
+import javax.json.JsonNumber;
+import javax.json.JsonObject;
 import javax.json.JsonObjectBuilder;
 import javax.json.JsonReader;
 import javax.json.JsonReaderFactory;
+import javax.json.JsonString;
 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;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,6 +41,8 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -162,5 +169,37 @@ public abstract class JsonProvider {
     public abstract JsonArrayBuilder createArrayBuilder();
 
     public abstract JsonBuilderFactory createBuilderFactory(Map<String, ?> config);
+
+    public JsonObjectBuilder createObjectBuilder(JsonObject object) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonArrayBuilder createArrayBuilder(JsonArray array) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonString createValue(String value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonNumber createValue(int value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonNumber createValue(long value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonNumber createValue(double value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonNumber createValue(BigDecimal value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public JsonNumber createValue(BigInteger value) {
+        throw new UnsupportedOperationException();
+    }
 }
 

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java?rev=1691851&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
(added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
Sun Jul 19 20:20:22 2015
@@ -0,0 +1,57 @@
+/*
+ * 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.stream;
+
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collector;
+
+import javax.json.JsonArray;
+import javax.json.JsonArrayBuilder;
+import javax.json.JsonObject;
+import javax.json.JsonObjectBuilder;
+import javax.json.JsonValue;
+
+public class JsonCollectors {
+
+    private JsonCollectors() {
+    }
+
+    public static Collector<JsonValue, JsonArrayBuilder, JsonArray> toJsonArray() {
+        return null;
+    }
+
+    public static Collector<JsonValue, JsonObjectBuilder, JsonObject>
+                toJsonObject(Function<JsonValue, String> keyMapper,
+                             Function<JsonValue, JsonValue> valueMapper) {
+        return null;
+    }
+
+    public static Collector<JsonValue, Map<String, JsonArrayBuilder>, JsonObject>
+                groupingBy(Function<JsonValue, String> classifier,
+                           Collector<JsonValue, JsonArrayBuilder, JsonArray> downstream)
{
+
+        return null;
+    }
+
+    public static Collector<JsonValue, Map<String, JsonArrayBuilder>, JsonObject>
+                groupingBy(Function<JsonValue, String> classifier) {
+        return null;
+    }
+}
+

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonParser.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonParser.java?rev=1691851&r1=1691850&r2=1691851&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonParser.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonParser.java
Sun Jul 19 20:20:22 2015
@@ -18,6 +18,12 @@ package javax.json.stream;
 
 import java.io.Closeable;
 import java.math.BigDecimal;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonValue;
 
 public interface JsonParser extends Closeable {
     boolean hasNext();
@@ -45,5 +51,37 @@ public interface JsonParser extends Clos
         VALUE_STRING, VALUE_NUMBER, VALUE_TRUE, VALUE_FALSE, VALUE_NULL,
         END_OBJECT, END_ARRAY
     }
+    
+    default public JsonObject getObject() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public JsonValue getValue() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public JsonArray getArray() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public Stream<JsonValue> getArrayStream() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public Stream<Map.Entry<String,JsonValue>> getObjectStream() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public Stream<JsonValue> getValueStream() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public void skipArray() {
+        throw new UnsupportedOperationException();
+    }
+
+    default public void skipObject() {
+        throw new UnsupportedOperationException();
+    }
 }
 



Mime
View raw message