org.milyn.javabean.decoders
Class LocaleAwareDateDecoder

java.lang.Object
  extended by org.milyn.javabean.decoders.LocaleAwareDecoder
      extended by org.milyn.javabean.decoders.LocaleAwareDateDecoder
All Implemented Interfaces:
Serializable, Configurable, DataDecoder
Direct Known Subclasses:
CalendarDecoder, DateDecoder

public abstract class LocaleAwareDateDecoder
extends LocaleAwareDecoder

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 the DateDecoder):

 <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
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.milyn.javabean.DataDecoder
DataDecoder.Factory
 
Field Summary
protected  SimpleDateFormat decoder
           
static String DEFAULT_DATE_FORMAT
          Default date format string.
protected  String format
           
static String FORMAT
          Date format configuration key.
static String LOCALE_COUNTRY_CODE
          Deprecated. Use LocaleAwareDecoder.
static String LOCALE_LANGUAGE_CODE
          Deprecated. Use LocaleAwareDecoder.
static String VERIFY_LOCALE
          Deprecated. Use LocaleAwareDecoder.
 
Fields inherited from class org.milyn.javabean.decoders.LocaleAwareDecoder
LOCALE
 
Constructor Summary
LocaleAwareDateDecoder()
           
 
Method Summary
 void setConfiguration(Properties resourceConfig)
          Set the component configuration.
 
Methods inherited from class org.milyn.javabean.decoders.LocaleAwareDecoder
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.milyn.javabean.DataDecoder
decode
 

Field Detail

FORMAT

public static final String FORMAT
Date format configuration key.

See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

public static final String DEFAULT_DATE_FORMAT
Default date format string.

See Also:
Constant Field Values

LOCALE_LANGUAGE_CODE

public static final String LOCALE_LANGUAGE_CODE
Deprecated. Use LocaleAwareDecoder.
ISO Language Code. Lower case two-letter code defined by ISO-639

See Also:
Constant Field Values

LOCALE_COUNTRY_CODE

public static final String LOCALE_COUNTRY_CODE
Deprecated. Use LocaleAwareDecoder.
ISO Country Code. Upper case two-letter code defined by ISO-3166

See Also:
Constant Field Values

VERIFY_LOCALE

public static final String VERIFY_LOCALE
Deprecated. Use LocaleAwareDecoder.
True or false(default). Whether or not a check should be performed to verify that the specified locale is installed. This operation can take some time and should be turned off in a production evironment

See Also:
Constant Field Values

format

protected String format

decoder

protected SimpleDateFormat decoder
Constructor Detail

LocaleAwareDateDecoder

public LocaleAwareDateDecoder()
Method Detail

setConfiguration

public void setConfiguration(Properties resourceConfig)
                      throws SmooksConfigurationException
Description copied from interface: Configurable
Set the component configuration.

Specified by:
setConfiguration in interface Configurable
Overrides:
setConfiguration in class LocaleAwareDecoder
Parameters:
resourceConfig - The component configuration properties.
Throws:
SmooksConfigurationException - Bad component configuration.


Copyright © 2018. All rights reserved.