Package org.smooks.engine.converter
Class DateLocaleAwareTypeConverter<S,T>
- java.lang.Object
-
- org.smooks.engine.converter.LocaleAwareTypeConverter<S,T>
-
- org.smooks.engine.converter.DateLocaleAwareTypeConverter<S,T>
-
- All Implemented Interfaces:
TypeConverter<S,T>
,Configurable
- Direct Known Subclasses:
DateToStringLocaleAwareConverter
,StringToDateLocaleAwareConverter
public abstract class DateLocaleAwareTypeConverter<S,T> extends LocaleAwareTypeConverter<S,T>
LocaleAwareDateDecoder is a decoder 'helper' that can be subclassed by Date decoders to enable them to use locale specific date formats. Usage (on Java Binding value config using theDateDecoder
):<jb:value property="date" decoder="Date" data="order/@date"> <-- Format: Defaults to "yyyy-MM-dd'T'HH:mm:ss" (SOAP) --> <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z yyyy</jb:decodeParam> <-- Locale: Defaults to machine Locale --> <jb:decodeParam name="locale">sv-SE</jb:decodeParam> <-- Verify Locale: Default false --> <jb:decodeParam name="verify-locale">true</jb:decodeParam> </jb:value>
- Author:
- daniel.bevenius@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description protected DateTimeFormatter
dateTimeFormatter
static String
DEFAULT_DATE_FORMAT
Default date format string.protected String
format
static String
FORMAT
Date format configuration key.static String
ZONE_ID
protected ZoneId
zoneId
-
Fields inherited from class org.smooks.engine.converter.LocaleAwareTypeConverter
LOCALE, LOCALE_COUNTRY_CODE, LOCALE_LANGUAGE_CODE, VERIFY_LOCALE
-
-
Constructor Summary
Constructors Constructor Description DateLocaleAwareTypeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setConfiguration(Properties properties)
Set the component configuration.-
Methods inherited from class org.smooks.engine.converter.LocaleAwareTypeConverter
getConfiguration, getLocale, getLocale, isLocalInstalled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.smooks.api.converter.TypeConverter
convert
-
-
-
-
Field Detail
-
FORMAT
public static final String FORMAT
Date format configuration key.- See Also:
- Constant Field Values
-
ZONE_ID
public static final String ZONE_ID
- See Also:
- Constant Field Values
-
DEFAULT_DATE_FORMAT
public static final String DEFAULT_DATE_FORMAT
Default date format string.- See Also:
- Constant Field Values
-
format
protected String format
-
zoneId
protected ZoneId zoneId
-
dateTimeFormatter
protected DateTimeFormatter dateTimeFormatter
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Properties properties) throws SmooksConfigException
Description copied from interface:Configurable
Set the component configuration.- Specified by:
setConfiguration
in interfaceConfigurable
- Overrides:
setConfiguration
in classLocaleAwareTypeConverter<S,T>
- Parameters:
properties
- The component configuration properties.- Throws:
SmooksConfigException
- Bad component configuration.
-
-