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)
StringProcessor
processString
in interface StringProcessor
value
- String
to be processedString
public void setParameterString(String value)
setParameterString
in interface StringProcessor
value
- Information used by the processor to process the stringCopyright © 2005–2023. All rights reserved.