net.sf.jsefa.common.converter
Class XmlDateTimeConverter

java.lang.Object
  extended by net.sf.jsefa.common.converter.XmlDateTimeConverter
All Implemented Interfaces:
SimpleTypeConverter

public class XmlDateTimeConverter
extends Object
implements SimpleTypeConverter

Converter for XmlDateTime objects.
The format is a single String describing the time zone, e. g. "GMT".

It is thread safe.

Author:
Norman Lahme-Huetig

Field Summary
static String DEFAULT_FORMAT
          The default format which is used when no format is explicitly given.
 
Constructor Summary
protected XmlDateTimeConverter(SimpleTypeConverterConfiguration configuration)
          Constructs a XmlDateTimeConverter.
 
Method Summary
static XmlDateTimeConverter create(SimpleTypeConverterConfiguration configuration)
          Constructs a XmlDateTimeConverter.
 Date fromString(String value)
          Converts the given String object into an object with the simple data type this converter is intended for.
protected  String getDefaultFormat()
          Returns the default format which is used when no format is given.
 String toString(Object value)
          Converts the given value to a String object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORMAT

public static final String DEFAULT_FORMAT
The default format which is used when no format is explicitly given.

See Also:
Constant Field Values
Constructor Detail

XmlDateTimeConverter

protected XmlDateTimeConverter(SimpleTypeConverterConfiguration configuration)
Constructs a XmlDateTimeConverter.
If no format is given, the default format (see getDefaultFormat()) is used.

Parameters:
configuration - the configuration
Method Detail

create

public static XmlDateTimeConverter create(SimpleTypeConverterConfiguration configuration)
Constructs a XmlDateTimeConverter.
If no format is given, the default format (see getDefaultFormat()) is used.

Parameters:
configuration - the configuration
Returns:
a xml date time converter

fromString

public final Date fromString(String value)
Converts the given String object into an object with the simple data type this converter is intended for.

Specified by:
fromString in interface SimpleTypeConverter
Parameters:
value - the String object to convert
Returns:
the converted value

toString

public final String toString(Object value)
Converts the given value to a String object.

Specified by:
toString in interface SimpleTypeConverter
Parameters:
value - the value to convert
Returns:
the converted value

getDefaultFormat

protected String getDefaultFormat()
Returns the default format which is used when no format is given.

Returns:
the default format.


Copyright © 2014. All rights reserved.