org.jdesktop.swing.data
Class Converters.DateConverter
java.lang.Object
org.jdesktop.swing.data.Converters.DateConverter
- All Implemented Interfaces:
- Converter
- Enclosing class:
- Converters
- public static class Converters.DateConverter
- extends Object
- implements Converter
Converter for java.util.Date.
The format parameter must be either an instance of
DateFormat or null. If null is
specified, the converter will use the default SimpleDateFormat
object, whose format defaults to "EEE MMM dd hh:mm:ss z yyyy".
- See Also:
DateFormat,
SimpleDateFormat
|
Method Summary |
Object |
decode(String value,
Object format)
Converts the specified String value to an object that is an
instance of the class associated with this converter instance. |
String |
encode(Object value,
Object format)
Converts the specified Object value to a string representation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Converters.DateConverter
public Converters.DateConverter()
Converters.DateConverter
public Converters.DateConverter(DateFormat defaultInputFormat,
DateFormat defaultOutputFormat)
encode
public String encode(Object value,
Object format)
throws ConversionException
- Description copied from interface:
Converter
- Converts the specified Object value to a string representation.
The value must be an instance of the class associated with
this converter, else an exception will be thrown.
- Specified by:
encode in interface Converter
- Parameters:
value - the object to be convertedformat - object containing string format information, or null
if format information is either not relevant or unspecified
- Returns:
- String containing the converted string representation of the
value
- Throws:
ConversionException - if the conversion could not be performed
decode
public Object decode(String value,
Object format)
throws ConversionException
- Description copied from interface:
Converter
- Converts the specified String value to an object that is an
instance of the class associated with this converter instance.
- Specified by:
decode in interface Converter
- Parameters:
value - String object to be convertedformat - object containing string format information, or null
if format information is either not relevant or unspecified
- Returns:
- Object which contains the converted value as an instance of
the class associated with this converter
- Throws:
ConversionException - if the conversion could not be performed
Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.