Class OtpFieldI18n
java.lang.Object
com.flowingcode.vaadin.addons.otpfield.OtpFieldI18n
- All Implemented Interfaces:
Serializable
The internationalization properties of an
OtpField: the error messages of its three
built-in constraints.
All three messages have an English default, so an unconfigured field never shows an empty error.
Note that an error message set with HasValidationProperties.setErrorMessage(String) takes priority over
these messages.
- Since:
- 1.0.0
- Author:
- Flowing Code
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the error message displayed when the code is non-empty but shorter than the length of the field.Gets the error message displayed when the code is longer than the length of the field, or contains characters the field does not accept.Gets the error message displayed when the field is required but empty.setIncompleteErrorMessage(String errorMessage) Sets the error message to display when the code is non-empty but shorter than the length of the field.setInvalidErrorMessage(String errorMessage) Sets the error message to display when the code is longer than the length of the field, or contains characters the field does not accept.setRequiredErrorMessage(String errorMessage) Sets the error message to display when the field is required but empty.
-
Constructor Details
-
OtpFieldI18n
public OtpFieldI18n()
-
-
Method Details
-
getRequiredErrorMessage
Gets the error message displayed when the field is required but empty.- Returns:
- the error message, or
nullif it was cleared - See Also:
-
setRequiredErrorMessage
Sets the error message to display when the field is required but empty.- Parameters:
errorMessage- the error message, ornullto clear it- Returns:
- this instance, for method chaining
- See Also:
-
getIncompleteErrorMessage
Gets the error message displayed when the code is non-empty but shorter than the length of the field.- Returns:
- the error message, or
nullif it was cleared - See Also:
-
setIncompleteErrorMessage
Sets the error message to display when the code is non-empty but shorter than the length of the field.- Parameters:
errorMessage- the error message, ornullto clear it- Returns:
- this instance, for method chaining
- See Also:
-
getInvalidErrorMessage
Gets the error message displayed when the code is longer than the length of the field, or contains characters the field does not accept.- Returns:
- the error message, or
nullif it was cleared - See Also:
-
setInvalidErrorMessage
Sets the error message to display when the code is longer than the length of the field, or contains characters the field does not accept.A user cannot enter such a value, so this message reports a value that was set programmatically, typically a stored code that no longer fits the configuration of the field.
- Parameters:
errorMessage- the error message, ornullto clear it- Returns:
- this instance, for method chaining
- See Also:
-