Class MultipleJsonParser

java.lang.Object
net.minidev.json.parser.MultipleJsonParser

public class MultipleJsonParser extends Object
json-smart will parse multiple json separated by blank or line break character.

multiple json example:
{"json1": "value1"} {"json2": "value2"}
or
[{"json1-key1": "value1"}] [{"json2": "value2"}]

  • Constructor Details

    • MultipleJsonParser

      public MultipleJsonParser(byte[] in, int permissiveMode)
    • MultipleJsonParser

      public MultipleJsonParser(InputStream in, int permissiveMode)
    • MultipleJsonParser

      public MultipleJsonParser(Reader in, int permissiveMode)
    • MultipleJsonParser

      public MultipleJsonParser(String in, int permissiveMode)
  • Method Details

    • parseNext

      public Object parseNext() throws ParseException
      Parse next json with defaultReader
      use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
      Throws:
      ParseException
    • parseNext

      public <T> T parseNext(JsonReaderI<T> mapper) throws ParseException
      Parse next json with target JsonReaderI
      use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
      Throws:
      ParseException
    • parseNext

      public <T> T parseNext(Class<T> mapTo) throws ParseException
      Parse next json with target Class
      Throws:
      ParseException
    • hasNext

      public boolean hasNext()
      Checks if there is another JSON value available in the input.
      Returns:
      true if another JSON value exists, false otherwise