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

public abstract Class AbstractSingleValueConverter

extends Object
implements SingleValueConverter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.SingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher
Known Direct Subclasses
com.thoughtworks.xstream.converters.basic.BigDecimalConverter, com.thoughtworks.xstream.converters.basic.BigIntegerConverter, com.thoughtworks.xstream.converters.basic.BooleanConverter, com.thoughtworks.xstream.converters.basic.ByteConverter, com.thoughtworks.xstream.converters.basic.DateConverter, com.thoughtworks.xstream.converters.basic.DoubleConverter, com.thoughtworks.xstream.converters.basic.FloatConverter, com.thoughtworks.xstream.converters.basic.IntConverter, com.thoughtworks.xstream.converters.basic.LongConverter, com.thoughtworks.xstream.converters.basic.ShortConverter, com.thoughtworks.xstream.converters.basic.StringBufferConverter, com.thoughtworks.xstream.converters.basic.StringBuilderConverter, com.thoughtworks.xstream.converters.basic.StringConverter, com.thoughtworks.xstream.converters.basic.URIConverter, com.thoughtworks.xstream.converters.basic.URLConverter, com.thoughtworks.xstream.converters.basic.UUIDConverter, com.thoughtworks.xstream.converters.enums.EnumSingleValueConverter, com.thoughtworks.xstream.converters.enums.EnumToStringConverter, com.thoughtworks.xstream.converters.extended.CharsetConverter, com.thoughtworks.xstream.converters.extended.CurrencyConverter, com.thoughtworks.xstream.converters.extended.DurationConverter, com.thoughtworks.xstream.converters.extended.FileConverter, com.thoughtworks.xstream.converters.extended.ISO8601DateConverter, com.thoughtworks.xstream.converters.extended.ISO8601GregorianCalendarConverter, com.thoughtworks.xstream.converters.extended.JavaClassConverter, com.thoughtworks.xstream.converters.extended.LocaleConverter, com.thoughtworks.xstream.converters.extended.PathConverter, com.thoughtworks.xstream.converters.extended.SqlDateConverter, com.thoughtworks.xstream.converters.extended.SqlTimeConverter, com.thoughtworks.xstream.converters.extended.SqlTimestampConverter, com.thoughtworks.xstream.converters.extended.StackTraceElementConverter, com.thoughtworks.xstream.converters.extended.ToStringConverter, com.thoughtworks.xstream.converters.reflection.AbstractAttributedCharacterIteratorAttributeConverter, com.thoughtworks.xstream.converters.time.AbstractChronoLocalDateConverter, com.thoughtworks.xstream.converters.time.DurationConverter, com.thoughtworks.xstream.converters.time.InstantConverter, com.thoughtworks.xstream.converters.time.JapaneseEraConverter, com.thoughtworks.xstream.converters.time.LocalDateConverter, com.thoughtworks.xstream.converters.time.MonthDayConverter, com.thoughtworks.xstream.converters.time.PeriodConverter, com.thoughtworks.xstream.converters.time.YearConverter, com.thoughtworks.xstream.converters.time.YearMonthConverter, com.thoughtworks.xstream.core.util.ISO8601JavaTimeConverter, com.thoughtworks.xstream.core.util.ISO8601JodaTimeConverter
Imports
com.thoughtworks.xstream.converters.SingleValueConverter

Base abstract implementation of com.thoughtworks.xstream.converters.SingleValueConverter.

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

Authors
Joe Walnes, Jörg Schaible, Mauro Talevi
See Also
com.thoughtworks.xstream.converters.SingleValueConverter

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Redeclares com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

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

Redeclares com.thoughtworks.xstream.converters.SingleValueConverter.fromString.

Unmarshals an Object from its single value representation.
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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractSingleValueConverterback to summary
public AbstractSingleValueConverter()

Method Detail

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

Redeclares 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 abstract Object fromString(String str)

Redeclares 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

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