org.scopemvc.util.convertor
Interface StringConvertor

All Known Implementing Classes:
NullStringConvertor

public interface StringConvertor

Specifies contract for all classes converting object values to String representation and back from String into object instances. Convertors should be based on Locale.

Default StringConvertors can be obtained with class StringConvertors .

Version:
$Revision: 1.4 $ $Date: 2002/09/05 15:41:47 $
Author:
Daniel Michalik
See Also:
StringConvertors

Method Summary
 java.lang.Object stringAsValue(java.lang.String inString)
          Parses String to produce corresponding object.
 java.lang.String valueAsString(java.lang.Object inValue)
          Formats object into String.
 

Method Detail

valueAsString

public java.lang.String valueAsString(java.lang.Object inValue)
                               throws java.lang.IllegalArgumentException
Formats object into String. It never return a null. Implementing class can offer posibility to set string representation of null (such as "null" or ""), however default representation should be "". Slightly different null handling is performed in StringStringConvertor class.

Parameters:
inValue - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value
Throws:
java.lang.IllegalArgumentException - this convertor can't express the value as String.

stringAsValue

public java.lang.Object stringAsValue(java.lang.String inString)
                               throws java.lang.IllegalArgumentException
Parses String to produce corresponding object. Empty or null string will be typically converted into null (unlike standard java.text formats which throws exceptions in such situations).

Parameters:
inString - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value
Throws:
java.lang.IllegalArgumentException - can't convert from String.


Copyright © 2000-2002 The Scope Team. All Rights Reserved.