com.jgoodies.binding.value
Class ConverterFactory.StringConverter

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

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

Converts Values to Strings and vice-versa using a given Format.


Method Summary
 Object sourceValue(String targetValue)
          Parses the given String encoding and returns the parsed object.
 String targetValue(Object sourceValue)
          Formats the source value and returns a String 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(Object sourceValue)
Formats the source value and returns a String representation.

Specified by:
targetValue in interface BindingConverter<Object,String>
Parameters:
sourceValue - the source value
Returns:
the formatted sourceValue

sourceValue

public Object sourceValue(String targetValue)
Parses the given String encoding and returns the parsed object. ParseExceptions are re-thrown as IllegalArgumentException.

Specified by:
sourceValue in interface BindingConverter<Object,String>
Parameters:
targetValue - the value to be converted and set as new subject value
Returns:
the converted value


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