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

public Class OptionalDoubleConverter

extends DoubleConverter
implements Converter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Imports
java.util.OptionalDouble, com.thoughtworks.xstream.converters.Converter, .MarshallingContext, .UnmarshallingContext, com.thoughtworks.xstream.converters.basic.DoubleConverter, com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter

Converts an AtomicReference type.
Since
1.4.20

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
)

Overrides com.thoughtworks.xstream.converters.basic.DoubleConverter.canConvert.

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
)

Overrides com.thoughtworks.xstream.converters.basic.DoubleConverter.fromString.

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

Unmarshals an Object from its single value representation.
public void
marshal(final Object
The object to be marshalled.
source
,
final HierarchicalStreamWriter
A stream to write to.
writer
,
final MarshallingContext
A context that allows nested objects to be processed by XStream.
context
)

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.
public String
toString(final Object
the Object to be converted
obj
)

Overrides com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.toString.

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

Marshals an Object into a single value representation.
public Object
unmarshal(final HierarchicalStreamReader
The stream to read the text from.
reader
,
final UnmarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.

Constructor Detail

OptionalDoubleConverterback to summary
public OptionalDoubleConverter()

Method Detail

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

Overrides com.thoughtworks.xstream.converters.basic.DoubleConverter.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

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

Overrides com.thoughtworks.xstream.converters.basic.DoubleConverter.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
str:String

the String with the single value of the Object

Returns:Object

the Object

Annotations
@Override
marshalback to summary
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Doc from com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.

Parameters
source:Object

The object to be marshalled.

writer:HierarchicalStreamWriter

A stream to write to.

context:MarshallingContext

A context that allows nested objects to be processed by XStream.

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

Overrides com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.toString.

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
unmarshalback to summary
public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Doc from com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.

Parameters
reader:HierarchicalStreamReader

The stream to read the text from.

Returns:Object

The resulting object.

Annotations
@Override