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

public Class SingleValueConverterWrapper

extends Object
implements Converter, SingleValueConverter, ErrorReporter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.ErrorReporter, com.thoughtworks.xstream.converters.SingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher, com.thoughtworks.xstream.converters.Converter
Imports
com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter

Wrapper to convert a com.thoughtworks.xstream.converters.SingleValueConverter into a com.thoughtworks.xstream.converters.Converter.
Author
Jörg Schaible
See Also
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.SingleValueConverter

Field Summary

Modifier and TypeField and Description
private final SingleValueConverter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
appendErrors(ErrorWriter
the error writer
errorWriter
)

Implements com.thoughtworks.xstream.converters.ErrorReporter.appendErrors.

Append context information to an ErrorWriter.
public boolean
canConvert(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(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 void
marshal(Object
The object to be marshalled.
source
,
HierarchicalStreamWriter
A stream to write to.
writer
,
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(Object
the Object to be converted
obj
)

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

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

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

Convert textual data back into an object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

wrappedback to summary
private final SingleValueConverter wrapped

Constructor Detail

SingleValueConverterWrapperback to summary
public SingleValueConverterWrapper(SingleValueConverter wrapped)

Method Detail

appendErrorsback to summary
public void appendErrors(ErrorWriter errorWriter)

Implements com.thoughtworks.xstream.converters.ErrorReporter.appendErrors.

Doc from com.thoughtworks.xstream.converters.ErrorReporter.appendErrors.

Append context information to an ErrorWriter.

Parameters
errorWriter:ErrorWriter

the error writer

canConvertback to summary
public boolean canConvert(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

fromStringback to summary
public Object fromString(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

marshalback to summary
public void marshal(Object source, HierarchicalStreamWriter writer, 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.

toStringback to summary
public String toString(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

unmarshalback to summary
public Object unmarshal(HierarchicalStreamReader reader, 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.