org.sape.carbon.core.config.type.handlers
Class BooleanTypeHandler

java.lang.Object
  |
  +--org.sape.carbon.core.config.type.handlers.BooleanTypeHandler
All Implemented Interfaces:
ConfigurationTypeHandler

public class BooleanTypeHandler
extends Object
implements ConfigurationTypeHandler

Parses and formats between Strings and Booleans.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.11 $($Author: dvoet $ / $Date: 2003/05/05 21:21:20 $)
Author:
Greg Hinkle, January 2002

Constructor Summary
BooleanTypeHandler()
           
 
Method Summary
 Object toObject(Class type, String stringValue)
          Parses a string into a Boolean object.
 String toString(Object objectValue)
          Formats an Boolean into a String value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanTypeHandler

public BooleanTypeHandler()
Method Detail

toObject

public Object toObject(Class type,
                       String stringValue)
                throws TypeConversionException

Parses a string into a Boolean object.

Specified by:
toObject in interface ConfigurationTypeHandler
Parameters:
stringValue - the String representation of the requested Boolean
type - the type of object being converted
Returns:
the Boolean object
Throws:
TypeConversionException - when the string does not represent a valid Boolean

toString

public String toString(Object objectValue)

Formats an Boolean into a String value.

Specified by:
toString in interface ConfigurationTypeHandler
Parameters:
objectValue - the Boolean to be formatted
Returns:
String representation of the object
Throws:
ClassCastException - when past an object other than a Boolean


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.