Class PropertyOrderStrategy

java.lang.Object
jakarta.json.bind.config.PropertyOrderStrategy

public final class PropertyOrderStrategy extends Object

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:

  1. JsonbPropertyOrder on 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.
  2. This strategy is applied to all other types that do not carry a JsonbPropertyOrder annotation.

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 Details