クラス JSONParser

java.lang.Object
io.github.takenoko4096.json.JSONParser

@NullMarked public class JSONParser extends Object
json文字列を解釈してjson構造に変換するクラス。
  • コンストラクタの詳細

    • JSONParser

      public JSONParser()
  • メソッドの詳細

    • parse

      public JSONValue<?> parse(String text) throws JSONParseException
      引数に渡された文字列をjsonとしてパースします。
      パラメータ:
      text - json
      戻り値:
      json値
      例外:
      JSONParseException - jsonが無効な場合。
    • object

      public static JSONObject object(String text) throws JSONParseException
      引数に渡された文字列をjsonオブジェクトとしてパースします。
      パラメータ:
      text - json
      戻り値:
      jsonオブジェクト
      例外:
      JSONParseException - jsonが無効な場合。
    • array

      public static JSONArray array(String text) throws JSONParseException
      引数に渡された文字列をjson配列としてパースします。
      パラメータ:
      text - json
      戻り値:
      json配列
      例外:
      JSONParseException - jsonが無効な場合。
    • structure

      public static JSONStructure structure(String text) throws JSONParseException
      引数に渡された文字列をjson構造としてパースします。
      パラメータ:
      text - json
      戻り値:
      json構造
      例外:
      JSONParseException - jsonが無効な場合。