We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ε―ΉεδΈδΈͺJSONεε€δΈͺJSONPathζ±εΌηεΊζ―οΌFASTJSON2ζδΎδΊδΈι¨ηAPIοΌθ½ζεζ§θ½οΌε¦δΈοΌ
public class JSONPath { public static JSONPath of(String[] paths, Type[] types) { return of(paths, types, null, null); } public static JSONPath of( String[] paths, Type[] types, String[] formats, ZoneId zoneId, JSONReader.Feature... features ); }
θΏζ ·ζι ηJSONPathοΌε¨evalζθ extractζΉζ³ζ§θ‘ζΆοΌδΌθΏεεtypesη±»εεΉι η对豑ζ°η»γ
JSONObject object = JSONObject.of("id", 1001, "name", "DataWorks", "date", "2017-07-14"); JSONPath jsonPath = JSONPath.of( new String[]{"$.id", "$.name", "$.date"}, new Type[]{Long.class, String.class, Date.class} ); Object[] expected = new Object[]{1001L, "DataWorks", DateUtils.parseDate("2017-07-14")}; Object[] evalResult = (Object[]) jsonPath.eval(object); assertArrayEquals(expected, evalResult); String jsonStr = object.toString(); Object[] result = (Object[]) jsonPath.extract(jsonStr); assertArrayEquals(expected, result);