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.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | processString(String value)
Implements com. 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. This method is unused in this implementation as we are converting to null. |
| ConvertWordNullToNull | back to summary |
|---|---|
| public ConvertWordNullToNull() Default Constructor. | |
| processString | back to summary |
|---|---|
| public String processString(String value) Implements com. Doc from com. Method that contains the code that will transform a string into the value that will be validated and converted into the bean field.
| |
| setParameterString | back to summary |
|---|---|
| public void setParameterString(String value) Implements com. This method is unused in this implementation as we are converting to null. Any calls to this method are ignored. | |