@ServiceProvider public class DateFieldReplacerFactory extends Object implements FieldReplacer.Factory
FieldReplacer
that provides an ability to replace
date
fields according to the specified strategy.
field replacer
should be in the following format:
"date:<recordFilter>:<target>:<configuration>[:<timezone>]"
, where recordFilter
is a
RecordOnlyFilter
, target
is a name of the date field, configuration
is a configuration of the replacing strategy, and timezone
is a time zone
.
For all record cursors
which are accepted by recordFilter
all fields with serial type SerialFieldType.DATE
(or created by SerialFieldType.withName(String)
method) are replaced with the new date according to the specified strategy.
"current"
;"previous"
;"+<number>"
or "-<number>"
;"0"
(N/A date) or "yyyyMMdd"
.Current and previous date strategies allow to specify timezone
to calculate day boundaries.
example.qds
and shifts the date to three days ago in "DayId"
fields in all records.
DXEndpoint endpoint = ... endpoint.connect("example.qds[fieldReplacer=date:*:DayId:-3");
FieldReplacer
Constructor and Description |
---|
DateFieldReplacerFactory() |
Modifier and Type | Method and Description |
---|---|
FieldReplacer |
createFieldReplacer(String fieldReplacerSpec,
DataScheme dataScheme)
Creates
field replacer for specified data scheme
from specification. |
public FieldReplacer createFieldReplacer(String fieldReplacerSpec, DataScheme dataScheme)
FieldReplacer.Factory
field replacer
for specified data scheme
from specification.
NOTE: the only one factory can support specification.
createFieldReplacer
in interface FieldReplacer.Factory
fieldReplacerSpec
- specification of FieldReplacer
. The specification should start with
"<factory_name>:"
to detect should factory support the specification or not.dataScheme
- current data scheme
field replacer
if this factory supports specification,
null
otherwise.Copyright © 2002–2025 Devexperts LLC. All rights reserved.