Class DateFormatBuilder
- java.lang.Object
-
- com.adaptris.core.services.metadata.DateFormatBuilder
-
- Direct Known Subclasses:
DateFormatBuilderWithOptionalFractionAndOffset
public class DateFormatBuilder extends java.lang.Object
Builds a DateFormat instance for use withReformatDateService
andAddTimestampMetadataService
.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DateFormatBuilder.DateFormatter
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description DateFormatBuilder()
DateFormatBuilder(java.lang.String format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theLocale
which is resolved viaLocale.forLanguageTag(String)
.void
setTimezone(java.lang.String tz)
Set the timezoneDateFormatBuilder
withFormat(java.lang.String f)
DateFormatBuilder
withLanguageTag(java.lang.String tag)
DateFormatBuilder
withTimezone(java.lang.String tz)
-
-
-
Field Detail
-
DEFAULT_DATE_FORMAT
public static final java.lang.String DEFAULT_DATE_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public DateFormatBuilder.DateFormatter build(AdaptrisMessage msg)
-
getFormat
public java.lang.String getFormat()
-
setFormat
public void setFormat(java.lang.String format)
Set the format.- Parameters:
format
- the dateformat, default is "yyyy-MM-dd\'T\'HH:mm:ssZ" if not specified.
-
withFormat
public DateFormatBuilder withFormat(java.lang.String f)
-
getLanguageTag
public java.lang.String getLanguageTag()
-
setLanguageTag
public void setLanguageTag(java.lang.String locale)
Set the language tag for theLocale
which is resolved viaLocale.forLanguageTag(String)
.- Parameters:
locale
- the locale using the IETF BCP 47 language tag string e.g.fr-FR
oren-GB
.- See Also:
Locale.forLanguageTag(String)
-
withLanguageTag
public DateFormatBuilder withLanguageTag(java.lang.String tag)
-
getTimezone
public java.lang.String getTimezone()
-
setTimezone
public void setTimezone(java.lang.String tz)
Set the timezone- Parameters:
tz
- the timezone e.g.UTC
orGMT
.- See Also:
TimeZone.getTimeZone(String)
-
withTimezone
public DateFormatBuilder withTimezone(java.lang.String tz)
-
-