The document discusses JSON support in Jakarta EE, including the Jakarta JSON Processing API and Jakarta JSON Binding API. It provides an overview of the Jakarta JSON Processing API, which includes streaming and object model APIs for parsing, generating, transforming and querying JSON. It then focuses on the streaming JsonParser and JsonGenerator APIs, demonstrating how JsonParser can parse a JSON document and return parsing events.
Building cloud native microservices with project HelidonDmitry Kornilov
Helidon is a set of Java libraries for building cloud-native microservices. It includes Helidon SE, which provides a lightweight microservices framework, and Helidon MP, which implements the MicroProfile specifications. The presentation covered what Helidon is, its open source nature, components of Helidon SE and MP, performance benchmarks, and roadmap plans including upcoming support for MicroProfile 3.0, Hibernate, HTTP/2 and more.
Cloud Native Java Community Day | EclipseCon Europe 2019Jakarta_EE
Cloud Native Java session, Community Day at EclipseCon Europe 2019.
Presented by Community Day Organizers: Heiko Rupp, Jan Westerkamp, Tanja Obradovic, Susan Iwai, Shabnam Mayel
Cloud Native Java Innovation at the Eclipse Foundation Thabang Mashologu
Hosted by the Eclipse Foundation, Jakarta EE is the home of open source, cloud native Java innovation. Working together, the world’s Java ecosystem leaders, including Fujitsu, IBM, Microsoft, Oracle, Red Hat, SAP, and Tomitribe, are advancing Java EE and Jakarta EE to support moving mission-critical applications and workloads to the cloud. This presentation provides an overview of the various cloud native Java initiatives within the Eclipse community.
The document discusses JSON support in Java EE 8, including the JSON Processing (JSON-P) and JSON Binding APIs. It provides an overview of the JSON-P API for parsing, generating, and manipulating JSON, including the streaming JsonParser and JsonGenerator classes and object model classes. It also discusses the upcoming JSON-P 1.1 specification's support for JSON Pointer, JSON Patch, and JSON Merge Patch standards.
Jakarta for dummEEs | JakartaOne LivestreamJakarta_EE
The document provides an overview of Jakarta EE, formerly known as Java EE. It begins with a brief history, noting how Eclipse MicroProfile was launched in 2016 in response to concerns about Java EE's relevance. In 2017, Oracle contributed Java EE assets to the Eclipse Foundation's new Jakarta EE project. The document then discusses Jakarta EE specifications, APIs, and TCKs that are being developed outside the JCP process. It lists the growing number of compatible implementations and notes that Jakarta EE 8 will be identical to Java EE 8. It concludes by outlining some of the next steps, including moving to the "jakarta" namespace and determining the content and timeline for future Jakarta EE
The document discusses Jakarta EE and MicroProfile features. Josh Juneau and Edwin Derks will demonstrate key but less commonly used features of Jakarta EE and MicroProfile, including asynchronous CDI events, JSON binding, JSON processing, security, and fault tolerance annotations. They will also cover deploying applications as Docker images.
The document summarizes the steps to transform an analytics script into a scalable data science service using Python, from defining an importable module, exposing an API endpoint, making it asynchronous using Celery, containerizing it using Docker, and deploying it on Kubernetes. It discusses each step in detail providing code examples. The overall goal is to make the data science solution robust, responsive and able to handle production scale loads.
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays
apidays LIVE Australia 2020 - Building Business Ecosystems
From micro to macro-coordination through domain-centric DDL pipeline
Alex Khilko, CTO of PlayQ Inc.
Building cloud native microservices with project HelidonDmitry Kornilov
Helidon is a set of Java libraries for building cloud-native microservices. It includes Helidon SE, which provides a lightweight microservices framework, and Helidon MP, which implements the MicroProfile specifications. The presentation covered what Helidon is, its open source nature, components of Helidon SE and MP, performance benchmarks, and roadmap plans including upcoming support for MicroProfile 3.0, Hibernate, HTTP/2 and more.
Cloud Native Java Community Day | EclipseCon Europe 2019Jakarta_EE
Cloud Native Java session, Community Day at EclipseCon Europe 2019.
Presented by Community Day Organizers: Heiko Rupp, Jan Westerkamp, Tanja Obradovic, Susan Iwai, Shabnam Mayel
Cloud Native Java Innovation at the Eclipse Foundation Thabang Mashologu
Hosted by the Eclipse Foundation, Jakarta EE is the home of open source, cloud native Java innovation. Working together, the world’s Java ecosystem leaders, including Fujitsu, IBM, Microsoft, Oracle, Red Hat, SAP, and Tomitribe, are advancing Java EE and Jakarta EE to support moving mission-critical applications and workloads to the cloud. This presentation provides an overview of the various cloud native Java initiatives within the Eclipse community.
The document discusses JSON support in Java EE 8, including the JSON Processing (JSON-P) and JSON Binding APIs. It provides an overview of the JSON-P API for parsing, generating, and manipulating JSON, including the streaming JsonParser and JsonGenerator classes and object model classes. It also discusses the upcoming JSON-P 1.1 specification's support for JSON Pointer, JSON Patch, and JSON Merge Patch standards.
Jakarta for dummEEs | JakartaOne LivestreamJakarta_EE
The document provides an overview of Jakarta EE, formerly known as Java EE. It begins with a brief history, noting how Eclipse MicroProfile was launched in 2016 in response to concerns about Java EE's relevance. In 2017, Oracle contributed Java EE assets to the Eclipse Foundation's new Jakarta EE project. The document then discusses Jakarta EE specifications, APIs, and TCKs that are being developed outside the JCP process. It lists the growing number of compatible implementations and notes that Jakarta EE 8 will be identical to Java EE 8. It concludes by outlining some of the next steps, including moving to the "jakarta" namespace and determining the content and timeline for future Jakarta EE
The document discusses Jakarta EE and MicroProfile features. Josh Juneau and Edwin Derks will demonstrate key but less commonly used features of Jakarta EE and MicroProfile, including asynchronous CDI events, JSON binding, JSON processing, security, and fault tolerance annotations. They will also cover deploying applications as Docker images.
The document summarizes the steps to transform an analytics script into a scalable data science service using Python, from defining an importable module, exposing an API endpoint, making it asynchronous using Celery, containerizing it using Docker, and deploying it on Kubernetes. It discusses each step in detail providing code examples. The overall goal is to make the data science solution robust, responsive and able to handle production scale loads.
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays
apidays LIVE Australia 2020 - Building Business Ecosystems
From micro to macro-coordination through domain-centric DDL pipeline
Alex Khilko, CTO of PlayQ Inc.
This document provides an overview of JSON support in Java EE 8, including the JSON Processing (JSON-P) and JSON Binding APIs. It discusses the JSON-P streaming and object model APIs for parsing, generating, and transforming JSON. The JSON Binding API allows binding of JSON documents to Java objects. The document also describes updates to the JSON-P specification to support JSON Pointer, JSON Patch, and JSON Merge Patch for editing JSON documents.
Do More with Postgres- NoSQL Applications for the EnterpriseEDB
NoSQL capabilities in Postgres are opening up new avenues for solving enterprise challenges without having to adopt new technologies that bring risk and instability to data management. EnterpriseDB has made it easier for developers to get started using the NoSQL capabilities in Postgres to develop Web 2.0 applications, deploying on Amazon with a new development environment featuring application frameworks, a web server and code samples.
This presentation covers how developers tap the powers of Postgres by addressing:
* How to use JSON and HSTORE side by side with ANSI SQL to create powerful, robust and scalable Web 2.0 data-driven applications
* Getting started with PGXDK (Postgres Extended Datatype Developer Kit), a free AMI that simplifies the development of Postgres-based applications that integrate NoSQL technologies with JSON and Python
* Code samples for writing applications with Postgres using dynamic new capabilities
If you would like to learn more about building your NoSQL Applications with Postgres please email sales@enterprisedb.com.
JSON support in DB2 for z/OS
1. To illustrate JSON storage model in DB2 for z/OS
2. To introduce JSON SQL APIs features and examples
3. To compare JSON and XML support in DB2 for z/OS
When SDMX meets AI-Leveraging Open Source LLMs To Make Official Statistics Mo...Sease
This intervention draws on experimentations ongoing in the context of the OECD-led Statistical Information System Collaboration Community (SIS-CC) to enable AI applications with SDMX. One important use case is to use AI for better accessibility and discoverability of the data: whilst UX techniques, lexical search improvements, and data harmonisation can take statistical organisations to a good level of accessibility, however, a structural (or “cognitive” gap) remains between the data user needs and the data producer constraints. That is where AI – and most importantly, NLP and LLM techniques – could potentially make a difference. The “StatsBot” could be this natural language, conversational engine that could facilitate access and usage of the data. The “StatsBot” could leverage the semantics of any SDMX source.
The objective of the presentation is to propose a technical approach and a way forward to achieve this goal and create the StatsBot as a universal, open asset usable by all statistical organisations. In a first step, the concept tested is to use Large Language Models with the Apache Solr index of SDMX objects so as to transform natural language queries into SDMX queries. In a second step, results could be framed as a natural language statement complementing the top-k search results. For the purpose of initial PoCs – aimed to demonstrate functional features and feasibility – a commercial LLM (such as OpenAI GPT-4) will be used; in a later stage substitution with an open source LLM will be analysed. The presentation will include the results of the first experimental work, lessons learnt, and scope future work that should lead to defining the path for production-grade, fully open source, and universal StatsBot.
This document introduces JSON-LD (JSON for Linking Data), which addresses two problems with standard JSON: ambiguity and lack of linking. JSON-LD adds context and identifiers to make JSON data unambiguous and able to link to other related data. It defines JSON documents as labeled, directed graphs. Examples show how JSON-LD can clarify data meaning through context, link related entities through identifiers, and support applications like search engine optimization, APIs, and Gmail actions.
Generating Unified APIs with Protocol Buffers and gRPCC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2k1eZ00.
Chris Roche and Christopher Burnett discuss how they extended the Protocol Buffer (PB) IDL to create unified APIs and data models. From validation logic to automatic logging and statistics, PBs allows them to speed up development across Go, Python, and PHP stacks. They also show how they leverage the Envoy proxy to transparently upgrade HTTP/1.1 services to speak gRPC on the wire. Filmed at qconnewyork.com.
Chris Roche is a Core Libraries Engineer at Lyft focused on enriching the tools to create distributed systems. Christopher Burnett is Lead Core Libraries Engineer at Lyft, where he designs software for distributed systems.
The Eclipse Foundation conducted a survey of 1,717 IoT developers in 2019. The survey found that two-thirds of respondents currently work on or will work on IoT projects in the next 18 months. AWS, Azure and GCP were the top IoT cloud platforms, while C, C++, Java, JavaScript and Python were the most used programming languages. MQTT was still the dominant communication protocol. The Eclipse IDE was also the leading development environment for building IoT applications.
The Eclipse Foundation conducted a survey of 1,717 IoT developers in 2019. The survey found that two-thirds of respondents currently work on or will work on IoT projects in the next 18 months. AWS, Azure and GCP were the leading IoT cloud platforms, while C, C++, Java, JavaScript and Python were the most commonly used programming languages. MQTT was still the dominant communication protocol. The Eclipse IDE was also the leading development environment for building IoT applications.
The Java EE 7 specification has evolved quite a lot since the early days of the specification. One one hand, Java EE 7 continues the ease of development push that characterized prior releases by bringing further simplification to enterprise development. On the other hand, Java EE 7 tackle new emerging requirements such as HTML 5 support.
Last but not least, Java EE 7 also adds new, APIs such as the REST client API in JAX-RS 2.0, WebSockets, JSON-P, JMS 2, Batch Processing, etc.
This session will give an technical overview of the Java EE 7 platform. GlassFish 4.0, the world first Java EE 7 Application Server, will be used to demonstrate some of the Java EE 7 features.
Jakarta EE 9 Milestone Release Party - OverviewJakarta_EE
The document summarizes the agenda and key topics for a Jakarta EE meeting, including:
- Welcome and opening remarks
- Details on the Jakarta EE 9 Platform and Web Profile APIs and TCK
- Information on the Eclipse GlassFish 6.0-M1 release
- Links to sample code and download pages for implementations like GlassFish, Tomcat, and Jetty
- A call for participants to help with specifications and converting apps to the Jakarta namespace
The document discusses new features in C# 10, including improvements to record types and structure types. Some key record improvements covered are inheritance between records, initializing records with parameters, and sealing the ToString() method. Structure type improvements discussed allow initializing fields in the constructor and setting properties directly without backing fields. The presentation aims to demonstrate the new capabilities in C# 10 for working with value types.
For 15 years, the Eclipse Foundation has provided our global community of developers and organizations with a mature, scalable and business-friendly platform and environment for open source software collaboration and innovation. We provide the governance, processes, and infrastructure that fuel the commercial success of our members. Learn more at http://eclipse.org
Application Development & Database Choices: Postgres Support for non Relation...EDB
This talk will cover the advanced features of PostgreSQL that make it the most-loved RDBMS by developers and a great choice for non-relational workloads.
This webinar will explore:
- Global adoption of Postgres
- Document-centric applications
- Geographic Information Systems (GIS)
- Business intelligence
- Central data centers
- Server-side languages
The document discusses the growing adoption of open source software. It outlines the four core freedoms that define open source and free software. It discusses perspectives from developers and organizations on why they contribute to open source. It notes that over 90% of companies rely on open source components and that open source is driving innovation. Foundations like Eclipse play an important role in supporting open source collaboration and governance.
The document provides an overview of visualizing open data with Neo4j. It begins with defining open data and its key characteristics. It then provides a primer on Neo4j, describing it as a graph database that treats relationships between data as equally important as the data itself. It also outlines Neo4j's data definition and manipulation language Cypher. The document demonstrates Neo4j's object graph mapping API and includes demos of traffic, lobbying, and contract datasets modeled as graphs.
Helidon Nima - Loom based microserfice framework.pptxDmitry Kornilov
For quite a long time we were forced to make a choice - performance vs. simplicity. Either use a complicated and performant reactive code, or use simple, yet limited blocking approach.Thanks to project Loom in JDK, the paradigm can shift once more even for applications that require high concurrency. I will introduce Helidon Nima - new microservices framework which is built on top of a server designed for Loom with fully synchronous routing that can block as needed, yet still provide high performance under heavy concurrent load. I'll also talk about challenges, benefits and impact on application development in such an environment.
Jakarta EE has transitioned from Java EE to an open governance structure at the Eclipse Foundation. Key points:
- Java EE specifications and reference implementations were contributed to Eclipse Foundation projects in 2018.
- Jakarta EE 8 was released in September 2019, compatible with Java EE 8.
- Governance includes the Jakarta EE Steering Committee and Specification Committee.
- Future directions include embracing modules, preferring soft dependencies, and focusing on testing.
- The community is invited to get involved to help define the future of Jakarta EE 9.
More Related Content
Similar to JSON Support in Jakarta EE: Present and Future
This document provides an overview of JSON support in Java EE 8, including the JSON Processing (JSON-P) and JSON Binding APIs. It discusses the JSON-P streaming and object model APIs for parsing, generating, and transforming JSON. The JSON Binding API allows binding of JSON documents to Java objects. The document also describes updates to the JSON-P specification to support JSON Pointer, JSON Patch, and JSON Merge Patch for editing JSON documents.
Do More with Postgres- NoSQL Applications for the EnterpriseEDB
NoSQL capabilities in Postgres are opening up new avenues for solving enterprise challenges without having to adopt new technologies that bring risk and instability to data management. EnterpriseDB has made it easier for developers to get started using the NoSQL capabilities in Postgres to develop Web 2.0 applications, deploying on Amazon with a new development environment featuring application frameworks, a web server and code samples.
This presentation covers how developers tap the powers of Postgres by addressing:
* How to use JSON and HSTORE side by side with ANSI SQL to create powerful, robust and scalable Web 2.0 data-driven applications
* Getting started with PGXDK (Postgres Extended Datatype Developer Kit), a free AMI that simplifies the development of Postgres-based applications that integrate NoSQL technologies with JSON and Python
* Code samples for writing applications with Postgres using dynamic new capabilities
If you would like to learn more about building your NoSQL Applications with Postgres please email sales@enterprisedb.com.
JSON support in DB2 for z/OS
1. To illustrate JSON storage model in DB2 for z/OS
2. To introduce JSON SQL APIs features and examples
3. To compare JSON and XML support in DB2 for z/OS
When SDMX meets AI-Leveraging Open Source LLMs To Make Official Statistics Mo...Sease
This intervention draws on experimentations ongoing in the context of the OECD-led Statistical Information System Collaboration Community (SIS-CC) to enable AI applications with SDMX. One important use case is to use AI for better accessibility and discoverability of the data: whilst UX techniques, lexical search improvements, and data harmonisation can take statistical organisations to a good level of accessibility, however, a structural (or “cognitive” gap) remains between the data user needs and the data producer constraints. That is where AI – and most importantly, NLP and LLM techniques – could potentially make a difference. The “StatsBot” could be this natural language, conversational engine that could facilitate access and usage of the data. The “StatsBot” could leverage the semantics of any SDMX source.
The objective of the presentation is to propose a technical approach and a way forward to achieve this goal and create the StatsBot as a universal, open asset usable by all statistical organisations. In a first step, the concept tested is to use Large Language Models with the Apache Solr index of SDMX objects so as to transform natural language queries into SDMX queries. In a second step, results could be framed as a natural language statement complementing the top-k search results. For the purpose of initial PoCs – aimed to demonstrate functional features and feasibility – a commercial LLM (such as OpenAI GPT-4) will be used; in a later stage substitution with an open source LLM will be analysed. The presentation will include the results of the first experimental work, lessons learnt, and scope future work that should lead to defining the path for production-grade, fully open source, and universal StatsBot.
This document introduces JSON-LD (JSON for Linking Data), which addresses two problems with standard JSON: ambiguity and lack of linking. JSON-LD adds context and identifiers to make JSON data unambiguous and able to link to other related data. It defines JSON documents as labeled, directed graphs. Examples show how JSON-LD can clarify data meaning through context, link related entities through identifiers, and support applications like search engine optimization, APIs, and Gmail actions.
Generating Unified APIs with Protocol Buffers and gRPCC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2k1eZ00.
Chris Roche and Christopher Burnett discuss how they extended the Protocol Buffer (PB) IDL to create unified APIs and data models. From validation logic to automatic logging and statistics, PBs allows them to speed up development across Go, Python, and PHP stacks. They also show how they leverage the Envoy proxy to transparently upgrade HTTP/1.1 services to speak gRPC on the wire. Filmed at qconnewyork.com.
Chris Roche is a Core Libraries Engineer at Lyft focused on enriching the tools to create distributed systems. Christopher Burnett is Lead Core Libraries Engineer at Lyft, where he designs software for distributed systems.
The Eclipse Foundation conducted a survey of 1,717 IoT developers in 2019. The survey found that two-thirds of respondents currently work on or will work on IoT projects in the next 18 months. AWS, Azure and GCP were the top IoT cloud platforms, while C, C++, Java, JavaScript and Python were the most used programming languages. MQTT was still the dominant communication protocol. The Eclipse IDE was also the leading development environment for building IoT applications.
The Eclipse Foundation conducted a survey of 1,717 IoT developers in 2019. The survey found that two-thirds of respondents currently work on or will work on IoT projects in the next 18 months. AWS, Azure and GCP were the leading IoT cloud platforms, while C, C++, Java, JavaScript and Python were the most commonly used programming languages. MQTT was still the dominant communication protocol. The Eclipse IDE was also the leading development environment for building IoT applications.
The Java EE 7 specification has evolved quite a lot since the early days of the specification. One one hand, Java EE 7 continues the ease of development push that characterized prior releases by bringing further simplification to enterprise development. On the other hand, Java EE 7 tackle new emerging requirements such as HTML 5 support.
Last but not least, Java EE 7 also adds new, APIs such as the REST client API in JAX-RS 2.0, WebSockets, JSON-P, JMS 2, Batch Processing, etc.
This session will give an technical overview of the Java EE 7 platform. GlassFish 4.0, the world first Java EE 7 Application Server, will be used to demonstrate some of the Java EE 7 features.
Jakarta EE 9 Milestone Release Party - OverviewJakarta_EE
The document summarizes the agenda and key topics for a Jakarta EE meeting, including:
- Welcome and opening remarks
- Details on the Jakarta EE 9 Platform and Web Profile APIs and TCK
- Information on the Eclipse GlassFish 6.0-M1 release
- Links to sample code and download pages for implementations like GlassFish, Tomcat, and Jetty
- A call for participants to help with specifications and converting apps to the Jakarta namespace
The document discusses new features in C# 10, including improvements to record types and structure types. Some key record improvements covered are inheritance between records, initializing records with parameters, and sealing the ToString() method. Structure type improvements discussed allow initializing fields in the constructor and setting properties directly without backing fields. The presentation aims to demonstrate the new capabilities in C# 10 for working with value types.
For 15 years, the Eclipse Foundation has provided our global community of developers and organizations with a mature, scalable and business-friendly platform and environment for open source software collaboration and innovation. We provide the governance, processes, and infrastructure that fuel the commercial success of our members. Learn more at http://eclipse.org
Application Development & Database Choices: Postgres Support for non Relation...EDB
This talk will cover the advanced features of PostgreSQL that make it the most-loved RDBMS by developers and a great choice for non-relational workloads.
This webinar will explore:
- Global adoption of Postgres
- Document-centric applications
- Geographic Information Systems (GIS)
- Business intelligence
- Central data centers
- Server-side languages
The document discusses the growing adoption of open source software. It outlines the four core freedoms that define open source and free software. It discusses perspectives from developers and organizations on why they contribute to open source. It notes that over 90% of companies rely on open source components and that open source is driving innovation. Foundations like Eclipse play an important role in supporting open source collaboration and governance.
The document provides an overview of visualizing open data with Neo4j. It begins with defining open data and its key characteristics. It then provides a primer on Neo4j, describing it as a graph database that treats relationships between data as equally important as the data itself. It also outlines Neo4j's data definition and manipulation language Cypher. The document demonstrates Neo4j's object graph mapping API and includes demos of traffic, lobbying, and contract datasets modeled as graphs.
Similar to JSON Support in Jakarta EE: Present and Future (20)
Helidon Nima - Loom based microserfice framework.pptxDmitry Kornilov
For quite a long time we were forced to make a choice - performance vs. simplicity. Either use a complicated and performant reactive code, or use simple, yet limited blocking approach.Thanks to project Loom in JDK, the paradigm can shift once more even for applications that require high concurrency. I will introduce Helidon Nima - new microservices framework which is built on top of a server designed for Loom with fully synchronous routing that can block as needed, yet still provide high performance under heavy concurrent load. I'll also talk about challenges, benefits and impact on application development in such an environment.
Jakarta EE has transitioned from Java EE to an open governance structure at the Eclipse Foundation. Key points:
- Java EE specifications and reference implementations were contributed to Eclipse Foundation projects in 2018.
- Jakarta EE 8 was released in September 2019, compatible with Java EE 8.
- Governance includes the Jakarta EE Steering Committee and Specification Committee.
- Future directions include embracing modules, preferring soft dependencies, and focusing on testing.
- The community is invited to get involved to help define the future of Jakarta EE 9.
Building Cloud-Native Applications with HelidonDmitry Kornilov
Slides for my and Johan Palmer presentation on Oracle Open World 2019.
Abstract:
Project Helidon is an open-source framework that supports customers developing Java-based microservices applications. Helidon SE is designed to be simple to use, lightweight, and fast. In addition, Helidon also implements MicroProfile, a baseline platform definition that optimizes Java EE for microservices architectures, and delivers application portability across multiple runtimes. Come to this session to learn what Helidon is, gain an understanding of the strategy and roadmap, and uncover how you might benefit from using Helidon in your business.
Slides from my and Tomas Langer session at CodeOne 2019.
Abstract:
Although Helidon SE provides reactive nonblocking APIs to build microservices, most database drivers are still blocking. Only a few vendors provide reactive drivers to their databases. To help mitigate this issue, a reactive persistence layer has been created in Helidon SE. This persistence layer, known as Helidon DB, supports SQL and NoSQL databases and is compatible with R2DBC, ADBA, the MongoDB reactive driver, and standard JDBC. With Helidon DB, there is no need to worry that a database driver will block your thread. This session covers the basic concepts of Helidon DB and demonstrates how it works with different kinds of databases on a simple sample application.
Developing cloud-native microservices using project HelidonDmitry Kornilov
Helidon is a set of Java libraries for developing microservices. It includes Helidon SE, which provides a reactive web server and functional routing model built on Netty, and Helidon MP, which implements the MicroProfile specifications. The open source Helidon project is hosted on GitHub and supported by Oracle, with the goal of providing an innovative and standards-friendly platform for building microservices applications.
The document discusses the transfer of Java EE specifications, APIs, reference implementations, test suites, and documentation from Oracle to the Eclipse Foundation. It provides details on what is being transferred, the codebase sizes, the contribution timeline so far with over 80 contributors and 200 committers, the use of Eclipse Jenkins for continuous integration, and release plans for Eclipse GlassFish 5.1. It encourages participation in the new Jakarta EE community project.
Helidon: Java Libraries for Writing MicroservicesDmitry Kornilov
Helidon is a set of Java libraries for developing microservices. It includes Helidon SE for a reactive web server and Helidon MP which supports MicroProfile standards. The presentation provides an overview of Helidon's architecture and capabilities, including security, configuration, reactive routing, and integration with technologies like CDI, JAX-RS, and JSON processing. Future plans include improved support for HTTP/2, reactive clients, and tighter JDK integration.
This document provides an introduction and overview of Yasson, the reference implementation of the JSON Binding (JSON-B) API specified in JSR-367. It discusses the JSON-B and JSON Processing APIs in Java EE 8, the default mapping and customization options in Yasson, and examples of serializing Java objects to and from JSON.
This document provides an overview and update on the JSON Processing (JSR-374) and JSON Binding (JSR-367) Java specifications. It discusses upcoming releases and milestones, how to get involved through testing, reporting issues, or contributing code. Contact information is provided for spec leads and links to project resources.
Configuration for Java EE: Config JSR and TamayaDmitry Kornilov
Slides from our joint talk with Werner Keil about configuration proposal for Java EE and Tamaya we've done on 16 Mov 2016 in Sofia on Java2Days conference.
The document discusses proposed changes to Java EE 8 and beyond. It proposes adding support for reactive programming, a unified event model, eventual consistency, NoSQL persistence and querying, and security enhancements like OAuth2 and secret management. It also discusses packaging improvements and making Java EE more suitable for cloud and microservices development. Feedback is sought from the Java EE community on the proposals.
In the modern world, where apps consist of microservices and are deployed in a cloud, developers are facing many issues related to apps config. How to deploy an app in different environments without cracking its package. How to apply configuration for deployed instances of an app without redeployment. How an app can be notified if some configuration properties changes. This session introduces a standardization effort tasked with solving these problems by defining a Java EE config service. Such a service is aimed at the cloud and provides the ability to create one or more configurations that are independent of and decoupled from apps using them. The session describes how such a service fits into the Java EE family and integrates with other Java EE frameworks.
This document provides an overview and summary of the Java API for JSON Binding (JSON-B) specification. It discusses the goals of JSON-B, which include supporting all JSON documents and maintaining consistency with other Java APIs. The document outlines the JSR status and progress, including passing the public review ballot. It provides an overview of the JSON-B API, describing the default mapping for basic types, classes, collections, and customized mapping options using annotations and configuration.
The document discusses JSON Binding (JSON-B), which is a Java standard for converting Java objects to and from JSON documents. It provides an overview of JSON-B and compares it to other frameworks. The key points covered include the JSON-B standard and specification, its default mapping for common Java types and collections, and how to customize the mapping using annotations.
JSONB introduction and comparison with other frameworksDmitry Kornilov
This document discusses JSON Binding (JSON-B), including what it is, the JSR specification, default mappings, and comparisons to other frameworks. JSON-B is a standard for converting Java objects to and from JSON documents. It has a default mapping that handles basic types, dates, classes and collections, but also allows for customized mappings. The specification is hosted on Java.net and has a reference implementation.
What’s new in JSR 367 Java API for JSON BindingDmitry Kornilov
The document discusses the JSR 367 Java API for JSON Binding specification. It provides an overview of the status and progress of the JSR, including the formation of an expert group and publication of an early draft. It also summarizes the key aspects of the specification, including the JSONB runtime API for converting Java objects to and from JSON, the default mapping for basic types and classes, and the reference implementation.
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
A Comprehensive Guide to DeFi Development Services in 2024Intelisync
DeFi represents a paradigm shift in the financial industry. Instead of relying on traditional, centralized institutions like banks, DeFi leverages blockchain technology to create a decentralized network of financial services. This means that financial transactions can occur directly between parties, without intermediaries, using smart contracts on platforms like Ethereum.
In 2024, we are witnessing an explosion of new DeFi projects and protocols, each pushing the boundaries of what’s possible in finance.
In summary, DeFi in 2024 is not just a trend; it’s a revolution that democratizes finance, enhances security and transparency, and fosters continuous innovation. As we proceed through this presentation, we'll explore the various components and services of DeFi in detail, shedding light on how they are transforming the financial landscape.
At Intelisync, we specialize in providing comprehensive DeFi development services tailored to meet the unique needs of our clients. From smart contract development to dApp creation and security audits, we ensure that your DeFi project is built with innovation, security, and scalability in mind. Trust Intelisync to guide you through the intricate landscape of decentralized finance and unlock the full potential of blockchain technology.
Ready to take your DeFi project to the next level? Partner with Intelisync for expert DeFi development services today!
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
JSON Support in Jakarta EE: Present and Future
1. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 1
JSON Support in Jakarta EE:
Present and Future
Dmitry Kornilov / Andy Guibert
10 Sep 2019
2. 2COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 2
About Us
• Jakarta JSON Processing Project Lead
• Jakarta JSON Binding Project Lead
• Eclipse EE4J PMC Member
Dmitry Kornilov
(Oracle)
• Jakarta JSON Binding Project Lead
Andy Guibert
(IBM)
3. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0)
AGENDA
3
Introduction
Jakarta JSON Processing
Jakarta JSON Binding
Plans
4. 4COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 4
Safe Harbor Statement
The following is intended to outline our general product direction. It
is intended for information purposes only, and may not be
incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in
making purchasing decisions. The development, release, and timing
of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
5. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 5
Introduction
6. 6COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 6
What is JSON?
● JavaScript Object Notation
● Open standard (RFC 7159, 8259)
● Text based
● Language independent
● Nicely readable by humans
● Supported in most of languages
● Lightweight data interchange format
{
"firstName": "John",
"lastName": "Doe",
"age": 42,
"contacts": [
{
"type": "home",
"number": "123-456-789"
}
]
}
7. 7COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 7
What is JSON?
● Primitive types:
○ String
○ Number
○ Boolean
● Structured types:
○ Array
○ Object
● Null
{
"firstName": "John",
"lastName": "Doe",
"age": 42,
"registered": true,
"tags": null,
"contacts": [
{
"type": "home",
"number": "123-456-789"
}
]
}
8. 8COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 8
JSON Support in Jakarta EE 8
● Jakarta JSON Processing API
○ Standard API to parse, generate, transform and query JSON
○ Object Model and Streaming API
■ similar to DOM and StAX
● Jakarta JSON Binding API
○ Binding JSON documents to Java objects
■ similar to JAXB
9. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 9
Jakarta JSON Processing
10. 10COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 10
Jakarta JSON Processing
● Web Site
○ https://eclipse-ee4j.github.io/jsonp/
● Repository
○ https://github.com/eclipse-ee4j/jsonp
● Eclipse Project
○ https://projects.eclipse.org/projects/ee4j.jsonp
● Mailing List
○ https://accounts.eclipse.org/mailing-list/jsonp-dev
11. 11COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 11
Jakarta JSON Processing
● Streaming API
○ Event based
○ Access to one element
○ Efficient for high volume of data
○ Small memory footprint
● Object Model API
○ In-memory tree
○ Random access to elements
○ Efficient for smaller documents
○ Big memory footprint
12. 12COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 12
Jakarta JSON Processing
● Streaming API
○ JsonParser
○ JsonGenerator
● Object Model API
○ JsonReader
○ JsonWriter
○ JsonPointer
○ JsonPatch
○ JsonMergePatch
13. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 13
Streaming API
14. 14COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 14
JsonParser
● JsonParser
○ Parses JSON in a streaming way from input sources
○ Similar to StAX’s XMLStreamReader
● Created using:
■ Json.createParser(…)
■ Json.createParserFactory().createParser(…)
● Optionally, configured with features
● Parser state events:
○ START_ARRAY, START_OBJECT, KEY_NAME, VALUE_STRING, VALUE_NUMBER,
VALUE_TRUE, VALUE_FALSE, VALUE_NULL, END_OBJECT, END_ARRAY
15. 15COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 15
JsonParser
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
16. 16COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 16
JsonParser
START_OBJECT{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
17. 17COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 17
JsonParser
START_OBJECT
KEY_NAME
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
18. 18COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 18
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
19. 19COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 19
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
20. 20COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 20
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
21. 21COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 21
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
22. 22COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 22
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
23. 23COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 23
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
24. 24COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 24
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
25. 25COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 25
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
26. 26COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 26
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
27. 27COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 27
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_STRING
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
28. 28COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 28
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_STRING
END_OBJECT
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
29. 29COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 29
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_STRING
END_OBJECT
END_ARRAY
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
30. 30COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 30
JsonParser
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_NUMBER
KEY_NAME
START_ARRAY
START_OBJECT
KEY_NAME
VALUE_STRING
KEY_NAME
VALUE_STRING
END_OBJECT
END_ARRAY
END_OBJECT
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
31. 31COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 31
JsonParser
JsonParser parser = Json.createParser(...);
Event e = parser.next(); // START_OBJECT
parser.next(); // KEY_NAME
parser.getString(); // name
parser.next(); // VALUE_STRING
parser.getString(); // John Doe
parser.next(); // KEY_NAME
parser.getString(); // age
parser.next(); // VALUE_NUMBER
parser.getInt(); // 42
{
"name":
”John Doe",
"age":
42,
”contacts":
[
{
"type":
"home",
"number":
"123-456-789"
}
]
}
32. 32COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 32
JsonGenerator
● Generates JSON in a streaming way to output sources
● Similar to StAX’s XMLStreamWriter
● Created using:
○ Json.createGenerator(…)
○ Json.createGeneratorFactory().createGenerator(…)
● Optionally, configured with features
○ e.g. pretty printing
● Uses builder pattern
33. 33COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 33
JsonGenerator
JsonGenerator g = Json.createGenerator(…);
g.writeStartArray()
.writeStartObject()
.write("type", "home”)
.write("number", "123-456-789")
.writeEnd()
.writeStartObject()
.write("type", "fax”)
.write("number", "123-456-790")
.writeEnd()
.writeEnd()
.close();
[
{
"type": "home”,
"number": "123-456-789"
},
{
"type": "fax”,
"number": "123-456-790"
}
]
34. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 34
Object Model API
35. 35COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 35
Object Model API
● Builder to build JsonObject and JsonArray from scratch
● Type-safe (cannot mix array and object building methods)
● Can also use existing JsonObject and JsonArray in a builder
36. 36COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 36
Object Model API
JsonArray value = Json.createArrayBuilder()
.add(Json.createObjectBuilder()
.add("type", "home")
.add("number", "123-456-789")
)
.add(Json.createObjectBuilder()
.add("type", "fax")
.add("number", "123-456-790")
)
.build();
[
{
"type": "home”,
"number": "123-456-789"
},
{
"type": "fax”,
"number": "123-456-790"
}
]
37. 37COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 37
JsonPointer
● IETF RFC 6901
● String syntax for identifying a specific value
○ /phone/mobile
○ /parents/0
● Special characters
○ "/" —> "~1"
○ "~" —> "~0"
38. 38COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 38
JsonPointer Sample
JsonArray customers = . . .;
JsonPointer pointer =
Json.createPointer("/1/lastName");
// Set new value
pointer.replace(customers,
Json.createValue(”Doe"));
// Get the value
JsonValue lastName =
pointer.getValue(customers); // Doe
[
{
"firstName": "John",
"lastName": "Doe",
"age": 42
},
{
"firstName": "Jane",
"lastName": " ",
"age": 35
}
]
39. 39COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 39
JsonPatch
● IETF RFC 6902
● Modify Parts of JSON document
● Patch is a JSON document itself
● Operations:
○ Add, replace, remove, move, copy, test
● HTTP PATCH method (application/json-patch+json)
[
{ "op": "replace",
"path": "/1/lastName",
"value": ”Doe" },
{ "op": "remove",
"path": "/2" }
]
43. 43COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 43
JsonMergePatch
● IETF RFC 7396
● HTTP PATCH
"application/merge-patch+json"
● Patch is a JSON document itself
● Syntax closely mimics the document
○ Git like merge experience
// Read patch JSON
JsonObject patchData =
Json.createReader(…).readArray();
// Create patch
JsonMergePatch mergePatch =
Json.createMergePatch(patchData);
// Apply patch
mergePatch.apply(applyTo);
44. 44COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 44
JsonMergePatch
{
"firstName": "John",
"lastName": "Doe",
"age": 42
}
{
"firstName": "John",
"lastName": " ",
"address": " "
}
{
"lastName": ”Doe",
"age": 42,
"address": null
}
Source
Patch
Result
45. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 45
Jakarta JSON Binding
46. 46COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 46
Jakarta JSON Binding
● API to serialize/deserialize Java objects to/from JSON documents
○ Similar to JAX-B, except with JSON instead of XML
○ Standardizes features of the current technologies (Jackson, Genson, Gson)
● Easily convert between Java classes and JSON data with convenient default settings
● Customization APIs
○ Annotations (@JsonbProperty, @JsonbNillable)
○ Runtime configuration builder
● Natural follow on to JSON-P
○ Closes the JSON support gap
○ Allows to use different JSONP providers
47. 47COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 47
Jakarta JSON Binding
● Web Site
○ https://eclipse-ee4j.github.io/jsonb-api/
● Repository
○ https://github.com/eclipse-ee4j/jsonb-api
● Eclipse Project
○ https://projects.eclipse.org/projects/ee4j.jsonb
● Mailing List
○ https://accounts.eclipse.org/mailing-list/jsonb-dev
48. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 48
Default Mapping
49. 49COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 49
Default Mapping
● No configuration, no annotations
● The scope:
○ Basic Types
○ Specific JDK Types
○ Dates
○ Classes
○ Collections/Arrays
○ Enumerations
○ JSON-P model classes
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
// Create with default config
// Cache it!
Jsonb jsonb = JsonbBuilder.create();
50. 50COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 50
JSON-B Engine
public interface Jsonb extends AutoCloseable {
<T> T fromJson(String str, Class<T> type);
<T> T fromJson(String str, Type runtimeType);
<T> T fromJson(Reader reader, Class<T> type);
<T> T fromJson(Reader reader, Type runtimeType);
<T> T fromJson(InputStream stream, Class<T> type);
<T> T fromJson(InputStream stream, Type runtimeType);
String toJson(Object object);
String toJson(Object object, Type runtimeType);
void toJson(Object object, Writer writer);
void toJson(Object object, Type runtimeType, Writer writer);
void toJson(Object object, OutputStream stream);
void toJson(Object object, Type runtimeType, OutputStream stream);
}
51. 51COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 51
JSON-B Sample
Person person1 = new Person();
person1.setFirstName("John");
person1.setLastName(”Doe");
person1.setAge(42);
Person person2 = new Person();
person2.setFirstName("Jane");
person2.setLastName(”Doe");
person2.setAge(35);
List<Person> persons = new ArrayList<>();
persons.add(person1);
persons.add(person2);
Jsonb jsonb = JsonbBuilder.create();
jsonb.toJson(persons);
[
{
"firstName": "John",
"lastName": "Doe",
"age": 42
},
{
"firstName": "Jane",
"lastName": "Doe",
"age": 35
}
]
52. 52COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 52
Basic and Specific Types
Basic Types
○ java.lang.String
○ java.lang.Character
○ java.lang.Byte (byte)
○ java.lang.Short (short)
○ java.lang.Integer (int)
○ java.lang.Long (long)
○ java.lang.Float (float)
○ java.lang.Double (double)
○ java.lang.Boolean (boolean)
Specific Types
○ java.math.BigInteger
○ java.math.BigDecimal
○ java.net.URL
○ java.net.URI
○ java.util.Optional
○ java.util.OptionalInt
○ java.util.OptionalLong
○ java.util.OptionalDouble
53. 53COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0)
java.util.Date ISO_DATE_TIME
java.util.Calendar, java.util.GregorianCalendar ISO_DATE if to time information present, otherwise ISO_DATE_TIME
Java.util.TimeZone, java.util.SimpleTimeZone NormalizedCustomId (see TimeZone javadoc)
java.time.Instant ISO_INSTANT
java.time.LocalDate ISO_LOCAL_DATE
java.time.LocalTime ISO_LOCAL_TIME
java.time.LocalDateTime ISO_LOCAL_DATE_TIME
java.time.ZonedDateTime ISO_ZONED_DATE_TIME
java.time.OffsetDateTime ISO_OFFSET_DATE_TIME
java.time.OffsetTime ISO_OFFSET_TIME
java.time.ZoneId NormalizedZoneId as specified in ZoneId javadoc
java.time.ZoneOffset NormalizedZoneId as specified in ZoneOffset javadoc
java.time.Duration ISO 8601 seconds based representation
java.time.Period ISO 8601 period representation
53
Date / Time
54. 54COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 54
Data / Time Samples
// java.util.Date
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date parsedDate = sdf.parse("10.09.2019");
jsonb.toJson(parsedDate)); // ”2019-09-10T00:00:00"
// java.util.Calendar
Calendar dateCalendar = Calendar.getInstance();
dateCalendar.clear();
dateCalendar.set(2019, 9, 10);
jsonb.toJson(dateCalendar); // ”2019-09-10”
// java.time.Instant
jsonb.toJson(Instant.parse("2019-09-10T23:00:00Z")); // ”2019-09-10T23:00:00Z”
// java.time.Duration
jsonb.toJson(Duration.ofHours(5).plusMinutes(4)); // “PT5H4M"
// java.time.Period
jsonb.toJson(Period.between(
LocalDate.of(1960, Month.JANUARY, 1),
LocalDate.of(1970, Month.JANUARY, 1))); // "P10Y"
55. 55COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 55
Arrays / Collections
● Collection
● Map
● Set
● HashSet
● NavigableSet
● SortedSet
● TreeSet
● LinkedHashSet
● TreeHashSet
● HashMap
● NavigableMap
● SortedMap
● TreeMap
● LinkedHashMap
● TreeHashMap
● List
● ArrayList
● LinkedList
● Deque
● ArrayDeque
● Queue
● PriorityQueue
● EnumSet (JSONB.next)
● EnumMap (JSONB.next)
56. 56COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 56
JSON-P Types
● JsonValue
● JsonPointer
● JsonString
● JsonNumber
● JsonObject
● JsonArray
● JsonStructure
// JsonObject
JsonBuilderFactory f =
Json.createBuilderFactory(null);
JsonObject jsonObject =
f.createObjectBuilder()
.add(“firstName", "John")
.add(“lastName", "Doe")
.build();
String json = jsonb.toJson(jsonObject);
57. 57COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 57
Classes
● Public and protected nested and static nested classes
● Anonymous classes (serialization only)
● Inheritance is supported
● Default no-argument constructor is required for default deserialization
58. 58COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 58
Fields
● Final fields are serialized
● Static fields are skipped
● Transient fields are skipped
● Null fields are skipped
● Fields order
○ Lexicographical (A-Z) order
○ Parent class fields are serialized before child class fields
59. 59COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 59
Field Order Sample
public class Parent {
public int parentB;
public int parentA;
}
{
"parentA": 1,
"parentB": 2
}
60. 60COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 60
Field Order Sample
public class Parent {
public int parentB;
public int parentA;
}
public class Child extends Parent {
public int childB;
public int childA;
}
{
"parentA": 1,
"parentB": 2
}
{
"parentA": 1,
"parentB": 2,
"childA": 3,
"childB": 4
}
61. 61COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 61
Scope and Field Access Strategy
Serialization
● Existing fields with public getters
● Public fields with no getters
● Public getter/setter pair without a
corresponding field
Deserialization
● Existing fields with public setters
● Public fields with no setters
● Public getter/setter pair without a
corresponding field
62. 62COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 62
Scope and Field Access Strategy
{
"publicFinalField": 1,
"publicWithNoGetter": 1,
"privateWithPublicGetter": 1,
"noField": 1
}
public class Foo {
public final int publicFinalField;
private final int privateFinalField;
public static int publicStaticField;
public int publicWithNoGetter;
public int publicWithPrivateGetter;
public Integer publicNullField = null;
private int privateWithNoGetter;
private int privateWithPublicGetter;
public int getNoField() {};
public void setNoField(int value) {};
}
63. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 63
Customized Mapping
64. 64COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 64
JSON-B Engine Configuration
● Annotations
● Runtime configuration
○ JsonbConfig
○ JsonbBuilder
JsonbConfig config = new JsonbConfig()
.withFormatting(…)
.withNullValues(…)
.withEncoding(…)
.withStrictIJSON(…)
.withPropertyNamingStrategy(…)
.withPropertyOrderStrategy(…)
.withPropertyVisibilityStrategy(…)
.withAdapters(…)
.withBinaryDataStrategy(…);
Jsonb jsonb = JsonbBuilder.newBuilder()
.withConfig(…)
.withProvider(…)
.build();
65. 65COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 65
Customizations
● Property names
● Property order
● Ignoring properties
● Null handling
● Custom instantiation
● Property visibility
● Date/Number Formats
● Binary Encoding
● Adapters
● Serializers/Deserializers
66. 66COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 66
Property Names
● Annotation
○ @JsonbProperty
● Scope:
○ Field
○ Getter/Setter
○ Parameter
public class Customer {
public int id;
@JsonbProperty("name")
public String firstName;
}
public class Customer {
public int id;
private String firstName;
@JsonbProperty("name")
public String getFirstName() {
return firstName;
}
}
67. 67COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 67
Property Naming Strategy
● Globally changes the way of naming properties
● Supported a set of predefined strategies (see next slide)
○ JsonbConfig. withPropertyNamingStrategy(String strategyName)
● Ability to write your own strategy
○ Implement PropertyNamingStrategy interface
○ JsonbConfig. withPropertyNamingStrategy(PropertyNamingStrategy name);
68. 68COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 68
Predefined Property Naming Strategies
Strategy Name Sample
IDENTITY (default) myProperty → myProperty
LOWER_CASE_WITH_DASHES myProperty → my-property
LOWER_CASE_WITH_UNDERSCORES myProperty → my_property
UPPER_CAMEL_CASE myProperty → MyProperty
UPPER_CAMEL_CASE_WITH_SPACES myProperty → "My Property"
CASE_INSENSITIVE the same as IDENTITY but ignores case on
deserialization
Custom Strategy Custom case conversion login
69. 69COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 69
Property Order Strategy
● Strategies:
○ LEXICOGRAPHICAL (A-Z)
○ ANY
○ REVERSE (Z-A)
● Annotation
○ @JsonbPropertyOrder on class
● JsonbConfig
○ withPropertyOrderStrategy(…)
@JsonbPropertyOrder(ANY)
public class Foo {
public int bar2;
public int bar1;
}
70. 70COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 70
Ignoring Properties
● Annotation
○ @JsonbTransient
public class Foo {
public int bar2;
@JsonbTransient
public int bar1;
}
71. 71COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 71
Property Visibility
● PropertyVisibilityStrategy interface
● Annotation
○ @JsonbVisibility
● JsonbConfig
○ withPropertyVisibilityStrategy(…)
public interface PropertyVisibilityStrategy {
boolean isVisible(Field field);
boolean isVisible(Method method);
}
public class MyStrategy implements
PropertyVisibilityStrategy {
/* ... */
}
@JsonbVisibility(MyStrategy.class)
public class Bar {
private int field1;
private int field2;
}
72. 72COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 72
Null Handling
● Null fields are skipped by default
● Annotation
○ @JsonbNillable
● JsonbConfig
○ withNullValues(true)
public class Customer {
public int id = 1;
@JsonbProperty(nillable=true)
public String name = null;
}
@JsonbNillable
public class Customer {
public int id = 1;
public String name = null;
}
73. 73COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 73
Custom Instantiation
public class Order {
public int id;
public Customer customer;
}
public class Customer {
...
@JsonbCreator
public static Customer getFromDb(
@JsonbProperty int id) {
return CustomerDao.getByPrimaryKey(id);
}
}
{
"id": 123,
"customer": {
"id": 562,
}
}
● Use @JsonbCreator when a class does
not have a default (no-args) constructor
● At most one @JsonbCreator can be used
per class
● Can be used on a constructor or static
creator method
74. 74COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 74
Date / Number Format
● Annotations
○ @JsonbDateFormat
○ @JsonbNumberFormat
● JsonbConfig
○ withDateFormat(…)
○ withLocale(…)
public class FormatSample {
public Date defaultDate;
@JsonbDateFormat("dd.MM.yyyy")
public Date formattedDate;
public BigDecimal defaultNumber;
@JsonbNumberFormat(“#0.00")
public BigDecimal formattedNumber;
}
75. 75COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 75
Binary Data Encoding
● Supported encodings
○ BYTE (default)
○ BASE_64
○ BASE_64_URL
● JsonbConfig
○ withBinaryDataStrategy(…)
JsonbConfig config = new JsonbConfig()
.withBinaryDataStrategy(
BinaryDataStrategy.BASE_64);
Jsonb jsonb = JsonbBuilder.create(config);
String json = jsonb.toJson(obj);
76. 76COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 76
I-JSON
● I-JSON (”Internet JSON”) is a restricted profile of JSON
○ https://tools.ietf.org/html/draft-ietf-json-i-json-06
● JSON-B fully supports I-JSON by default with three exceptions:
○ JSON Binding does not restrict the serialization of top-level JSON texts that are
neither objects nor arrays. The restriction should happen at application level.
○ JSON Binding does not serialize binary data with base64url encoding.
○ JSON Binding does not enforce additional restrictions on dates/times/duration.
● JsonbConfig
○ withStrictIJSON(true)
77. 77COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 77
Adapters
● Inspired by JAXB
● Annotations
○ @JsonbTypeAdapter annotation
● JsonbConfig
○ withAdapters(…)
public interface
JsonbAdapter<Original, Adapted> {
Adapted adaptToJson(Original obj);
Original adaptFromJson(Adapted obj);
}
@JsonbTypeAdapter(AnimalAdapter.class)
public Animal animal;
JsonbConfig config = new JsonbConfig()
.withAdapters(new AnimalAdapter());
78. 78COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 78
Adapters
● Inspired by JAXB
● Annotations
○ @JsonbTypeAdapter annotation
● JsonbConfig
○ withAdapters(…)
public interface
JsonbAdapter<Original, Adapted> {
Adapted adaptToJson(Original obj);
Original adaptFromJson(Adapted obj);
}
@JsonbTypeAdapter(AnimalAdapter.class)
public Animal animal;
JsonbConfig config = new JsonbConfig()
.withAdapters(new AnimalAdapter());
79. 79COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 79
Serializers / Deserializers
● Low level control on
serialization/deserialization
● Annotations
○ @JsonbTypeSerializer
○ @JsonbTypeDeserializer
● JsonbConfig
○ withSerializers(…)
○ withDeserializers(…)
public interface JsonbSerializer<T> {
void serialize(T obj,
JsonGenerator generator,
SerializationContext ctx);
public interface JsonbDeserializer<T> {
T deserialize(JsonParser parser,
DeserializationContext ctx,
Type rtType);
}
@JsonbTypeSerializer(AnimalSerializer.class)
@JsonbTypeDeserializer(AnimalDeserializer.class)
public Animal animal;
JsonbConfig config = new JsonbConfig()
.withSerializers(new AnimalSerializer())
.withDeserializers(new AnimalDeserializer());
80. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 80
Plans
81. 81COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 81
Future JSON-B Plans
● Larger features
○ Customize 3rd party classes (jsonb-api #88)
○ Polymorphic [De]serialization (jsonb-api #147)
○ Map directly to/from JsonGenerator and JsonParser (jsonb-api #122)
● Smaller features
○ Using @JsonbCreator with absent/optional fields (jsonb-api #121)
○ Configurable interface impl mappings (jsonb-api #65)
○ Automatically register Adapters/[De]Serializers (jsonb-api #35)
○ Opt out of the “must ignore” policy (jsonb-api #56)
○ Customize date formats of different types (jsonb-api #87)
82. 82COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 82
Customizing 3rd party classes
● Be able to customize classes you cannot modify
● Similar use-case as Jackson mix-ins
// Cannot modify this class
// Comes from 3rd party dependency
public class Dog {
// @JsonbProperty(“dogName”)
public String name;
public int age;
// @JsonbTransient
public Owner owner;
}
ClassCustomization c = ClassCustomization.for(Dog.class)
.property(”name”, ”dogName”)
.transient(”owner”)
// The ”age” property not mentioned, so it is left as-is
.build();
JsonbConfig config = new JsonbConfig()
.withClassCustomization(c);
83. 83COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 83
Polymorphic [de]serialization
● Allows for properties in the JSON data to be
used to determine the Java deserialization class
● Highly requested feature, but security sensitive
PolymorphicConfig poly = PolymorphicConfig.builder()
.withClasses(Dog.class, Cat.class)
.withTypeAttribute(”jsonb_class”); // optional
JsonbConfig config = new JsonbConfig()
.withPolymorphicConfig(poly);
{
”jsonb_class": ”com.foo.Dog”
”name": ”Spot”
”bites": false
}
{
”jsonb_class": ”com.foo.Cat”
”name": ”Princess”
”meows": true
}
84. 84COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 84
Custom constructors with absent parameters
● JSON-B classes can have at most 1
@JsonbCreator annotated constructor
● Object might need to be constructed without
some properties present
● Particularly useful for immutable data objects
public class Person {
public final String firstName;
public final String middleName;
public final String lastName;
@JsonbCreator
public Person(
@JsonbCreator(”firstName”) String first,
@JsonbCreator(”middleName”) String mid,
@JsonbCreator(”lastName”) String last) {
this.firstName = first;
this.middleName = mid;
this.lastName = last;
}
}{
"firstName": "Jane",
"lastName": "Doe"
}
85. 85COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 85
Automatically register Adapters and [De]Serializers
● Add new annotations to automatically
register JsonbAdapter, JsonbSerializer, and
JsonbDeserializer when CDI is present
● No need to manually register objects with
JsonbConfig
@RegisterJsonbAdapter
public class PersonAdapter implements
JsonbAdapter<Person, Map<String,Object>> {
// ...
}
JsonbConfig config = new JsonbConfig()
.withAdapters(new PersonAdapter());
86. 86COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 86
Opt-out of the ”Must-Ignore” policy
● By default JSON-B will ignore unrecognized
properties on deserialization
● Provide way to opt-out so an error is raised
if unrecognized properties are encountered
{
”first": "Jane",
”last": "Doe"
}
JsonbConfig config = new JsonbConfig()
.withAllowUnrecognized(false);
// ...
// Fails with JsonbException because
// ‘first’ and ‘last’ properties not recognized
Person p = jsonb.fromJson(json, Person.class)
public class Person {
public String firstName;
public String middleName;
public String lastName;
}
87. 87COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 87
Future JSON-B Plans
● See Github project board for complete overview and up-to-date information
https://github.com/eclipse-ee4j/jsonb-api/projects/1
88. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 88
Thank you!