@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
protected Jsonb getJsonb(Class<?> type) { ContextResolver<Jsonb> contextResolver = providers.getContextResolver(Jsonb.class, MediaType.APPLICATION_JSON_TYPE); if (contextResolver != null) { return contextResolver.getContext(type); } else { if (jsonbObj == null) { JsonProviderImpl jProviderImpl = new JsonProviderImpl(); JsonBindingBuilder jbBuilder = new JsonBindingBuilder(); jsonbObj = jbBuilder.withProvider(jProviderImpl).build(); } return jsonbObj; } }
protected Jsonb getJsonb(Class<?> type) { ContextResolver<Jsonb> contextResolver = providers.getContextResolver(Jsonb.class, MediaType.APPLICATION_JSON_TYPE); if (contextResolver != null) { return contextResolver.getContext(type); } else { if (jsonbObj == null) { JsonProviderImpl jProviderImpl = new JsonProviderImpl(); JsonBindingBuilder jbBuilder = new JsonBindingBuilder(); jsonbObj = jbBuilder.withProvider(jProviderImpl).build(); } return jsonbObj; } }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
.create(); private final Jsonb yasson = new JsonBindingProvider().create() .withProvider(new org.glassfish.json.JsonProviderImpl()) .build(); private static final AbstractTransformer FLEX_IDENTITY = new AbstractTransformer() {
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<String, Object>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<String, Object>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonWriterFactory createWriterFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonWriterFactoryImpl(providerConfig, prettyPrinting, pool); }
@Override public JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config) { Map<String, Object> providerConfig; boolean prettyPrinting; BufferPool pool; if (config == null) { providerConfig = Collections.emptyMap(); prettyPrinting = false; pool = bufferPool; } else { providerConfig = new HashMap<>(); if (prettyPrinting=JsonProviderImpl.isPrettyPrintingEnabled(config)) { providerConfig.put(JsonGenerator.PRETTY_PRINTING, true); } pool = (BufferPool)config.get(BufferPool.class.getName()); if (pool != null) { providerConfig.put(BufferPool.class.getName(), pool); } else { pool = bufferPool; } providerConfig = Collections.unmodifiableMap(providerConfig); } return new JsonGeneratorFactoryImpl(providerConfig, prettyPrinting, pool); }