org.scopemvc.util.convertor
Class StringStringConvertor

java.lang.Object
  |
  +--org.scopemvc.util.convertor.NullStringConvertor
        |
        +--org.scopemvc.util.convertor.StringStringConvertor
All Implemented Interfaces:
StringConvertor

public final class StringStringConvertor
extends NullStringConvertor

String convertor for type java.lang.String. The main sense of the class is to correctly handle null value. Useful results can be obtained if null representation is set for example to "(null)" or "N/A" - this strings are then parsed into null value.

Version:
$Revision: 1.3 $ $Date: 2002/09/05 15:41:47 $
Author:
Daniel Michalik

Constructor Summary
StringStringConvertor()
           
 
Method Summary
 java.lang.Object stringAsValue(java.lang.String inString)
          Parses String to String.
 java.lang.String valueAsString(java.lang.Object inValue)
          Converts String to String.
 
Methods inherited from class org.scopemvc.util.convertor.NullStringConvertor
getNullAsString, isNull, setNullAsString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringStringConvertor

public StringStringConvertor()
Method Detail

valueAsString

public java.lang.String valueAsString(java.lang.Object inValue)
                               throws java.lang.IllegalArgumentException
Converts String to String. Handling of null value: it is converted into getNullAsString() which is default empty String.

Parameters:
inValue - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value
Throws:
java.lang.IllegalArgumentException - if passed value is not instance of String

stringAsValue

public java.lang.Object stringAsValue(java.lang.String inString)
                               throws java.lang.IllegalArgumentException
Parses String to String. If passed String is non-null and non-empty, the same instance is returned. Handling of null value is based on the following sequence of conditions:
  1. for empty input string also empty String is returned.
  2. for input equal to value of getNullAsString() null is returned.

Parameters:
inString - TODO: Describe the Parameter
Returns:
passed input string or null.
Throws:
java.lang.IllegalArgumentException - if passed value is not instance of String


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