java.lang.Object
jakarta.json.bind.config.PropertyOrderStrategy
Specifies predefined property order stategy for serialization.
This strategy can be set globally via
JsonbConfig.withPropertyOrderStrategy(String).
Interaction with other ordering customizations
This strategy applies globally to all serialized types, but its effect can be overridden at the type level. The following precedence rules apply:
JsonbPropertyOrderon a class or record takes precedence over this strategy for that specific type. Properties listed in that annotation are serialized first in the declared order; any remaining properties follow in an unspecified order.- This strategy is applied to all other types that do not carry a
JsonbPropertyOrderannotation.
Interaction with property renaming
When LEXICOGRAPHICAL or REVERSE is used, ordering is applied
to the final JSON property names; that is, names after any renaming customization
(such as JsonbProperty or a
PropertyNamingStrategy) has been applied.
- Since:
- JSON Binding 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe order of properties is not specified and may vary across serializations.static final StringProperties are serialized in ascending lexicographical order of their JSON property names.static final StringProperties are serialized in descending lexicographical order of their JSON property names; the reverse ofLEXICOGRAPHICAL. -
Method Summary
-
Field Details
-
LEXICOGRAPHICAL
Properties are serialized in ascending lexicographical order of their JSON property names. If a property name has been customized viaJsonbPropertyor aPropertyNamingStrategy, the customized name is used for ordering.- See Also:
-
ANY
The order of properties is not specified and may vary across serializations. No ordering guarantees are provided.- See Also:
-
REVERSE
Properties are serialized in descending lexicographical order of their JSON property names; the reverse ofLEXICOGRAPHICAL. If a property name has been customized viaJsonbPropertyor aPropertyNamingStrategy, the customized name is used for ordering.- See Also:
-