Changeset af9ce6d for core


Ignore:
Timestamp:
Nov 19, 2018 2:44:31 PM (19 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
54184f2
Parents:
a1baf85
Message:

Change json lib from net.minidev.json to com.json.simple
because libjson-simple-java is in Debian (jessie+) and Ubuntu (trusty+).
Version 1.1.1 (Feb. 2012) from:
https://github.com/cliftonlabs/json-simple
https://github.com/fangyidong/json-simple/releases
License: Apache 2 (same as minidev)
Release info:
https://cliftonlabs.github.io/json-simple/
Current version 2.3.0 (in buster/sid/bionic+) is compatible.
The 3.x branch is incompatible.

No known external users of minidev (JSON_SMART) which was added in April 2018
(0.9.35) for DoH and the eventual bundling of i2pcontrol.
The i2pcontrol plugin was switched from json-simple to minidev in early 2018,
but it bundles the minidev source. When we bundle, we can switch it back.

Does not compile; see checkins to follow.

Location:
core/java/src
Files:
11 added
27 deleted
1 moved

Legend:

Unmodified
Added
Removed
  • core/java/src/org/json/simple/parser/ContentHandler.java

    ra1baf85 raf9ce6d  
    1 package net.minidev.json.parser;
     1package org.json.simple.parser;
    22
    3 /*
    4  *    Copyright 2011 JSON-SMART authors
    5  *
    6  * Licensed under the Apache License, Version 2.0 (the "License");
    7  * you may not use this file except in compliance with the License.
    8  * You may obtain a copy of the License at
    9  *
    10  * http://www.apache.org/licenses/LICENSE-2.0
    11  *
    12  * Unless required by applicable law or agreed to in writing, software
    13  * distributed under the License is distributed on an "AS IS" BASIS,
    14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  * See the License for the specific language governing permissions and
    16  * limitations under the License.
    17  */
    183import java.io.IOException;
    194
    205/**
    21  * A simplified and stoppable SAX-like content handler for stream processing of
    22  * JSON text.
     6 * A simplified and stoppable SAX-like content handler for stream processing of JSON text.
    237 *
    248 * @see org.xml.sax.ContentHandler
     9 * @see org.json.simple.parser.JSONParser#parse(java.io.Reader, ContentHandler, boolean)
    2510 *
    26  * @author FangYidong fangyidong@yahoo.com.cn
     11 * @author FangYidong<fangyidong@yahoo.com.cn>
    2712 */
    2813public interface ContentHandler {
    2914        /**
    30          * Receive notification of the beginning of JSON processing. The parser will
    31          * invoke this method only once.
    32          *
    33          * @throws ParseException
    34          *             - JSONParser will stop and throw the same exception to the
    35          *             caller when receiving this exception.
     15         * Receive notification of the beginning of JSON processing.
     16         * The parser will invoke this method only once.
     17     *
     18         * @throws ParseException
     19         *                      - JSONParser will stop and throw the same exception to the caller when receiving this exception.
    3620         */
    3721        void startJSON() throws ParseException, IOException;
    38 
     22       
    3923        /**
    4024         * Receive notification of the end of JSON processing.
     
    4327         */
    4428        void endJSON() throws ParseException, IOException;
    45 
     29       
    4630        /**
    4731         * Receive notification of the beginning of a JSON object.
     
    4933         * @return false if the handler wants to stop parsing after return.
    5034         * @throws ParseException
    51          *             - JSONParser will stop and throw the same exception to the
    52          *             caller when receiving this exception.
    53          * @see #endJSON
     35     *          - JSONParser will stop and throw the same exception to the caller when receiving this exception.
     36     * @see #endJSON
    5437         */
    5538        boolean startObject() throws ParseException, IOException;
    56 
     39       
    5740        /**
    5841         * Receive notification of the end of a JSON object.
     
    6043         * @return false if the handler wants to stop parsing after return.
    6144         * @throws ParseException
    62         *
    63         * @see #startObject
     45    *
     46    * @see #startObject
    6447         */
    6548        boolean endObject() throws ParseException, IOException;
    66 
     49       
    6750        /**
    6851         * Receive notification of the beginning of a JSON object entry.
    6952         *
    70          * @param key
    71          *            - Key of a JSON object entry.
     53         * @param key - Key of a JSON object entry.
    7254         *
    7355         * @return false if the handler wants to stop parsing after return.
    7456         * @throws ParseException
    75         *
    76         * @see #endObjectEntry
     57    *
     58    * @see #endObjectEntry
    7759         */
    7860        boolean startObjectEntry(String key) throws ParseException, IOException;
    79 
     61       
    8062        /**
    8163         * Receive notification of the end of the value of previous object entry.
     
    8365         * @return false if the handler wants to stop parsing after return.
    8466         * @throws ParseException
    85         *
    86         * @see #startObjectEntry
     67    *
     68    * @see #startObjectEntry
    8769         */
    8870        boolean endObjectEntry() throws ParseException, IOException;
    89 
     71       
    9072        /**
    9173         * Receive notification of the beginning of a JSON array.
     
    9375         * @return false if the handler wants to stop parsing after return.
    9476         * @throws ParseException
    95         *
    96         * @see #endArray
     77    *
     78    * @see #endArray
    9779         */
    9880        boolean startArray() throws ParseException, IOException;
    99 
     81       
    10082        /**
    10183         * Receive notification of the end of a JSON array.
     
    10385         * @return false if the handler wants to stop parsing after return.
    10486         * @throws ParseException
    105         *
    106         * @see #startArray
     87    *
     88    * @see #startArray
    10789         */
    10890        boolean endArray() throws ParseException, IOException;
    109 
     91       
    11092        /**
    111          * Receive notification of the JSON primitive values: java.lang.String,
    112          * java.lang.Number, java.lang.Boolean null
     93         * Receive notification of the JSON primitive values:
     94         *      java.lang.String,
     95         *      java.lang.Number,
     96         *      java.lang.Boolean
     97         *      null
    11398         *
    114          * @param value
    115          *            - Instance of the following: java.lang.String,
    116          *            java.lang.Number, java.lang.Boolean null
     99         * @param value - Instance of the following:
     100         *                      java.lang.String,
     101         *                      java.lang.Number,
     102         *                      java.lang.Boolean
     103         *                      null
    117104         *
    118105         * @return false if the handler wants to stop parsing after return.
     
    120107         */
    121108        boolean primitive(Object value) throws ParseException, IOException;
    122 
     109               
    123110}
Note: See TracChangeset for help on using the changeset viewer.