Home » Tag Archives: JSON

Tag Archives: JSON

JSON and XML: How Do They Compare?

java-interview-questions-answers

JSON and XML: How Do They Compare? JSON and XML are two human-readable text formats that have emerged as rivals over the years. XML’s purpose is storing and defining documents and data through the optional use of a schema. JSON was almost the exact opposite – a serialization format with requirements so simple they fit on the back of a ...

Read More »

Consuming JSON based REST Web Service in ADF 12.2.1.3

Previously I have posted about consuming ADF BC based REST Web Service in ADF. Now, this post talks about consuming JSON based REST Web Service using generic data control. You can also look at previous posts on Web Service for more information. Create SOAP Web Service with Application Module quickly in ADF 12.2.1 Create REST Web Service with Application Module ...

Read More »

Tutorial: Create and Verify JWTs in Java

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Java support for JWT (JSON Web Tokens) used to require a lot of work: extensive customization, hours lost resolving dependencies, and pages of code just to assemble ...

Read More »

Simple Token Authentication for Java Apps

“I love writing authentication and authorization code.” ~ No Web Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. JSON Web Tokens have quickly become the standard for securing web applications, superseding older technologies like cookies and sessions. Used properly, they address a range of security ...

Read More »

Java: Streaming a JDBC ResultSet as JSON

This post shows how you can convert a java.sql.ResultSet to JSON and stream it back to the caller. This is useful if you want to send a large dataset from a JDBC DataSource to a web application in JSON format. Streaming allows you to transfer the data, little by little, without having to load it all into the server’s memory. ...

Read More »

JSON-B Asymmetrical Property Binding

The JSON-B specification defines binding annotations such as @JsonbProperty or @JsonbTransient to declaratively map Java objects to JSON, and back. These annotations can be used ‘asymmetrically’ to define different handling of serialization and deserialization. If JSON Binding annotations are annotated on Java properties, or on both getters and setters, they will control how the objects are serialized and deserialized. If ...

Read More »

Writing Big JSON Files With Jackson

Sometimes you need to export a lot of data to JSON to a file. Maybe it’s “export all data to JSON”, or the GDPR “Right to portability”, where you effectively need to do the same. And as with any big dataset, you can’t just fit it all in memory and write it to a file. It takes a while, it ...

Read More »

Get to Know Custom De/Serializers: JSON Binding Overview Series

The most advanced way to customize JSON Binding is with custom serializers and deserializers. JSON-B serializers and deserializers are the lowest level of customisation available and give access to the JSON Processing parsers and generators. A custom serializer must implement the JsonbSerializer interface and provide logic for the serialise() method. This code shows a simple example of how to customise ...

Read More »

Get to Know Adapters: JSON Binding Overview Series

An adapter configures custom object creation and serialization by implementing the JsonbAdapter interface. The methods adaptToJson() and adaptFromJson() are overwritten with logic that performs the serialization and deserialization operation. The next article is about the most advanced way to customize JSON-B with custom serializers and deserializers. In the example implementation here, the adaptToJson() method has been implemented with code that ...

Read More »