net.sf.oness.common.webapp.controller.util
Class NonEmptyStringConverter

java.lang.Object
  extended bynet.sf.oness.common.webapp.controller.util.NonEmptyStringConverter
All Implemented Interfaces:
org.apache.commons.beanutils.Converter

public class NonEmptyStringConverter
extends java.lang.Object
implements org.apache.commons.beanutils.Converter

Converter that transforms empty strings in a null value and delegates to another converter otherwise.

Version:
$Revision: 1.1 $
Author:
Carlos Sanchez

Constructor Summary
NonEmptyStringConverter(org.apache.commons.beanutils.Converter converter)
           
 
Method Summary
 java.lang.Object convert(java.lang.Class type, java.lang.Object value)
          If the value is an empty String then null is returned, else the call is delegated to the converter specified at creation.
static void deregister()
          Deregister this converter in ConvertUtils and reset old converters.
static void register()
          Register this converter in ConvertUtils using previous registered converter as delegated, for the following classes: String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonEmptyStringConverter

public NonEmptyStringConverter(org.apache.commons.beanutils.Converter converter)
Parameters:
converter - Delegate converter
Method Detail

register

public static void register()
Register this converter in ConvertUtils using previous registered converter as delegated, for the following classes:


deregister

public static void deregister()
Deregister this converter in ConvertUtils and reset old converters.


convert

public java.lang.Object convert(java.lang.Class type,
                                java.lang.Object value)
If the value is an empty String then null is returned, else the call is delegated to the converter specified at creation.

Specified by:
convert in interface org.apache.commons.beanutils.Converter
See Also:
Converter.convert(java.lang.Class, java.lang.Object)


Copyright © 2003-2005 ONess Project. All Rights Reserved.