/** * Instantiate a new JsonPath instance. * * @param stream The stream containing the Object document */ public static JsonPath with(InputStream stream) { return new JsonPath(stream); }
/** * Instantiate a new JsonPath instance. * * @param file The file containing the Object document */ public static JsonPath from(File file) { return new JsonPath(file); }
/** * Instantiate a new JsonPath instance. * * @param reader The reader containing the Object document */ public static JsonPath from(Reader reader) { return new JsonPath(reader); }
/** * Instantiate a new JsonPath instance. * * @param file The file containing the Object document */ public static JsonPath with(File file) { return new JsonPath(file); }
/** * Instantiate a new JsonPath instance. * * @param text The text containing the Object document */ public static JsonPath from(String text) { return new JsonPath(text); }
/** * Instantiate a new JsonPath instance. * * @param text The text containing the Object document */ public static JsonPath given(String text) { return new JsonPath(text); }
/** * Instantiate a new JsonPath instance. * * @param text The text containing the Object document */ public static JsonPath with(String text) { return new JsonPath(text); }
/** * Instantiate a new JsonPath instance. * * @param url The URI containing the Object document */ public static JsonPath with(URL url) { return new JsonPath(url); }
/** * Instantiate a new JsonPath instance. * * @param stream The stream containing the Object document */ public static JsonPath from(InputStream stream) { return new JsonPath(stream); }
/** * Instantiate a new JsonPath instance. * * @param url The URI containing the Object document */ public static JsonPath from(URL url) { return new JsonPath(url); }
/** * Configure JsonPath to with a specific JsonPathConfig. * * @param config The JsonPath config * @return a new JsonPath instance */ public JsonPath using(JsonPathConfig config) { return new JsonPath(this, config); }
/** * Instantiate a new JsonPath instance. * * @param stream The stream containing the Object document */ public static JsonPath given(InputStream stream) { return new JsonPath(stream); }
/** * Instantiate a new JsonPath instance. * * @param file The file containing the Object document */ public static JsonPath given(File file) { return new JsonPath(file); }
/** * Instantiate a new JsonPath instance. * * @param reader The reader containing the Object document */ public static JsonPath given(Reader reader) { return new JsonPath(reader); }
/** * Instantiate a new JsonPath instance. * * @param url The URL containing the Object document */ public static JsonPath given(URL url) { return new JsonPath(url); }
/** * Instantiate a new JsonPath instance. * * @param reader The reader containing the Object document */ public static JsonPath with(Reader reader) { return new JsonPath(reader); }
/** * Configure JsonPath to use a specific Gson object mapper factory * * @param factory The gson object mapper factory instance * @return a new JsonPath instance */ public JsonPath using(GsonObjectMapperFactory factory) { return new JsonPath(this, jsonPathConfig.gsonObjectMapperFactory(factory)); }
/** * Add a parameter for the expression. Example: * <pre> * String name = System.console().readLine(); * List<Map> books = with(Object).param("name", name).get("store.book.findAll { book -> book.author == name }"); * </pre> * * @param key The name of the parameter. Just use this name in your expression as a variable * @param value The value of the parameter * @return New JsonPath instance with the parameter set */ public JsonPath param(String key, Object value) { JsonPath newP=new JsonPath(this, config); if(newP.params==null) { newP.params=new HashMap<String, Object>(); } newP.params.put(key, value); return newP; }
/** * Configure JsonPath to use a specific Jackson 2 object mapper factory * * @param factory The Jackson 2 object mapper factory instance * @return a new JsonPath instance */ public JsonPath using(Jackson2ObjectMapperFactory factory) { return new JsonPath(this, getJsonPathConfig().jackson2ObjectMapperFactory(factory)); }
/** * Configure JsonPath to use a specific Jackson object mapper factory * * @param factory The Jackson object mapper factory instance * @return a new JsonPath instance */ public JsonPath using(Jackson1ObjectMapperFactory factory) { return new JsonPath(this, getJsonPathConfig().jackson1ObjectMapperFactory(factory)); }