public class ConvertWordNullToNull extends Object implements StringProcessor
A sample of this can be found in the Integration tests FR138MockBean and is annotated as follows.
@PreAssignmentProcessor(processor = ConvertWordNullToNull.class)
private int num;
Without the annotation an CSVMalformedException is thrown when trying to conver the string "null" to an int.
But with it is considered a null String and the int gets a default value of 0.| Constructor and Description |
|---|
ConvertWordNullToNull()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
processString(String value)
Method that contains the code that will transform a string into the
value that will be validated and converted into the bean field.
|
void |
setParameterString(String value)
This method is unused in this implementation as we are converting to null.
|
public String processString(String value)
StringProcessorprocessString in interface StringProcessorvalue - String to be processedStringpublic void setParameterString(String value)
setParameterString in interface StringProcessorvalue - Information used by the processor to process the stringCopyright © 2005–2025. All rights reserved.