public class DateFormatBuilder
extends java.lang.Object
ReformatDateService
and AddTimestampMetadataService
.In the adapter configuration file this class is aliased as date-format-builder which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static interface |
DateFormatBuilder.DateFormatter |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DATE_FORMAT |
Constructor and Description |
---|
DateFormatBuilder() |
DateFormatBuilder(java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
DateFormatBuilder.DateFormatter |
build(AdaptrisMessage msg) |
java.lang.String |
getFormat() |
java.lang.String |
getLanguageTag() |
java.lang.String |
getTimezone() |
void |
setFormat(java.lang.String format)
Set the format.
|
void |
setLanguageTag(java.lang.String locale)
Set the language tag for the
Locale which is resolved via Locale.forLanguageTag(String) . |
void |
setTimezone(java.lang.String tz)
Set the timezone
|
DateFormatBuilder |
withFormat(java.lang.String f) |
DateFormatBuilder |
withLanguageTag(java.lang.String tag) |
DateFormatBuilder |
withTimezone(java.lang.String tz) |
public static final java.lang.String DEFAULT_DATE_FORMAT
public DateFormatBuilder()
public DateFormatBuilder(java.lang.String format)
public DateFormatBuilder.DateFormatter build(AdaptrisMessage msg)
public java.lang.String getFormat()
public void setFormat(java.lang.String format)
format
- the dateformat, default is "yyyy-MM-dd\'T\'HH:mm:ssZ" if not specified.public DateFormatBuilder withFormat(java.lang.String f)
public java.lang.String getLanguageTag()
public void setLanguageTag(java.lang.String locale)
Locale
which is resolved via Locale.forLanguageTag(String)
.locale
- the locale using the IETF BCP 47 language tag string e.g. fr-FR
or en-GB
.Locale.forLanguageTag(String)
public DateFormatBuilder withLanguageTag(java.lang.String tag)
public java.lang.String getTimezone()
public void setTimezone(java.lang.String tz)
tz
- the timezone e.g. UTC
or GMT
.TimeZone.getTimeZone(String)
public DateFormatBuilder withTimezone(java.lang.String tz)