org.springframework.binding.convert.converters
Class StringToBoolean
java.lang.Object
org.springframework.binding.convert.converters.StringToObject
org.springframework.binding.convert.converters.StringToBoolean
- All Implemented Interfaces:
- Converter, TwoWayConverter
public class StringToBoolean
- extends StringToObject
Converts a textual representation of a boolean object to a Boolean
instance.
- Author:
- Keith Donald
Constructor Summary |
StringToBoolean()
Create a text boolean converter that parses standard true and false strings. |
StringToBoolean(java.lang.String trueString,
java.lang.String falseString)
Create a text to boolean converter that takes specific string representations of true and false into account. |
Method Summary |
protected java.lang.Object |
toObject(java.lang.String string,
java.lang.Class<?> targetClass)
|
protected java.lang.String |
toString(java.lang.Object object)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringToBoolean
public StringToBoolean()
- Create a text boolean converter that parses standard true and false strings.
StringToBoolean
public StringToBoolean(java.lang.String trueString,
java.lang.String falseString)
- Create a text to boolean converter that takes specific string representations of true and false into account.
- Parameters:
trueString
- special true string to usefalseString
- special false string to use
toObject
protected java.lang.Object toObject(java.lang.String string,
java.lang.Class<?> targetClass)
throws java.lang.Exception
- Specified by:
toObject
in class StringToObject
- Throws:
java.lang.Exception
toString
protected java.lang.String toString(java.lang.Object object)
throws java.lang.Exception
- Specified by:
toString
in class StringToObject
- Throws:
java.lang.Exception