Join Ketkee Aryamane for an in-depth discussion in this video Custom constructors, part of Java EE 8: JSON-B.
- [Instructor] Now let's take a look at the next…customized mapping option that we have,…which is how do you define a custom constructor?…Now by default, whenever the JSON binding API…tries to do deserialization,…we all know that a no argument…or a default constructor is a must.…It is going to make sure that it invokes that,…and thereafter, it'll invoke the appropriate setup methods…to set the values on the JSON document…into the respective property of your Java object.…So that's the rule.…However, there are certain situations…where this may not be the desired behavior…because the kind of JSON representation…that you're getting from some other system…may not know the structure of your beans.…
So it may send out a plain JSON…with just key-value pairs,…and it really may not have the correct object representation…that your system or your code expects.…So I'm going to talk about this situation,…this example that we have in front of us,…and then we'll go onto understand how do you solve this.…So let's go to our project structure.…
- JSON and JSON-B API basics
- Default mapping
- Defining beans and data
- Customized mapping
- Customizing the order of serialized properties
- Customizing constructors
- Working with binary data
- Custom serializers and deserializers
- Demo: Using JSON-B in a web application
Skill Level Intermediate
Java EE: RESTful Service with JAX-RS 2.0with Alex Theedom2h 17m Intermediate
Java EE: Servlets and JavaServer Pages (JSP)with Ketkee Aryamane6h 14m Intermediate
Map Java objects to JSON1m 14s
1. Overview and Setup
2. JSON Binding API: Default Mapping
3. JSON Binding API: Customized Mapping, Part 1
4. JSON Binding API: Customized Mapping, Part 2
5. Adapters and Serializers
6. JSON-B in a Web Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.