Enum Class ConfigParam
- All Implemented Interfaces:
Serializable
,Comparable<ConfigParam>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAllows assuming target type from the provided Java type when no types are specified in JSON-LD.Format string used to serialize and deserialize datetime values.Whether to disable the type map cache.Enables optimistic target type resolution.Whether to ignore unknown properties when deserializing JSON-LD.Configures optimistic type resolution to prefer concrete superclasses if possible.Whether to require an identifier when serializing an object.Package in which to look for mapped classes.Whether to serialize date/time values as the number of milliseconds since epoch (if applicable).Whether to serialize individuals using expanded term definition in context. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
static ConfigParam
Returns the enum constant of this class with the specified name.static ConfigParam[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Package in which to look for mapped classes.The scan is important for support for polymorphism in object deserialization.
-
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 isnull
), an exception will be thrown. If configured tofalse
, a blank node identifier is generated if no id is present. -
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
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
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
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 tofalse
, 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
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
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
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
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
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 nameNullPointerException
- if the argument is null
-
getName
-