Timestamp to a string.
| Modifier and Type | Field and Description |
|---|---|
| private final ThreadSafeSimpleDateFormat |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SqlTimestampConverter(final TimeZone
the time zone used for the format timeZone)Constructs a SqlTimestampConverter. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canConvert(Class<T>
the Class representing the object type to be converted type)Implements abstract com. Implements com. |
| public Object | fromString(final String
the String with the single value of the Object str)Implements abstract com. Implements com. |
| public String | toString(final Object
the Object to be converted obj)Overrides com. Implements com. |
| format | back to summary |
|---|---|
| private final ThreadSafeSimpleDateFormat format | |
| SqlTimestampConverter | back to summary |
|---|---|
| public SqlTimestampConverter() Constructs a SqlTimestampConverter using UTC format. | |
| SqlTimestampConverter | back to summary |
|---|---|
| public SqlTimestampConverter(final TimeZone timeZone) Constructs a SqlTimestampConverter.
XStream uses by default UTC as time zone. However, if the resulting XML is used as feed for a data base (like MS
SQL) the server might expect the timestamp to be in local time and does the conversion to UTC on its own. In such
a case you can register an own instance of the SqlTimestamp converter using e.g.
| |
| canConvert | back to summary |
|---|---|
| public boolean canConvert(Class<T> type) Implements abstract com. Implements com. Doc from com. Determines whether the converter can marshall a particular type.
| |
| fromString | back to summary |
|---|---|
| public Object fromString(final String str) Implements abstract com. Implements com. Doc from com. Unmarshals an Object from its single value representation. | |
| toString | back to summary |
|---|---|
| public String toString(final Object obj) Overrides com. Implements com. Doc from com. Marshals an Object into a single value representation. | |