Jackson – Streaming Model examples
This Jackson tutorial show you how to use JsonGenerator to write JSON string and JSON array into a file, furthermore, read it with JsonParser. Jackson Streaming APIs: JsonGenerator – Write…
Favourite tutorials for developers
This Jackson tutorial show you how to use JsonGenerator to write JSON string and JSON array into a file, furthermore, read it with JsonParser. Jackson Streaming APIs: JsonGenerator – Write…
Gson provide simple toJson() and fromJson() methods to convert Java objects to / from JSON. The toJson() – Java object to JSON and fromJson() – JSON to Java object
In Jackson, we can use Tree Model to represent the JSON structure, and perform the CRUD operations via JsonNode, similar to the XML DOM tree. This Jackson Tree Model is…
In Jackson, we can use mapper.readValue(json, Map.class) to convert a JSON string to a Map
Few Jackson examples to convert a JSON array string to a List.
In Jackson, we can use @JsonView to limit or control fields display for different users. Puts @JsonView on field level to limit fields display for different views. Below example, show…
In Jackson, we can use @JsonInclude(JsonInclude.Include.NON_NULL) to ignore the null fields. To ignore the null fields, put @JsonInclude on class level or field level. Alternatively, we also can configure to…
This MinguoDate calendar system is primarily used in Taiwan (Republic of China…). To convert the current date to the Minguo date, just subtracts the current year with number 1911
In Java, you can use the following ways to measure elapsed time in Java: System.nanoTime() - This is the recommended solution to measure elapsed time in Java. We also can…
If Java 8, DateTimeFormatter, else SimpleDateFormat to change the date format in a String. Convert the String to LocalDateTime and change the date format with DateTimeFormatter. Convert the String to…