Enum Class ConfigParam

java.lang.Object
java.lang.Enum<ConfigParam>
cz.cvut.kbss.jsonld.ConfigParam
All Implemented Interfaces:
Serializable, Comparable<ConfigParam>, Constable

public enum ConfigParam extends Enum<ConfigParam>
Configuration parameters.
  • Enum Constant Details

    • IGNORE_UNKNOWN_PROPERTIES

      public static final ConfigParam IGNORE_UNKNOWN_PROPERTIES
      Whether to ignore unknown properties when deserializing JSON-LD.

      If set to false, an exception will be thrown when unknown property is encountered.

    • SCAN_PACKAGE

      public static final ConfigParam SCAN_PACKAGE
      Package in which to look for mapped classes.

      The scan is important for support for polymorphism in object deserialization.

    • REQUIRE_ID

      public static final ConfigParam REQUIRE_ID
      Whether to require an identifier when serializing an object.

      If set to true and no identifier is found (either there is no identifier field or its value is null), an exception will be thrown. If configured to false, a blank node identifier is generated if no id is present.

    • ASSUME_TARGET_TYPE

      public static final ConfigParam ASSUME_TARGET_TYPE
      Allows assuming target type from the provided Java type when no types are specified in JSON-LD.

      If set to true, JB4JSON-LD will attempt to use the provided Java type as the target type when deserializing a JSON-LD object which has no types declared.

      Defaults to false, in which case an exception is thrown for a typeless JSON-LD object.

    • ENABLE_OPTIMISTIC_TARGET_TYPE_RESOLUTION

      public static final ConfigParam ENABLE_OPTIMISTIC_TARGET_TYPE_RESOLUTION
      Enables optimistic target type resolution.

      This means that when a an ambiguous target type is encountered during deserialization of an object (i.e., multiple concrete classes match the data type), instead of throwing an AmbiguousTargetTypeException, one of the classes will be selected for instantiation.

      Note that enabling this behavior should probably be done together with setting IGNORE_UNKNOWN_PROPERTIES to true, so that any JSON-LD data for which the selected target class has no mapping are ignored and do not cause an exception to be thrown.

      Defaults to false.

    • PREFER_SUPERCLASS

      public static final ConfigParam PREFER_SUPERCLASS
      Configures optimistic type resolution to prefer concrete superclasses if possible.

      If optimistic target type resolution is enabled, the target type resolver will select one of the matching classes for instantiation. If this parameter is set tot true, a parent class (if concrete) will be preferred for instantiation. If not, any of the classes may be selected.

      Defaults to false.

      See Also:
    • SERIALIZE_DATETIME_AS_MILLIS

      public static final ConfigParam SERIALIZE_DATETIME_AS_MILLIS
      Whether to serialize date/time values as the number of milliseconds since epoch (if applicable).

      Serialization as the number of millis since epoch is the default way for Date, but is not very useful for the Java 8 datetime API. If set to false, date/time values will be serialized as String in the ISO 8601 format.

      To provide consistent behavior of various datetime representations, this property defaults to false.

    • DATE_TIME_FORMAT

      public static final ConfigParam DATE_TIME_FORMAT
      Format string used to serialize and deserialize datetime values.

      Note that if SERIALIZE_DATETIME_AS_MILLIS is enabled, this parameter has no effect on serialization of datetime.

      Also note that this format applies only to full datetime values. Date or time values have to be formatted per-attribute.

    • SERIALIZE_INDIVIDUALS_USING_EXPANDED_DEFINITION

      public static final ConfigParam SERIALIZE_INDIVIDUALS_USING_EXPANDED_DEFINITION
      Whether to serialize individuals using expanded term definition in context.

      This basically means that the individual's identifier is provided directly as a string and an expanded term definition (consisting of a @id and @type) is added into the context, specifying that the string is an identifier.

    • DISABLE_TYPE_MAP_CACHE

      public static final ConfigParam DISABLE_TYPE_MAP_CACHE
      Whether to disable the type map cache.

      Type map is used to map JSON-LD types to Java classes for deserialization. Since this map is built by scanning the classpath (see the SCAN_PACKAGE parameter), it is cached by default to avoid repeated scanning of the classpath.

      If every deserializer instance should get a fresh type map based on the current configuration, disable this cache.

  • Method Details

    • values

      public static ConfigParam[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ConfigParam valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()