public class ValidatedConversion extends Object implements Conversion<Object,Object>
Constructor and Description |
---|
ValidatedConversion() |
ValidatedConversion(boolean nullable,
boolean allowBlanks) |
ValidatedConversion(boolean nullable,
boolean allowBlanks,
String[] oneOf,
String[] noneOf,
String regexToMatch) |
ValidatedConversion(boolean nullable,
boolean allowBlanks,
String[] oneOf,
String[] noneOf,
String regexToMatch,
Class[] validators) |
ValidatedConversion(String regexToMatch) |
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object input)
Converts a value of type I to a value of type O.
|
Object |
revert(Object input)
Converts a value of type O to a value of type I.
|
protected void |
validate(Object value) |
public ValidatedConversion()
public ValidatedConversion(String regexToMatch)
public ValidatedConversion(boolean nullable, boolean allowBlanks)
public ValidatedConversion(boolean nullable, boolean allowBlanks, String[] oneOf, String[] noneOf, String regexToMatch)
public Object execute(Object input)
Conversion
Convert
annotation, this method will perform
the conversion from a parsed input String
(if no other conversion has been applied before)
to a value of the desired type, and the result will be assigned to the annotated field. Note that conversions can be
chained so you need to make sure the input type of any previous conversion is compatible with Iexecute
in interface Conversion<Object,Object>
input
- the input of type I to be converted to an object of type Opublic Object revert(Object input)
Conversion
Convert
annotation, this method will
convert the value of the annotated field so it can be written to the output (usually a String
). Note that conversions can be
chained so you need to make sure the type of any previous conversion is compatible with Orevert
in interface Conversion<Object,Object>
input
- the input of type O to be converted to an object of type Iprotected void validate(Object value)
Copyright © 2022 Univocity Software Pty Ltd. All rights reserved.