Join Ketkee Aryamane for an in-depth discussion in this video adaptToJson, part of Java EE 8: JSON-B.
- [Instructor] So let us take a look at the demo now.…The first thing that we have to do is create…an adapter class which will implement…the JsonbAdapter interface.…And that's called a couple of methods…that we spoke about in the previous video.…So let's head back to the IDE.…And under the custom folder,…I'm going to create a class.…And let's call it CustomerAdapter…because that's the one I was trying to talk about.…The use cases and the customer object that I have,…I need to send out only two fields…as a part of serialization then, the serialization.…
So I'm going to write an adapter for that.…And what do you do on this?…You say implement JSONbAdapter.…That's the one.…So the JSONbAdapter is going to ask you…for two arguments in the javax syntax.…One is the original object which is the customer,…then the adapted object that you actually want…as a part of your requirement.…So the original object is the customer,…so let's import that, com.app.beans.…And the next one is, of course, going to be the JSON object.…
So what we do is we take the customer object,…
- 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: 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.