public abstract class AbstractValidator extends Object
Modifier and Type | Field and Description |
---|---|
private String |
errorMessage |
private String |
fix |
Constructor and Description |
---|
AbstractValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage()
Replies the error message.
|
String |
getFix()
Replies the fixed value, if any.
|
abstract boolean |
isValid(String value)
Tests validity of a given value.
|
protected void |
setErrorMessage(String errorMessage)
Sets the error message.
|
protected void |
setFix(String fix)
Sets the fixed value.
|
private String errorMessage
public AbstractValidator()
public abstract boolean isValid(String value)
value
- Value to testtrue
if value is valid, false
otherwisepublic final String getErrorMessage()
protected final void setErrorMessage(String errorMessage)
errorMessage
- the errorMessagepublic final String getFix()
null