Module org.eclipse.yasson
Class PropertyOrdering
java.lang.Object
org.eclipse.yasson.internal.model.customization.PropertyOrdering
Order properties in bean object.
JsonbPropertyOrder
have always precedence.
If configured with JsonbConfig
provided property order strategy will be used.-
Constructor Summary
ConstructorsConstructorDescriptionPropertyOrdering
(Consumer<List<PropertyModel>> propertyOrderStrategy) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionorderProperties
(List<PropertyModel> properties, ClassModel classModel) Sorts class properties either, by classJsonbPropertyOrder
annotation, or byPropertyOrderStrategy
if set inJsonbConfig
.
-
Constructor Details
-
PropertyOrdering
Creates a new instance.- Parameters:
propertyOrderStrategy
- Property order strategy. Must be not null.
-
-
Method Details
-
orderProperties
Sorts class properties either, by classJsonbPropertyOrder
annotation, or byPropertyOrderStrategy
if set inJsonbConfig
.- Parameters:
properties
- Properties to sort.classModel
- Class model.- Returns:
- Sorted list of properties.
-