Top Description Constructors Methods
com.opencsv.bean.processor

public Class ConvertEmptyOrBlankStringsToNull

extends Object
implements StringProcessor
Class Inheritance
All Implemented Interfaces
com.opencsv.bean.processor.StringProcessor

StringProcessor that converts the empty or blank strings to a literal null string. This is useful when you prefer null in a particular variable.

A sample of this can be found in the unit test ProcessorTestBean and is annotated as follows.

    @PreAssignmentProcessor(processor = ConvertEmptyOrBlankStringsToNull.class)
    @CsvBindByName(column = "name")
    private String beanName;
 
Author
Scott Conway
Since
5.4

Constructor Summary

AccessConstructor and Description
public
ConvertEmptyOrBlankStringsToNull()

Default Constructor.

Method Summary

Modifier and TypeMethod and Description
public String
processString(String value)

Implements com.opencsv.bean.processor.StringProcessor.processString.

Method that contains the code that will transform a string into the value that will be validated and converted into the bean field.

public void
setParameterString(String
Information used by the processor to process the string
value
)

Implements com.opencsv.bean.processor.StringProcessor.setParameterString.

This method is unused in this implementation as we are converting to null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConvertEmptyOrBlankStringsToNullback to summary
public ConvertEmptyOrBlankStringsToNull()

Default Constructor.

Method Detail

processStringback to summary
public String processString(String value)

Implements com.opencsv.bean.processor.StringProcessor.processString.

Doc from com.opencsv.bean.processor.StringProcessor.processString.

Method that contains the code that will transform a string into the value that will be validated and converted into the bean field.

Annotations
@Override
setParameterStringback to summary
public void setParameterString(String value)

Implements com.opencsv.bean.processor.StringProcessor.setParameterString.

This method is unused in this implementation as we are converting to null. Any calls to this method are ignored.

Parameters
value:String

Information used by the processor to process the string

Annotations
@Override