|
|
|
@ -17,13 +17,14 @@ package com.jayway.jsonpath.internal.spi.json;
|
|
|
|
|
import com.jayway.jsonpath.InvalidJsonException; |
|
|
|
|
import com.jayway.jsonpath.JsonPathException; |
|
|
|
|
import com.jayway.jsonpath.spi.json.Mode; |
|
|
|
|
|
|
|
|
|
import net.minidev.json.JSONArray; |
|
|
|
|
import net.minidev.json.JSONObject; |
|
|
|
|
import net.minidev.json.JSONStyle; |
|
|
|
|
import net.minidev.json.mapper.AMapper; |
|
|
|
|
import net.minidev.json.mapper.DefaultMapperOrdered; |
|
|
|
|
import net.minidev.json.JSONValue; |
|
|
|
|
import net.minidev.json.parser.JSONParser; |
|
|
|
|
import net.minidev.json.parser.ParseException; |
|
|
|
|
import net.minidev.json.writer.JsonReaderI; |
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.InputStreamReader; |
|
|
|
@ -34,25 +35,25 @@ import java.util.Map;
|
|
|
|
|
public class JsonSmartJsonProvider extends AbstractJsonProvider { |
|
|
|
|
|
|
|
|
|
private final int parseMode; |
|
|
|
|
private final AMapper<?> mapper; |
|
|
|
|
private final JsonReaderI<?> mapper; |
|
|
|
|
|
|
|
|
|
public JsonSmartJsonProvider() { |
|
|
|
|
this(JSONParser.MODE_PERMISSIVE, DefaultMapperOrdered.DEFAULT); |
|
|
|
|
this(JSONParser.MODE_PERMISSIVE, JSONValue.defaultReader.DEFAULT_ORDERED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JsonSmartJsonProvider(int parseMode){ |
|
|
|
|
this(parseMode, DefaultMapperOrdered.DEFAULT); |
|
|
|
|
this(parseMode, JSONValue.defaultReader.DEFAULT_ORDERED); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JsonSmartJsonProvider(int parseMode, AMapper<?> mapper){ |
|
|
|
|
public JsonSmartJsonProvider(int parseMode, JsonReaderI<?> mapper){ |
|
|
|
|
this.parseMode = parseMode; |
|
|
|
|
this.mapper = mapper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Deprecated |
|
|
|
|
public JsonSmartJsonProvider(Mode mode) { |
|
|
|
|
this(mode.intValue(), DefaultMapperOrdered.DEFAULT); |
|
|
|
|
this(mode.intValue(), JSONValue.defaultReader.DEFAULT_ORDERED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Object createArray() { |
|
|
|
|