Marks a property as "normalized", performing different value normalization operations before making an assignment.
Javadoc Ref :
@Normalized
Input Types 1 |
String |
Output Types |
String |
1Automatic conversion will take place if the provided input does not match any of the input classes, as described in the conversions part of the manual.
transform |
Specifies the type of transformation to use before assigning the value. Can be any of:
|
trim |
Specifies how to process leading and trailing spaces of the value. Can be any of:
|
whitespace |
Specifies how to process whitespaces present in the value. Can be any of:
|
pad |
Specifies how to pad the value. Default is no padding. Can be any of:
|
padChar |
Specifies which character to use when padding the value. Default is '0' |
padLength |
Specifies the length of the field into which to apply the padding. Default is 0 |
convertNull |
If set to true, allows nulls to be converted into a base value before assignment or before feeding the result to the next step. The resulting value depends on what type expects the next step:
|
defaultValue |
If set to something different than the default (the empty string), specifies a default value that is used whenever a null value is received. The resulting value depends on what type expects the next step. |
search |
Array of regular expressions to be located within the data for replacement. Earch array member is searched for within the data, and if found it is replaced by the corresponding (by index position) string of the replace attribute (Available since v1.1) |
replace |
Array of regular expressions to be used for replacement when the corresponding (by position) search expression is found (Available since v1.1) |
@Normalized(
pad=PadType.RIGHT,
padChar='0',
padLength=10,
search={"-|."},
replace={""},
)
private String someField;