Class CurrentDateTransformerConfig
- All Implemented Interfaces:
Labelable
Adds the current computer UTC date to the specified field.
If no field is provided, the date will be added to
document.importedDate.
The default date format is EPOCH
(the difference, measured in milliseconds, between the current time and
midnight, January 1, 1970 UTC).
A custom date format can be specified with the format
attribute, as per the
formatting options found on SimpleDateFormat.
Storing values in an existing field
If a target field with the same name already exists for a document,
values will be added to the end of the existing value list.
It is possible to change this default behavior by supplying a
PropertySetter.
Can be used both as a pre-parse or post-parse handler.
It is possible to specify a locale used for formatting dates. The locale is the ISO two-letter language code, with an optional ISO country code, separated with an underscore (e.g., "fr" for French, "fr_CA" for Canadian French). When no locale is specified, the default is "en_US" (US English).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe locale used for formatting.getOnSet()The property setter to use when a value is set.The target field.inthashCode()The locale used for formatting.setOnSet(PropertySetter onSet) The property setter to use when a value is set.setToField(String toField) The target field.toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Field Details
-
DEFAULT_FIELD
- See Also:
-
-
Constructor Details
-
CurrentDateTransformerConfig
public CurrentDateTransformerConfig()
-
-
Method Details
-
getToField
The target field. Defaults to "document.importedDate".- Returns:
- target field
-
getFormat
-
getLocale
The locale used for formatting.- Returns:
- locale
-
getOnSet
The property setter to use when a value is set.- Returns:
- property setter
-
setToField
The target field. Defaults to "document.importedDate".- Parameters:
toField- target field- Returns:
this.
-
setFormat
- Returns:
this.
-
setLocale
The locale used for formatting.- Parameters:
locale- locale- Returns:
this.
-
setOnSet
The property setter to use when a value is set.- Parameters:
onSet- property setter- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-