Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.thoughtworks.xstream.converters.basic
Class BooleanConverter

    java.lang.Object
      com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
          com.thoughtworks.xstream.converters.basic.BooleanConverter

All Implemented Interfaces:
  ConverterMatcher, SingleValueConverter

    public class BooleanConverter

extends AbstractSingleValueConverter

Converts a boolean primitive or java.lang.Boolean wrapper to a String.

Author:
  Joe Walnes, David Blevins

Field Summary
`static BooleanConverter` | `BINARY`
`static BooleanConverter` | `TRUE_FALSE`
`static BooleanConverter` | `YES_NO`

Constructor Summary
`BooleanConverter()`
`BooleanConverter(String positive, String negative, boolean caseSensitive)`

Method Summary
`boolean` | `canConvert(Class type)` Determines whether the converter can marshall a particular type.
`Object` | `fromString(String str)` Unmarshals an Object from its single value representation.
`boolean` | `shouldConvert(Class type, Object value)`
`String` | `toString(Object obj)` Marshals an Object into a single value representation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRUE_FALSE

    public static final BooleanConverter TRUE_FALSE

### YES_NO

    public static final BooleanConverter YES_NO

### BINARY

    public static final BooleanConverter BINARY

Constructor Detail

### BooleanConverter

    public BooleanConverter(String positive,
                            String negative,
                            boolean caseSensitive)

### BooleanConverter

    public BooleanConverter()

Method Detail

### shouldConvert

    public boolean shouldConvert(Class type,
                                 Object value)

### canConvert

    public boolean canConvert(Class type)

  Description copied from interface: `ConverterMatcher`
  Determines whether the converter can marshall a particular type.

  Specified by:
    `canConvert` in interface `ConverterMatcher`
  Specified by:
    `canConvert` in class `AbstractSingleValueConverter`
  Parameters:
    `type` - the Class representing the object type to be converted

### fromString

    public Object fromString(String str)

  Description copied from interface: `SingleValueConverter`
  Unmarshals an Object from its single value representation.

  Specified by:
    `fromString` in interface `SingleValueConverter`
  Specified by:
    `fromString` in class `AbstractSingleValueConverter`
  Parameters:
    `str` - the String with the single value of the Object
  Returns:
    the Object

### toString

    public String toString(Object obj)

  Description copied from interface: `SingleValueConverter`
  Marshals an Object into a single value representation.

  Specified by:
    `toString` in interface `SingleValueConverter`
  Overrides:
    `toString` in class `AbstractSingleValueConverter`
  Parameters:
    `obj` - the Object to be converted
  Returns:
    a String with the single value of the Object or `null`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 XStream. All Rights Reserved.