/** * Construct a new {@code JsonbHttpMessageConverter} with the given configuration. * @param config the {@code JsonbConfig} for the underlying delegate */ public JsonbHttpMessageConverter(JsonbConfig config) { this.jsonb = JsonbBuilder.create(config); }
/** * Construct a new {@code JsonbHttpMessageConverter} with default configuration. */ public JsonbHttpMessageConverter() { this(JsonbBuilder.create()); }
/** * Construct a new {@code JsonbHttpMessageConverter} with the given configuration. * @param config the {@code JsonbConfig} for the underlying delegate */ public JsonbHttpMessageConverter(JsonbConfig config) { this.jsonb = JsonbBuilder.create(config); }
/** * Construct a new {@code JsonbHttpMessageConverter} with default configuration. */ public JsonbHttpMessageConverter() { this(JsonbBuilder.create()); }
JsonbSingleton() { this.jsonbInstance = JsonbBuilder.create(); } }
@Override public void configure(final Env env, final Config config, final Binder binder) { JsonbConfig jsonbConfig = new JsonbConfig(); if (configurer != null) { configurer.accept(jsonbConfig, config); } Jsonb jsonb = JsonbBuilder.create(jsonbConfig); binder.bind(Jsonb.class).toInstance(jsonb); Multibinder.newSetBinder(binder, Parser.class).addBinding() .toInstance(new YassonParser(type, jsonb)); Multibinder.newSetBinder(binder, Renderer.class).addBinding() .toInstance(new YassonRenderer(type, jsonb)); }
/** * Construct a new {@code JsonbHttpMessageConverter} with the given configuration. * @param config the {@code JsonbConfig} for the underlying delegate */ public JsonbHttpMessageConverter(JsonbConfig config) { this.jsonb = JsonbBuilder.create(config); }
/** * Construct a new {@code JsonbHttpMessageConverter} with the given configuration. * @param config the {@code JsonbConfig} for the underlying delegate */ public JsonbHttpMessageConverter(JsonbConfig config) { this.jsonb = JsonbBuilder.create(config); }
/** * Construct a new {@code JsonbHttpMessageConverter} with default configuration. */ public JsonbHttpMessageConverter() { this(JsonbBuilder.create()); }
JsonbSingleton() { this.jsonbInstance = JsonbBuilder.create(); } }
/** * Construct a new {@code JsonbHttpMessageConverter} with default configuration. */ public JsonbHttpMessageConverter() { this(JsonbBuilder.create()); }
public static FundTransferDTO jsonToFundTransferDTO(String fundTransferDTOJson) { Jsonb jsonb =JsonbBuilder.create(); return jsonb.fromJson(fundTransferDTOJson, FundTransferDTO.class); } }
public void init() { if (jsonb == null) { jsonb = JsonbBuilder.create(); } wrapAsList = Boolean.parseBoolean(config.read("span.converter.zipkin.logger.wrapAsList", "true")); }
@Produces @UiSpecProxy @ApplicationScoped Jsonb jsonb() { return JsonbBuilder.create(); }
public static TaskBean getTaskBpm(String taskId) { Response response = getWebTarget() .path(TASK) .path(taskId) .request(MediaType.APPLICATION_JSON_TYPE) .get(); if (isStatusOk(response)) { String json = response.readEntity(String.class); return JsonbBuilder.create().fromJson(json, TaskBean.class); } return null; }
public static TaskBean getTaskBpm(String taskId) { Response response = getWebTarget() .path(TASK) .path(taskId) .request(MediaType.APPLICATION_JSON_TYPE) .get(); if (isStatusOk(response)) { String json = response.readEntity(String.class); return JsonbBuilder.create().fromJson(json, TaskBean.class); } return null; }
@PostConstruct private void init() { defaultMapper = JsonbBuilder.create(new JsonbConfig().withPropertyOrderStrategy(PropertyOrderStrategy.LEXICOGRAPHICAL)); }
public UiSpecService(final Client client) { this.client = client; this.jsonb = JsonbBuilder.create(new JsonbConfig().setProperty("johnzon.cdi.activated", false)); this.closeJsonb = true; }
@Override // for debug purposes, don't use it for anything else public String toString() { try (final Jsonb jsonb = JsonbBuilder .create(new JsonbConfig().withFormatting(true).setProperty("johnzon.cdi.activated", false))) { return new RecordConverters() .toType(this, JsonObject.class, () -> Json.createBuilderFactory(emptyMap()), JsonProvider::provider, () -> jsonb) .toString(); } catch (final Exception e) { return super.toString(); } }
private static Jsonb newJsonb() { return JsonbBuilder .create(new JsonbConfig() .withPropertyOrderStrategy(PropertyOrderStrategy.LEXICOGRAPHICAL) .withFormatting(true)); }