Class JsonbConfigProperties

java.lang.Object
org.eclipse.yasson.internal.JsonbConfigProperties

public class JsonbConfigProperties extends Object
Resolved properties from JSONB config.
  • Field Details

    • PROPERTY_ORDER_STRATEGY_MAPS

      private static final Map<String,Class<? extends Map>> PROPERTY_ORDER_STRATEGY_MAPS
    • jsonbConfig

      private final jakarta.json.bind.JsonbConfig jsonbConfig
    • propertyVisibilityStrategy

      private final jakarta.json.bind.config.PropertyVisibilityStrategy propertyVisibilityStrategy
    • propertyNamingStrategy

      private final jakarta.json.bind.config.PropertyNamingStrategy propertyNamingStrategy
    • propertyOrdering

      private final PropertyOrdering propertyOrdering
    • dateFormatter

      private final JsonbDateFormatter dateFormatter
    • locale

      private final Locale locale
    • binaryDataStrategy

      private final String binaryDataStrategy
    • nullable

      private final boolean nullable
    • failOnUnknownProperties

      private final boolean failOnUnknownProperties
    • strictIJson

      private final boolean strictIJson
    • zeroTimeDefaulting

      private final boolean zeroTimeDefaulting
    • requiredCreatorParameters

      private final boolean requiredCreatorParameters
    • dateInMillisecondsAsString

      private final boolean dateInMillisecondsAsString
    • userTypeMapping

      private final Map<Class<?>,Class<?>> userTypeMapping
    • defaultMapImplType

      private final Class<?> defaultMapImplType
    • nullSerializer

      private final jakarta.json.bind.serializer.JsonbSerializer<Object> nullSerializer
    • eagerInitClasses

      private final Set<Class<?>> eagerInitClasses
    • forceMapArraySerializerForNullKeys

      private final boolean forceMapArraySerializerForNullKeys
  • Constructor Details

    • JsonbConfigProperties

      public JsonbConfigProperties(jakarta.json.bind.JsonbConfig jsonbConfig)
      Creates new resolved JSONB config.
      Parameters:
      jsonbConfig - jsonb config
  • Method Details

    • initDefaultMapImplType

      private Class<? extends Map> initDefaultMapImplType()
    • initZeroTimeDefaultingForJavaTime

      private boolean initZeroTimeDefaultingForJavaTime()
    • initUserTypeMapping

      private Map<Class<?>,Class<?>> initUserTypeMapping()
    • initDateFormatter

      private JsonbDateFormatter initDateFormatter(Locale locale)
    • getGlobalConfigJsonbDateFormat

      private String getGlobalConfigJsonbDateFormat()
    • initOrderStrategy

      private Consumer<List<PropertyModel>> initOrderStrategy()
    • getPropertyOrderStrategy

      private String getPropertyOrderStrategy()
    • initPropertyNamingStrategy

      private jakarta.json.bind.config.PropertyNamingStrategy initPropertyNamingStrategy()
    • initPropertyVisibilityStrategy

      private jakarta.json.bind.config.PropertyVisibilityStrategy initPropertyVisibilityStrategy()
    • initBinaryDataStrategy

      private String initBinaryDataStrategy()
    • initConfigNullable

      private boolean initConfigNullable()
    • initConfigFailOnUnknownProperties

      private boolean initConfigFailOnUnknownProperties()
    • initRequiredCreatorParameters

      private boolean initRequiredCreatorParameters()
    • initDateInMillisecondsAsString

      private boolean initDateInMillisecondsAsString()
    • initNullSerializer

      private jakarta.json.bind.serializer.JsonbSerializer<Object> initNullSerializer()
    • initEagerInitClasses

      private Set<Class<?>> initEagerInitClasses()
    • initForceMapArraySerializerForNullKeys

      private boolean initForceMapArraySerializerForNullKeys()
    • getConfigNullable

      public boolean getConfigNullable()
      Gets nullable from JsonbConfig. If true null values are serialized to json.
      Returns:
      Configured nullable
    • getConfigFailOnUnknownProperties

      public boolean getConfigFailOnUnknownProperties()
      Gets unknown properties flag from JsonbConfig. If false, JsonbException is not thrown for deserialization, when json key cannot be mapped to class property.
      Returns:
      JsonbException is risen on unknown property. Default is true even if not set in json config.
    • getConfigProperty

      private <T> T getConfigProperty(String propertyName, Class<T> propertyType, T defaultValue)
    • getBinaryDataStrategy

      public String getBinaryDataStrategy()
      Checks for binary data strategy to use.
      Returns:
      Binary data strategy.
    • getLocale

      public Locale getLocale(String locale)
      Converts string locale to Locale.
      Parameters:
      locale - Locale to convert.
      Returns:
      Locale instance.
    • initConfigLocale

      private Locale initConfigLocale()
      Gets locale from JsonbConfig.
      Returns:
      Configured locale.
    • initStrictJson

      private boolean initStrictJson()
    • getPropertyVisibilityStrategy

      public jakarta.json.bind.config.PropertyVisibilityStrategy getPropertyVisibilityStrategy()
      Gets property visibility strategy.
      Returns:
      Property visibility strategy.
    • getPropertyNamingStrategy

      public jakarta.json.bind.config.PropertyNamingStrategy getPropertyNamingStrategy()
      Gets property naming strategy.
      Returns:
      Property naming strategy.
    • getConfigDateFormatter

      public JsonbDateFormatter getConfigDateFormatter()
      Gets instantiated shared config date formatter.
      Returns:
      Date formatter.
    • getPropertyOrdering

      public PropertyOrdering getPropertyOrdering()
      Gets property ordering component.
      Returns:
      Component for ordering properties.
    • isStrictIJson

      public boolean isStrictIJson()
      If strict IJSON patterns should be used.
      Returns:
      if IJSON is enabled
    • getUserTypeMapping

      public Map<Class<?>,Class<?>> getUserTypeMapping()
      User type mapping for map interface to implementation classes.
      Returns:
      User type mapping.
    • isZeroTimeDefaulting

      public boolean isZeroTimeDefaulting()

      Makes parsing dates defaulting to zero hour, minute and second. This will made available to parse patterns like yyyy.MM.dd to Date, Calendar, Instant LocalDate or even ZonedDateTime.

      If time zone is not set in the pattern than UTC time zone is used. So for example json value 2018.01.01 becomes 2018.01.01 00:00:00 UTC when parsed to instant Instant.

      Returns:
      true if time should be defaulted to zero.
    • getDefaultMapImplType

      public Class<?> getDefaultMapImplType()
      Default Map implementation to use, based on order strategy.
      Returns:
      map impl type
    • getNullSerializer

      public jakarta.json.bind.serializer.JsonbSerializer<Object> getNullSerializer()
    • hasRequiredCreatorParameters

      public boolean hasRequiredCreatorParameters()
    • getEagerInitClasses

      public Set<Class<?>> getEagerInitClasses()
    • isForceMapArraySerializerForNullKeys

      public boolean isForceMapArraySerializerForNullKeys()
      Whether the MapToEntriesArraySerializer is selected when a null key is detected in a map.
      Returns:
      false or true
    • isDateInMillisecondsAsString

      public boolean isDateInMillisecondsAsString()