public Result runBoon() { String result = null; String error = null; long time; Iterator<Object> query = null; long now = System.currentTimeMillis(); try { if (!optionAsValues) { throw new UnsupportedOperationException("Not supported!"); } io.gatling.jsonpath.JsonPath jsonPath = JsonPath$.MODULE$.compile(path).right().get(); JsonParser jsonParser = new JsonParserCharArray(); Object jsonModel = jsonParser.parse(json); query = jsonPath.query(jsonModel); } catch (Exception e) { error = getError(e); } finally { time = System.currentTimeMillis() - now; if (query != null) { List<Object> res = new ArrayList<Object>(); while (query.hasNext()) { res.add(query.next()); } ObjectMapper mapper = new ObjectMapperImpl(); result = mapper.toJson(res); } return new Result("boon", time, result, error); } }
@Override public <T> T fromJson( char[] chars, Class<T> clazz ) { return readValue ( chars, clazz ); }
@Override public String toJson( Object value ) { return this.writeValueAsString ( value ); }
@Override public Object fromJson( String json ) { return parser().parse(json); }
@Override public Object fromJson( InputStream reader ) { return parser().parse(reader); } }
public static ObjectMapper create (JsonParserFactory parserFactory, JsonSerializerFactory serializerFactory) { return new ObjectMapperImpl(parserFactory, serializerFactory); }
@Override public Object fromJson( InputStream reader ) { return parser().parse(reader); } }
@Override public <T> T fromJson( byte[] bytes, Class<T> clazz ) { return readValue ( bytes, clazz ); }
@Override public String toJson( Object value ) { return this.writeValueAsString ( value ); }
public static ObjectMapper create (JsonParserFactory parserFactory, JsonSerializerFactory serializerFactory) { return new ObjectMapperImpl(parserFactory, serializerFactory); }
@Override public Object fromJson( Reader reader ) { return parser().parse(reader); }
@Override public <T> T fromJson( byte[] bytes, Class<T> clazz ) { return readValue ( bytes, clazz ); }
@Override public String toJson( Object value ) { return this.writeValueAsString ( value ); }
public static ObjectMapper create (JsonParserFactory parserFactory, JsonSerializerFactory serializerFactory) { return new ObjectMapperImpl(parserFactory, serializerFactory); }
@Override public Object fromJson( Reader reader ) { return parser().parse(reader); }
@Override public <T> T fromJson( Reader reader, Class<T> clazz ) { return readValue ( reader, clazz ); }
@Override public void toJson( Object value, Appendable appendable ) { try { appendable.append ( this.writeValueAsString ( value ) ); } catch ( IOException e ) { Exceptions.handle ( e ); } }
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
@Override public Object fromJson( InputStream reader ) { return parser().parse(reader); } }
@Override public <T> T fromJson( char[] chars, Class<T> clazz ) { return readValue ( chars, clazz ); }