com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule Java Examples
The following examples show how to use
com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractAdminApplicationTest.java From Moss with Apache License 2.0 | 5 votes |
protected WebTestClient createWebClient(int port) { ObjectMapper mapper = new ObjectMapper().registerModule(new JsonOrgModule()); return WebTestClient.bindToServer() .baseUrl("http://localhost:" + port) .exchangeStrategies(ExchangeStrategies.builder().codecs((configurer) -> { configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper)); configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper)); }).build()) .build(); }
Example #2
Source File: AdminApplicationDiscoveryTest.java From Moss with Apache License 2.0 | 5 votes |
private WebTestClient createWebClient(int port) { ObjectMapper mapper = new ObjectMapper().registerModule(new JsonOrgModule()); return WebTestClient.bindToServer() .baseUrl("http://localhost:" + port) .exchangeStrategies(ExchangeStrategies.builder().codecs((configurer) -> { configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper)); configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper)); }).build()) .build(); }
Example #3
Source File: WebConfig.java From jkes with Apache License 2.0 | 5 votes |
@Bean public HttpMessageConverters customConverters() { MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter(); jsonConverter.setSupportedMediaTypes(Arrays.asList( new MediaType("application", "json"), new MediaType("text", "json") )); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new JsonOrgModule()); jsonConverter.setObjectMapper(objectMapper); return new HttpMessageConverters(jsonConverter); }
Example #4
Source File: TaskStatusesTracker.java From dcos-commons with Apache License 2.0 | 5 votes |
public Response getJson(@QueryParam("plan") String filterPlan, @QueryParam("phase") String filterPhase, @QueryParam("step") String filterStep, @QueryParam("sync") boolean requireSync) { ObjectMapper jsonMapper = new ObjectMapper(); jsonMapper.registerModule(new Jdk8Module()); jsonMapper.registerModule(new JsonOrgModule()); List<PlanResponse> serviceResponse = getTaskStatuses(filterPlan, filterPhase, filterStep); JSONArray response = jsonMapper.convertValue(serviceResponse, JSONArray.class); return ResponseUtils.jsonOkResponse(response); }
Example #5
Source File: TaskReservationsTracker.java From dcos-commons with Apache License 2.0 | 5 votes |
public Response getJson(@QueryParam("plan") String filterPlan, @QueryParam("phase") String filterPhase, @QueryParam("step") String filterStep, @QueryParam("sync") boolean requireSync) { Map<String, Set<String>> resourceIdsByAgentHost = SchedulerUtils.getResourceIdsByAgentHost(stateStore); ObjectMapper jsonMapper = new ObjectMapper(); jsonMapper.registerModule(new Jdk8Module()); jsonMapper.registerModule(new JsonOrgModule()); JSONObject response = jsonMapper.convertValue(resourceIdsByAgentHost, JSONObject.class); return ResponseUtils.jsonOkResponse(response); }
Example #6
Source File: OfferOutcomeTrackerV2.java From dcos-commons with Apache License 2.0 | 5 votes |
public Response getJson( @QueryParam("plan") String plan, @QueryParam("phase") String phase, @QueryParam("step") String step, @QueryParam("sync") boolean sync) { ObjectMapper jsonMapper = new ObjectMapper(); jsonMapper.registerModule(new Jdk8Module()); jsonMapper.registerModule(new JsonOrgModule()); JSONObject response = jsonMapper.convertValue(this.getSummary(), JSONObject.class); response.put("offers", this.getSummary().toJson()); return ResponseUtils.jsonOkResponse(response); }
Example #7
Source File: AdminApplicationDiscoveryTest.java From spring-boot-admin with Apache License 2.0 | 5 votes |
private WebTestClient createWebClient(int port) { ObjectMapper mapper = new ObjectMapper().registerModule(new JsonOrgModule()); return WebTestClient.bindToServer().baseUrl("http://localhost:" + port) .exchangeStrategies(ExchangeStrategies.builder().codecs((configurer) -> { configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper)); configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper)); }).build()).build(); }
Example #8
Source File: AbstractAdminApplicationTest.java From spring-boot-admin with Apache License 2.0 | 5 votes |
protected WebTestClient createWebClient(int port) { ObjectMapper mapper = new ObjectMapper().registerModule(new JsonOrgModule()); return WebTestClient.bindToServer().baseUrl("http://localhost:" + port) .exchangeStrategies(ExchangeStrategies.builder().codecs((configurer) -> { configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper)); configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper)); }).build()).build(); }
Example #9
Source File: ClientUtil.java From oxAuth with MIT License | 4 votes |
public static String toPrettyJson(JSONObject jsonObject) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JsonOrgModule()); return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObject); }
Example #10
Source File: ServerUtil.java From oxAuth with MIT License | 4 votes |
public static String toPrettyJson(JSONObject jsonObject) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JsonOrgModule()); return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObject); }
Example #11
Source File: JSONWebKeySet.java From oxAuth with MIT License | 4 votes |
private String toPrettyJson(JSONObject jsonObject) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JsonOrgModule()); return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObject); }
Example #12
Source File: JwtUtil.java From oxAuth with MIT License | 4 votes |
public static JSONObject fromJson(String json) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JsonOrgModule()); return mapper.readValue(json, JSONObject.class); }