geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1770850 - 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 Tue, 22 Nov 2016 14:55:17 GMT
Author: struberg
Date: Tue Nov 22 14:55:17 2016
New Revision: 1770850

URL: http://svn.apache.org/viewvc?rev=1770850&view=rev
Log:
GERONIMO-6558 sync our API with the official sig

Added:
    geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh   (with props)
Modified:
    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/JsonUtil.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/JsonCollectors.java
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonGenerator.java

Added: geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh?rev=1770850&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh (added)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh Tue Nov 22 14:55:17 2016
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#    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.
+
+# file to run the JPA signature tests
+
+
+# HOWTO:
+#
+# Download sigtestdev.jar from https://wiki.openjdk.java.net/display/CodeTools/SigTest
+# Copy to a local folder and set SIGTEST_HOME to it.
+
+
+# not needed, we don't have deps to other specs in JPA
+# mvn clean dependency:copy-dependencies
+
+# generate the SIG for the RI
+# there is currently no official jar yet. If availablen, then: curl  http://repo1.maven.org/maven2/javax/json/...
> ./target/javax.json-1.1.jar
+# java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./target/javax.json-1.1.jar
-Package javax.json  -FileName target/javax.json-1.1.sig -static
+
+# this generates the signature for our own jpa api
+java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./target/geronimo-json_1.1_spec-1.0-SNAPSHOT.jar
-Package javax.json  -FileName target/geronimo-json-api.sig -static
+
+# then open the 2 generated sig files in a diff browser and the only difference should be
some internal variables.

Propchange: geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-json_1.1_spec/run_sigtest.sh
------------------------------------------------------------------------------
    svn:executable = *

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=1770850&r1=1770849&r2=1770850&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 Tue Nov
22 14:55:17 2016
@@ -211,4 +211,14 @@ public final class Json {
     public static JsonValue mergePatch(JsonValue source, JsonValue patch) {
         return JsonProvider.provider().mergePatch(source, patch);
     }
+
+    /**
+     * Create a JsonPointer for the given path
+     *
+     * @since 1.1
+     */
+    public static JsonPointer createJsonPointer(String path) {
+        return JsonProvider.provider().createJsonPointer(path);
+    }
+
 }

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=1770850&r1=1770849&r2=1770850&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
Tue Nov 22 14:55:17 2016
@@ -44,51 +44,99 @@ public interface JsonArrayBuilder {
 
     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);
+    default JsonArrayBuilder addAll(JsonArrayBuilder builder) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, JsonValue value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, String value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, BigDecimal value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, BigInteger value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, int value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, long value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, double value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, boolean value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder addNull(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, JsonObjectBuilder builder) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder add(int index, JsonArrayBuilder builder) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, JsonValue value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, String value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, BigDecimal value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, BigInteger value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, int value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, long value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, double value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, boolean value) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder setNull(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, JsonObjectBuilder builder) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder set(int index, JsonArrayBuilder builder) {
+        throw new UnsupportedOperationException();
+    }
+
+    default JsonArrayBuilder remove(int index) {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: 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=1770850&r1=1770849&r2=1770850&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonUtil.java Tue
Nov 22 14:55:17 2016
@@ -17,7 +17,7 @@
 
 package javax.json;
 
-public class JsonUtil {
+public final class JsonUtil {
 
     public static JsonValue toJson(String jsonString) {
         return null;

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=1770850&r1=1770849&r2=1770850&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 Tue
Nov 22 14:55:17 2016
@@ -18,15 +18,24 @@ package javax.json;
 
 import java.io.Closeable;
 
+/**
+ * Write a JsonObject, JsonArray JsonStructure or more generic
+ * a JsonValue to the output.
+ *
+ * @see JsonWriterFactory
+ */
 public interface JsonWriter extends Closeable {
+
     void writeArray(JsonArray array);
 
     void writeObject(JsonObject object);
 
     void write(JsonStructure value);
 
+    default void write(JsonValue value) {
+        throw new UnsupportedOperationException();
+    }
+
     @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=1770850&r1=1770849&r2=1770850&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
Tue Nov 22 14:55:17 2016
@@ -234,25 +234,19 @@ public abstract class JsonProvider {
      * Applying this JsonPatch to the source you will give you the target.
      * @since 1.1
      */
-    public JsonPatch createPatch(JsonStructure source, JsonStructure target) {
-        throw new UnsupportedOperationException();
-    }
+    public abstract JsonPatch createPatch(JsonStructure source, JsonStructure target);
 
     /**
      * Create a new JsonPatchBuilder
      * @since 1.1
      */
-    public JsonPatchBuilder createPatchBuilder() {
-        throw new UnsupportedOperationException();
-    }
+    public abstract JsonPatchBuilder createPatchBuilder();
 
     /**
      * Create a new JsonPatchBuilder from initial data.
      * @since 1.1
      */
-    public JsonPatchBuilder createPatchBuilder(JsonArray initialData) {
-        throw new UnsupportedOperationException();
-    }
+    public abstract JsonPatchBuilder createPatchBuilder(JsonArray initialData);
 
     /**
      * Create a merged patch by comparing the source to the target.
@@ -261,17 +255,14 @@ public abstract class JsonProvider {
      * @see #createPatch(JsonStructure, JsonStructure)
      * @since 1.1
      */
-    public JsonValue createMergePatch(JsonValue source , JsonValue target) {
-        throw new UnsupportedOperationException();
-    }
+    public abstract JsonValue createMergePatch(JsonValue source , JsonValue target);
 
     /**
      * Merge the given patch to the existing source
      * @return the result of applying the patch to the source
      * @since 1.1
      */
-    public JsonValue mergePatch(JsonValue source, JsonValue patch) {
-        throw new UnsupportedOperationException();
-    }
+    public abstract JsonValue mergePatch(JsonValue source, JsonValue patch);
+
 }
 

Modified: 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=1770850&r1=1770849&r2=1770850&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonCollectors.java
Tue Nov 22 14:55:17 2016
@@ -27,7 +27,7 @@ import javax.json.JsonObject;
 import javax.json.JsonObjectBuilder;
 import javax.json.JsonValue;
 
-public class JsonCollectors {
+public final class JsonCollectors {
 
     private JsonCollectors() {
     }

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonGenerator.java?rev=1770850&r1=1770849&r2=1770850&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonGenerator.java
(original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/stream/JsonGenerator.java
Tue Nov 22 14:55:17 2016
@@ -33,6 +33,14 @@ public interface JsonGenerator extends F
 
     JsonGenerator writeStartArray(String name);
 
+    /**
+     * Write the key with a colon;
+     *
+     * @throws JsonGenerationException if this method is not called within an object context
+     * @since 1.1
+     */
+    JsonGenerator writeKey(String name);
+
     JsonGenerator write(String name, JsonValue value);
 
     JsonGenerator write(String name, String value);



Mime
View raw message