Class ValidatedConversion
java.lang.Object
com.univocity.parsers.conversions.ValidatedConversion
- All Implemented Interfaces:
Conversion<Object,
Object>
Performs one or more validations against the values of a given record.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionValidatedConversion
(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) -
Method Summary
-
Field Details
-
regexToMatch
-
nullable
private final boolean nullable -
allowBlanks
private final boolean allowBlanks -
oneOf
-
noneOf
-
matcher
-
validators
-
-
Constructor Details
-
ValidatedConversion
public ValidatedConversion() -
ValidatedConversion
-
ValidatedConversion
public ValidatedConversion(boolean nullable, boolean allowBlanks) -
ValidatedConversion
-
ValidatedConversion
-
-
Method Details
-
instantiateValidators
-
execute
Description copied from interface:Conversion
Converts a value of type I to a value of type O. When used in conjunction with theConvert
annotation, this method will perform the conversion from a parsed inputString
(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 I- Specified by:
execute
in interfaceConversion<Object,
Object> - Parameters:
input
- the input of type I to be converted to an object of type O- Returns:
- the conversion result.
-
revert
Description copied from interface:Conversion
Converts a value of type O to a value of type I. When used in conjunction with theConvert
annotation, this method will convert the value of the annotated field so it can be written to the output (usually aString
). Note that conversions can be chained so you need to make sure the type of any previous conversion is compatible with O- Specified by:
revert
in interfaceConversion<Object,
Object> - Parameters:
input
- the input of type O to be converted to an object of type I- Returns:
- the conversion result.
-
validate
-