org.realityforge.converter.lib
Class StringToBooleanConverter

java.lang.Object
  |
  +--org.realityforge.converter.AbstractConverter
        |
        +--org.realityforge.converter.lib.StringToBooleanConverter
All Implemented Interfaces:
Converter

public class StringToBooleanConverter
extends AbstractConverter

String to Boolean converter

Version:
$Revision: 1.4 $ $Date: 2003/03/25 02:51:26 $
Author:
Peter Donald

Field Summary
 
Fields inherited from interface org.realityforge.converter.Converter
ROLE
 
Constructor Summary
StringToBooleanConverter()
          Construct the converter.
StringToBooleanConverter(Boolean defaultValue)
          Construct the converter with a default value.
 
Method Summary
 Object convert(Object object, Object context)
          Converts a String to a Boolean.
 
Methods inherited from class org.realityforge.converter.AbstractConverter
convert, noConvert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringToBooleanConverter

public StringToBooleanConverter()
Construct the converter.


StringToBooleanConverter

public StringToBooleanConverter(Boolean defaultValue)
Construct the converter with a default value. If the default value is non-null, it will be returned if unable to convert object to correct type.

Parameters:
defaultValue - the default value
Method Detail

convert

public Object convert(Object object,
                      Object context)
               throws ConverterException
Converts a String to a Boolean.

Specified by:
convert in class AbstractConverter
Parameters:
object - the original object to convert
context - the context in which to convert object (unused)
Returns:
the converted object
Throws:
ConverterException - if error converting object


Copyright © 2000-2003 The Spice Group. All Rights Reserved.