Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.util.convertor
Class StringStringConvertor  view StringStringConvertor download StringStringConvertor.java

java.lang.Object
  extended byorg.scopemvc.util.convertor.NullStringConvertor
      extended byorg.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.2 $ $Date: 2002/01/12 09:35:41 $

Field Summary
 
Fields inherited from class org.scopemvc.util.convertor.NullStringConvertor
 
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() 55 which is default empty 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() 55 null is returned.