Top Description Fields Constructors Methods
com.thoughtworks.xstream.converters.time

public Class ZonedDateTimeConverter

extends Object
implements SingleValueConverter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.SingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher
Imports
java.time.ZonedDateTime, java.time.format.DateTimeFormatter, .DateTimeFormatterBuilder, .DateTimeParseException, java.time.temporal.ChronoField, com.thoughtworks.xstream.converters.ConversionException, .SingleValueConverter

Converts a ZonedDateTime to a string.
Author
Matej Cimbora
Since
1.4.10

Field Summary

Modifier and TypeField and Description
private static final DateTimeFormatter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canConvert(final Class<T>
the Class representing the object type to be converted
type
)

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.
public Object
fromString(final String
the String with the single value of the Object
str
)

Implements com.thoughtworks.xstream.converters.SingleValueConverter.fromString.

Unmarshals an Object from its single value representation.
public String
toString(final Object
the Object to be converted
obj
)

Implements com.thoughtworks.xstream.converters.SingleValueConverter.toString.

Marshals an Object into a single value representation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FORMATTERback to summary
private static final DateTimeFormatter FORMATTER

Constructor Detail

ZonedDateTimeConverterback to summary
public ZonedDateTimeConverter()

Method Detail

canConvertback to summary
public boolean canConvert(final Class<T> type)

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Doc from com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.

Parameters
type:Class<T>

the Class representing the object type to be converted

Annotations
@Override
fromStringback to summary
public Object fromString(final String str)

Implements com.thoughtworks.xstream.converters.SingleValueConverter.fromString.

Doc from com.thoughtworks.xstream.converters.SingleValueConverter.fromString.

Unmarshals an Object from its single value representation.

Parameters
str:String

the String with the single value of the Object

Returns:Object

the Object

Annotations
@Override
toStringback to summary
public String toString(final Object obj)

Implements com.thoughtworks.xstream.converters.SingleValueConverter.toString.

Doc from com.thoughtworks.xstream.converters.SingleValueConverter.toString.

Marshals an Object into a single value representation.

Parameters
obj:Object

the Object to be converted

Returns:String

a String with the single value of the Object or null

Annotations
@Override