MetadataStandard.asValueMap(…)shall contain entries for null, nil or empty values. By default the value map does not provide entries for
nullmetadata properties, nil objects or empty collections. This enumeration allows to control this behavior.
Difference between null and nilA null property is a reference which is
nullin the Java sense. Null references can be used for missing properties when no information is provided about why the property is missing. On the other hand, a nil object is a placeholder for a missing property similar in purpose to
nullreferences, except that an explanation about why the property is missing can be attached to those objects. Those explanations can be obtained by calls to the
- See Also:
Defined in the
Nested Class Summary
Enum Constant SummaryEnum ConstantDescriptionIncludes all entries in the map, including those having a null value or an empty collection.Includes non-empty properties but omits title properties.Includes only the properties that are non-null, non-nil and non empty.Includes only the non-null and non-nil properties.Includes only the non-null properties.
Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Enum Constant Details
ALLpublic static final ValueExistencePolicy ALLIncludes all entries in the map, including those having a null value or an empty collection.
NON_NULLpublic static final ValueExistencePolicy NON_NULL
NON_NILpublic static final ValueExistencePolicy NON_NILIncludes only the non-null and non-nil properties. Collections are included no matter if they are empty or not.
The set of
NON_NILproperties is a subset of
NON_EMPTYpublic static final ValueExistencePolicy NON_EMPTYIncludes only the properties that are non-null, non-nil and non empty. A non-null and non-nil property is considered empty in any of the following cases:
- It is a character sequence containing only whitespaces.
- It is an empty collection.
- It is an empty map.
- It is an empty array (of length 0).
The set of
NON_EMPTYproperties is a subset of
COMPACTpublic static final ValueExistencePolicy COMPACTIncludes non-empty properties but omits title properties. Values associated to title properties are instead associated with the parent node. This policy is relevant for metadata classes annotated with
TitleProperty; for all other classes, this policy is identical to
NON_EMPTY.Example: theThis policy is the default behavior of
DefaultCitationDateclasses are annotated with
@TitleProperty(name="date")respectively. The following table compares the trees produced by two policies:
Comparison of "non-empty" and "compact" policy on the same metadata
Citation ├─Title……………………… My document └─Date ├─Date………………… 2012/01/01 └─Date type…… Creation
Citation……………………… My document └─Date………………………… 2012/01/01 └─Date type…… Creation
AbstractMetadata.asTreeTable(), and consequently defines the default rendering of
- See Also:
valuespublic static ValueExistencePolicy values()Returns an array containing the constants of this enum type, in the order they are declared.
- an array containing the constants of this enum type, in the order they are declared
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)