public abstract class

AbstractSingleValueConverter

extends Object
implements SingleValueConverter
java.lang.Object
   ↳ com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Base abstract implementation of SingleValueConverter.

Subclasses should implement methods canConvert(Class) and fromString(String) for the conversion.

Summary

Public Constructors
AbstractSingleValueConverter()
Public Methods
abstract boolean canConvert(Class type)
Determines whether the converter can marshall a particular type.
abstract Object fromString(String str)
Unmarshals an Object from its single value representation.
String toString(Object obj)
Marshals an Object into a single value representation.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.thoughtworks.xstream.converters.ConverterMatcher
From interface com.thoughtworks.xstream.converters.SingleValueConverter

Public Constructors

public AbstractSingleValueConverter ()

Public Methods

public abstract boolean canConvert (Class type)

Determines whether the converter can marshall a particular type.

Parameters
type the Class representing the object type to be converted

public abstract Object fromString (String str)

Unmarshals an Object from its single value representation.

Parameters
str the String with the single value of the Object
Returns
  • the Object

public String toString (Object obj)

Marshals an Object into a single value representation.

Parameters
obj the Object to be converted
Returns
  • a String with the single value of the Object or null