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); } }
public static ObjectMapper create (JsonParserFactory parserFactory, JsonSerializerFactory serializerFactory) { return new ObjectMapperImpl(parserFactory, serializerFactory); }
public static ObjectMapper create (JsonParserFactory parserFactory, JsonSerializerFactory serializerFactory) { return new ObjectMapperImpl(parserFactory, serializerFactory); }
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper createUseAnnotations (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useAnnotations(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseAnnotations (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useAnnotations(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper createUseAnnotations (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useAnnotations(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseProperties (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); jpf.usePropertiesFirst(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.usePropertiesFirst(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseProperties (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); jpf.usePropertiesFirst(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.usePropertiesFirst(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public BoonMapper() { mapper = new ObjectMapperImpl( new JsonParserFactory().lax(), new JsonSerializerFactory()); }
public static ObjectMapper createUseProperties (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); jpf.usePropertiesFirst(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.usePropertiesFirst(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
@Parameterized.Parameters public static Collection<Object[]> data() { Object[][] data = new Object[][]{ {new ObjectMapperImpl(new JsonParserFactory().usePropertyOnly().acceptSingleValueAsArray(), new JsonSerializerFactory().usePropertyOnly())}, {new ObjectMapperImpl(new JsonParserFactory().useFieldsOnly().acceptSingleValueAsArray(), new JsonSerializerFactory().useFieldsOnly())} }; return Arrays.asList(data); }
@Before public void setUp() throws Exception { objectMapper = new ObjectMapperImpl(new JsonParserFactory().useFieldsFirst().caseInsensitiveFields(), new JsonSerializerFactory().useFieldsFirst()); }
@Before public void setUp() throws Exception { objectMapper = new ObjectMapperImpl(new JsonParserFactory().useFieldsOnly().caseInsensitiveFields(), new JsonSerializerFactory().useFieldsOnly()); }
@Before public void setUp() throws Exception { objectMapper = new ObjectMapperImpl(new JsonParserFactory().usePropertyOnly().caseInsensitiveFields(), new JsonSerializerFactory().usePropertyOnly()); }
public void test3() { user = new User("red", "yellow", "green", "purple"); puts(user.getFavoriteColors()); final JsonParserFactory jsonParserFactory = new JsonParserFactory().usePropertiesFirst().useAnnotations(); final JsonSerializerFactory serializerFactory = new JsonSerializerFactory().includeNulls().useAnnotations(); final ObjectMapper objectMapper = new ObjectMapperImpl(jsonParserFactory, serializerFactory); json = objectMapper.toJson(user); puts(json); user2 = objectMapper.fromJson(json, User.class); puts(user.getFavoriteColors()); ok = user.equals(user2) || die("Users should be equal", user, user2); }