org.apache.tapestry.coerce
Class StringToBooleanConverter

java.lang.Object
  extended by org.apache.tapestry.coerce.StringToBooleanConverter
All Implemented Interfaces:
TypeConverter

public final class StringToBooleanConverter
extends Object
implements TypeConverter

Converts a String to a Boolean. Strings that do contain non-whitespace are considered true. As a special case, the string "false" evaluates to false (this allow boolean component parameters to be bound to "false" instead of "ognl:false" and still operate as expected).

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
StringToBooleanConverter()
           
 
Method Summary
 Object convertValue(Object value)
          Converts the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringToBooleanConverter

public StringToBooleanConverter()
Method Detail

convertValue

public Object convertValue(Object value)
Description copied from interface: TypeConverter
Converts the value.

Specified by:
convertValue in interface TypeConverter
Parameters:
value - the value to be converted (which may be null)
Returns:
the value converted to a specific type; different implementations of TypeConverter will return different types.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.