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

public Class DurationConverter

extends AbstractSingleValueConverter
Class Inheritance
Imports
com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter, javax.xml.datatype.DatatypeConfigurationException, .DatatypeFactory, .Duration

A Converter for the XML Schema datatype duration and the Java type Duration. The implementation uses a DatatypeFactory to create Duration objects. If no factory is provided and the instantiation of the internal factory fails with a DatatypeConfigurationException, the converter will not claim the responsibility for Duration objects.
Authors
John Kristian, Jörg Schaible
Since
1.3

Field Summary

Modifier and TypeField and Description
private final DatatypeFactory

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

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

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.canConvert.

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

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

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.fromString.

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

Unmarshals an Object from its single value representation.
Inherited from com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter:
toString

Field Detail

factoryback to summary
private final DatatypeFactory factory

Constructor Detail

DurationConverterback to summary
public DurationConverter()
DurationConverterback to summary
public DurationConverter(DatatypeFactory factory)

Method Detail

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

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.canConvert.

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

fromStringback to summary
public Object fromString(String s)

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.fromString.

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

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

Unmarshals an Object from its single value representation.

Parameters
s:String

the String with the single value of the Object

Returns:Object

the Object