com.jgoodies.binding.value
Class ConverterFactory.BooleanToStringConverter

java.lang.Object
  extended by com.jgoodies.binding.value.ConverterFactory.BooleanToStringConverter
All Implemented Interfaces:
BindingConverter<Boolean,String>
Enclosing class:
ConverterFactory

public static final class ConverterFactory.BooleanToStringConverter
extends Object
implements BindingConverter<Boolean,String>

Converts Booleans to Strings and vice-versa using given texts for true, false, and null.


Method Summary
 Boolean sourceValue(String targetValue)
          Converts the given String and sets the associated Boolean as the subject's new value.
 String targetValue(Boolean sourceValue)
          Returns the source value's associated text representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

targetValue

public String targetValue(Boolean sourceValue)
Returns the source value's associated text representation.

Specified by:
targetValue in interface BindingConverter<Boolean,String>
Parameters:
sourceValue - the value to convert
Returns:
the converted value

sourceValue

public Boolean sourceValue(String targetValue)
Converts the given String and sets the associated Boolean as the subject's new value. In case the new value equals neither this class' trueText, nor the falseText, nor the nullText, an IllegalArgumentException is thrown.

Specified by:
sourceValue in interface BindingConverter<Boolean,String>
Parameters:
targetValue - the value to convert
Returns:
the converted value
Throws:
IllegalArgumentException - if the new value does neither match the trueText nor the falseText nor the nullText


Copyright © 2002-2013 JGoodies Software GmbH. All Rights Reserved.