Ignore:
Timestamp:
2017-12-23T02:40:43+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15682 - upgrade to JSR 374 (JSON Processing) API 1.1.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/javax/json/spi/JsonProvider.java

    r6756 r13231  
    22 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    33 *
    4  * Copyright (c) 2011-2013 Oracle and/or its affiliates. All rights reserved.
     4 * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved.
    55 *
    66 * The contents of this file are subject to the terms of either the GNU
     
    99 * may not use this file except in compliance with the License.  You can
    1010 * obtain a copy of the License at
    11  * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
    12  * or packager/legal/LICENSE.txt.  See the License for the specific
     11 * https://oss.oracle.com/licenses/CDDL+GPL-1.1
     12 * or LICENSE.txt.  See the License for the specific
    1313 * language governing permissions and limitations under the License.
    1414 *
    1515 * When distributing the software, include this License Header Notice in each
    16  * file and include the License file at packager/legal/LICENSE.txt.
     16 * file and include the License file at LICENSE.txt.
    1717 *
    1818 * GPL Classpath Exception:
     
    5050import java.io.Reader;
    5151import java.io.Writer;
     52import java.util.Collection;
    5253import java.util.Iterator;
    5354import java.util.Map;
    5455import java.util.ServiceLoader;
     56import java.math.BigDecimal;
     57import java.math.BigInteger;
     58import java.util.Optional;
    5559
    5660/**
     
    6165 *
    6266 * @see ServiceLoader
    63  * @author Jitendra Kotamraju
    6467 */
    6568public abstract class JsonProvider {
     
    7679
    7780    /**
    78      *
    7981     * Creates a JSON provider object. The provider is loaded using the
    8082     * {@link ServiceLoader#load(Class)} method. If there are no available
    8183     * service providers, this method returns the default service provider.
     84     * Users are recommended to cache the result of this method.
    8285     *
    8386     * @see ServiceLoader
     
    9093            return it.next();
    9194        }
    92 
    9395        try {
    9496            Class<?> clazz = Class.forName(DEFAULT_PROVIDER);
    95             return (JsonProvider)clazz.newInstance();
     97            return (JsonProvider) clazz.newInstance();
    9698        } catch (ClassNotFoundException x) {
    9799            throw new JsonException(
     
    115117     * Creates a JSON parser from the specified byte stream.
    116118     * The character encoding of the stream is determined
    117      * as defined in <a href="http://tools.ietf.org/rfc/rfc4627.txt">RFC 4627
     119     * as defined in <a href="http://tools.ietf.org/rfc/rfc7159.txt">RFC 7159
    118120     * </a>.
    119121     *
     
    193195     * Creates a JSON reader from a byte stream. The character encoding of
    194196     * the stream is determined as described in
    195      * <a href="http://tools.ietf.org/rfc/rfc4627.txt">RFC 4627</a>.
     197     * <a href="http://tools.ietf.org/rfc/rfc7159.txt">RFC 7159</a>.
    196198     *
    197199     * @param in a byte stream from which JSON is to be read
     
    246248
    247249    /**
    248      * Creates a JSON object builder
     250     * Creates a JSON object builder.
    249251     *
    250252     * @return a JSON object builder
     
    253255
    254256    /**
    255      * Creates a JSON array builder
     257     * Creates a JSON object builder, initialized with the specified object.
     258     *
     259     * @param object the initial JSON object in the builder
     260     * @return a JSON object builder
     261     *
     262     * @since 1.1
     263     */
     264    public JsonObjectBuilder createObjectBuilder(JsonObject object) {
     265        throw new UnsupportedOperationException();
     266    }
     267
     268    /**
     269     * Creates a JSON object builder, initialized with the data from specified {@code map}.
     270     * If the @{code map} contains {@link Optional}s then resulting JSON object builder
     271     * contains the key from the {@code map} only if the {@link Optional} is not empty.
     272     *
     273     * @param map the initial object in the builder
     274     * @return a JSON object builder
     275     * @exception IllegalArgumentException if the value from the {@code map} cannot be converted
     276     *            to the corresponding {@link JsonValue}
     277     *
     278     * @since 1.1
     279     */
     280    public JsonObjectBuilder createObjectBuilder(Map<String, Object> map) {
     281        throw new UnsupportedOperationException();
     282    }
     283
     284    /**
     285     * Creates a JSON array builder.
    256286     *
    257287     * @return a JSON array builder
    258288     */
    259289    public abstract JsonArrayBuilder createArrayBuilder();
     290
     291    /**
     292     * Creates a JSON array builder, initialized with the specified array.
     293     *
     294     * @param array the initial JSON array in the builder
     295     * @return a JSON array builder
     296     *
     297     * @since 1.1
     298     */
     299    public JsonArrayBuilder createArrayBuilder(JsonArray array) {
     300        throw new UnsupportedOperationException();
     301    }
     302
     303    /**
     304     * Creates JSON Pointer (<a href="http://tools.ietf.org/html/rfc6901">RFC 6901</a>)
     305     * from given {@code jsonPointer} string.
     306     * <ul>
     307     *     <li>An empty {@code jsonPointer} string defines a reference to the target itself.</li>
     308     *     <li>If the {@code jsonPointer} string is non-empty, it must be a sequence of '{@code /}' prefixed tokens.</li>
     309     * </ul>
     310     *
     311     * @param jsonPointer the JSON Pointer string
     312     * @throws NullPointerException if {@code jsonPointer} is {@code null}
     313     * @throws JsonException if {@code jsonPointer} is not a valid JSON Pointer
     314     * @return a JSON Pointer
     315     *
     316     * @since 1.1
     317     */
     318    public JsonPointer createPointer(String jsonPointer) {
     319        throw new UnsupportedOperationException();
     320    }
     321
     322    /**
     323     * Creates a JSON Patch builder (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>).
     324     *
     325     * @return a JSON Patch builder
     326     *
     327     * @since 1.1
     328     */
     329    public JsonPatchBuilder createPatchBuilder() {
     330        throw new UnsupportedOperationException();
     331    }
     332
     333    /**
     334     * Creates a JSON Patch builder
     335     * (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>),
     336     * initialized with the specified operations.
     337     *
     338     * @param array the initial patch operations
     339     * @return a JSON Patch builder
     340     *
     341     * @since 1.1
     342     */
     343    public JsonPatchBuilder createPatchBuilder(JsonArray array) {
     344        throw new UnsupportedOperationException();
     345    }
     346
     347    /**
     348     * Creates a JSON Patch (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>)
     349     * from the specified operations.
     350     *
     351     * @param array patch operations
     352     * @return a JSON Patch
     353     *
     354     * @since 1.1
     355     */
     356    public JsonPatch createPatch(JsonArray array) {
     357        throw new UnsupportedOperationException();
     358    }
     359
     360    /**
     361     * Generates a JSON Patch (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>)
     362     * from the source and target {@code JsonStructure}.
     363     * The generated JSON Patch need not be unique.
     364     *
     365     * @param source the source
     366     * @param target the target, must be the same type as the source
     367     * @return a JSON Patch which when applied to the source, yields the target
     368     *
     369     * @since 1.1
     370     */
     371    public JsonPatch createDiff(JsonStructure source, JsonStructure target) {
     372        throw new UnsupportedOperationException();
     373    }
     374
     375    /**
     376     * Creates JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC 7396</a>)
     377     * from specified {@code JsonValue}.
     378     *
     379     * @param patch the patch
     380     * @return a JSON Merge Patch
     381     *
     382     * @since 1.1
     383     */
     384    public JsonMergePatch createMergePatch(JsonValue patch) {
     385        throw new UnsupportedOperationException();
     386    }
     387
     388    /**
     389     * Generates a JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC 7396</a>)
     390     * from the source and target {@code JsonValue}s
     391     * which when applied to the {@code source}, yields the {@code target}.
     392     *
     393     * @param source the source
     394     * @param target the target
     395     * @return a JSON Merge Patch
     396     *
     397     * @since 1.1
     398     */
     399    public JsonMergePatch createMergeDiff(JsonValue source, JsonValue target) {
     400        throw new UnsupportedOperationException();
     401    }
     402
     403    /**
     404     * Creates a JSON array builder, initialized with the content of specified {@code collection}.
     405     * If the @{code collection} contains {@link Optional}s then resulting JSON array builder
     406     * contains the value from the {@code collection} only if the {@link Optional} is not empty.
     407     *
     408     * @param collection the initial data for the builder
     409     * @return a JSON array builder
     410     * @exception IllegalArgumentException if the value from the {@code collection} cannot be converted
     411     *            to the corresponding {@link JsonValue}
     412     *
     413     * @since 1.1
     414     */
     415    public JsonArrayBuilder createArrayBuilder(Collection<?> collection) {
     416        throw new UnsupportedOperationException();
     417    }
     418
    260419
    261420    /**
     
    272431    public abstract JsonBuilderFactory createBuilderFactory(Map<String,?> config);
    273432
     433    /**
     434     * Creates a JsonString.
     435     *
     436     * @param value a JSON string
     437     * @return the JsonString for the string
     438     *
     439     * @since 1.1
     440     */
     441    public JsonString createValue(String value) {
     442        throw new UnsupportedOperationException();
     443    }
     444
     445    /**
     446     * Creates a JsonNumber.
     447     *
     448     * @param value a JSON number
     449     * @return the JsonNumber for the number
     450     *
     451     * @since 1.1
     452     */
     453    public JsonNumber createValue(int value) {
     454        throw new UnsupportedOperationException();
     455    }
     456
     457    /**
     458     * Creates a JsonNumber.
     459     *
     460     * @param value a JSON number
     461     * @return the JsonNumber for the number
     462     *
     463     * @since 1.1
     464     */
     465    public JsonNumber createValue(long value) {
     466        throw new UnsupportedOperationException();
     467    }
     468
     469    /**
     470     * Creates a JsonNumber.
     471     *
     472     * @param value a JSON number
     473     * @return the JsonNumber for the number
     474     *
     475     * @since 1.1
     476     */
     477    public JsonNumber createValue(double value) {
     478        throw new UnsupportedOperationException();
     479    }
     480
     481    /**
     482     * Creates a JsonNumber.
     483     *
     484     * @param value a JSON number
     485     * @return the JsonNumber for the number
     486     *
     487     * @since 1.1
     488     */
     489    public JsonNumber createValue(BigDecimal value) {
     490        throw new UnsupportedOperationException();
     491    }
     492
     493    /**
     494     * Creates a JsonNumber.
     495     *
     496     * @param value a JSON number
     497     * @return the JsonNumber for the number
     498     *
     499     * @since 1.1
     500     */
     501    public JsonNumber createValue(BigInteger value) {
     502        throw new UnsupportedOperationException();
     503    }
    274504}
Note: See TracChangeset for help on using the changeset viewer.