Jackson: What happens if a property is missing?

Summarizing excellent answers by Programmer Bruce and StaxMan:

  1. Missing properties referenced by the constructor are assigned a default value as defined by Java.

  2. You can use setter methods to differentiate between properties that are implicitly or explicitly set. Setter methods are only invoked for properties with explicit values. Setter methods can keep track of whether a property was explicitly set using a boolean flag (e.g. isValueSet).

Leave a Comment