public class TextValidator extends Object
TextfieldBase
to check whether the
input content is as expected. The validator contains a pattern. The pattern
is applied to the input using the pattern attribute of the input DOM element.
When the input content changes, it is validated against the pattern. If the
input text is found to be invalid, then an error message is displayed below
the input.Constructor and Description |
---|
TextValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage() |
String |
getPattern() |
void |
setErrorMessage(String inputErrorMessage) |
void |
setPattern(String inputPattern) |
public final String getPattern()
TextfieldBase
.public final void setPattern(String inputPattern)
inputPattern
- a regular expression against which the input text is validatedpublic final String getErrorMessage()
public final void setErrorMessage(String inputErrorMessage)
inputErrorMessage
- the error message to be displayed when the input text does not
match the required patternCopyright © 2016 com.github.ilyes4j. All rights reserved.