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

public Class PropertyEditorCapableConverter

extends Object
implements SingleValueConverter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.SingleValueConverter, com.thoughtworks.xstream.converters.ConverterMatcher
Imports
com.thoughtworks.xstream.converters.SingleValueConverter, com.thoughtworks.xstream.core.util.ThreadSafePropertyEditor, java.beans.PropertyEditor

A SingleValueConverter that can utilize a PropertyEditor implementation used for a specific type. The converter ensures that the editors can be used concurrently.
Authors
Jukka Lindström, Jörg Schaible
Since
1.3

Field Summary

Modifier and TypeField and Description
private final ThreadSafePropertyEditor
private final Class<T>

Constructor Summary

AccessConstructor and Description
public
PropertyEditorCapableConverter(final Class<T> propertyEditorType, final Class<T> type)

Method Summary

Modifier and TypeMethod and Description
public boolean
canConvert(final 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(final 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 String
toString(final 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

Field Detail

editorback to summary
private final ThreadSafePropertyEditor editor
typeback to summary
private final Class<T> type

Constructor Detail

PropertyEditorCapableConverterback to summary
public PropertyEditorCapableConverter(final Class<T> propertyEditorType, final Class<T> type)

Method Detail

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

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