Join Ketkee Aryamane for an in-depth discussion in this video Customize order of serialized properties, part of Java EE 8: JSON-B.
- [Narrator] Now let's look at the next…customized mapping option which is customizing the order…of the serialized properties.…Now this can be done at both the compile and the run time.…At the compile time if you want to provide…this customization you need the JsonbPropertyOrder…annotation to be set on the class.…So how do you do that?…Let's go to the IDE.…Let's pick up the Product class this time.…And on this class I'm going to say JsonbPropertyOrder.…That's the one.…
And when you talk about the JsonbPropertyOrder,…you can now actually specify that using…the PropertyOrderStrategy and on that,…you can specify whether it is any,…or it is lexicographical or it is reverse.…By default of course the order strategy that is employed…is lexicographical, however if you say reverse,…let's try out reverse this time.…It means that the properties in your json document…will be ordered from z to a.…
That's what it means okay?…So let's test this out.…Let's go to Tests folder, create a Test class.…TestOrderStrategy, psvm, the main method,…
- 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.