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

public Class BooleanConverter

extends AbstractSingleValueConverter
Class Inheritance
Known Direct Subclasses
com.thoughtworks.xstream.converters.extended.AtomicBooleanConverter

Converts a boolean primitive or java.lang.Boolean wrapper to a String.
Authors
Joe Walnes, David Blevins

Field Summary

Modifier and TypeField and Description
public static final BooleanConverter
private final boolean
private final String
private final String
public static final BooleanConverter
public static final BooleanConverter

Constructor Summary

AccessConstructor and Description
public
BooleanConverter(final String positive, final String negative, final boolean caseSensitive)

public

Method Summary

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

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.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
)

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.fromString.

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

Unmarshals an Object from its single value representation.
public boolean
shouldConvert(final Class<T> type, final Object value)

Deprecated As of 1.4.8 use canConvert(Class)
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.

Field Detail

BINARYback to summary
public static final BooleanConverter BINARY
caseSensitiveback to summary
private final boolean caseSensitive
negativeback to summary
private final String negative
positiveback to summary
private final String positive
TRUE_FALSEback to summary
public static final BooleanConverter TRUE_FALSE
YES_NOback to summary
public static final BooleanConverter YES_NO

Constructor Detail

BooleanConverterback to summary
public BooleanConverter(final String positive, final String negative, final boolean caseSensitive)
BooleanConverterback to summary
public BooleanConverter()

Method Detail

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

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.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

fromStringback to summary
public Object fromString(final String str)

Implements abstract com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter.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

shouldConvertback to summary
public boolean shouldConvert(final Class<T> type, final Object value)

Deprecated

As of 1.4.8 use canConvert(Class)

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