| commit | 09d7a249c20480fcf97750f844bf0e09449b577a | [log] [tgz] |
|---|---|---|
| author | Johannes <7671054+JohT@users.noreply.github.com> | Thu Sep 05 18:50:13 2019 +0200 |
| committer | Andrew Guibert <andy.guibert@gmail.com> | Thu Sep 05 11:50:13 2019 -0500 |
| tree | b0605ad09a6df0fa999f4bc464b272afd9b29d78 | |
| parent | 56f7f0bf5d3cca9d776f6723fcd9240877077fb2 [diff] |
Fix/payara4003 Inaccessible constructor with @ConstructorProperties (#280) * Support for @ConstructorProperties as proposed in jsonb-api/issues/115 https://github.com/eclipse-ee4j/jsonb-api/issues/115#issue-398276491 Signed-off-by: Johannes <johnnyt@gmx.at> * Added missing final keywords. Flag for generic serializers/adapters moved to ComponentMatcher. Signed-off-by: Roman Grigoriadi <roman.grigoriadi@oracle.com> * Update module-info.java Added required module for ConstructorProperties-Annotation Signed-off-by: Johannes <johnnyt@gmx.at> * Update pom.xml Added required module for ConstructorProperties-Annotation Signed-off-by: Johannes <johnnyt@gmx.at> * formatting Signed-off-by: Johannes <johnnyt@gmx.at> * Merged changes from original repository Signed-off-by: Johannes <johnnyt@gmx.at> * Support for @ConstructorProperties as proposed in jsonb-api/issues/115 Signed-off-by: Johannes <johnnyt@gmx.at> * Add builtin serializer for java.sql.Timestamp * Further tests, reset formatting Signed-off-by: Johannes <johnnyt@gmx.at> * fix for https://github.com/payara/Payara/issues/4003 Signed-off-by: Johannes <johnnyt@gmx.at> * test fixture names reverted back Signed-off-by: Johannes <johnnyt@gmx.at> * Added one currently ignored unit test for discussion Signed-off-by: Johannes <johnnyt@gmx.at> * removed message key for info log. Signed-off-by: Johannes <johnnyt@gmx.at>
Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding (JSR-367).
It defines a default mapping algorithm for converting existing Java classes to JSON suitable for the most cases:
Jsonb jsonb = JsonbBuilder.create(); String result = jsonb.toJson(someObject);
For whom it's not enough it provides rich customization abilities through a set of annotations and rich programmatic API:
// Create custom configuration JsonbConfig config = new JsonbConfig() .withNullValues(true) .withFormating(true); // Create Jsonb with custom configuration Jsonb jsonb = JsonbBuilder.create(config); // Use it! String result = jsonb.toJson(someObject);