public final class ValidationTrackerImpl extends BaseOptimizedSessionPersistedObject implements ValidationTracker, Serializable
ValidationTracker
. Works pretty hard to ensure a minimum
amount of data is stored
in the HttpSession.Constructor and Description |
---|
ValidationTrackerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all information stored by the tracker.
|
String |
getError(Field field)
Returns a previously recorded error message.
|
List<String> |
getErrors()
Returns a list of all error messages.
|
boolean |
getHasErrors()
Returns true if any field contains an error.
|
String |
getInput(Field field)
Returns a previously recorded input value.
|
List<String> |
getUnassociatedErrors()
Returns just the errors that are not associated with any fields.
|
boolean |
inError(Field field)
For a given field, determines if the field is "in error", meaning that an error message has been previously
recorded for the field.
|
void |
recordError(Field field,
String errorMessage)
Records an error message for a field.
|
void |
recordError(String errorMessage)
Records an error message that is not associated with any specific field.
|
void |
recordInput(Field field,
String input)
Called by a field to record the exact input from the user, prior to any validation.
|
checkAndResetDirtyMarker, markDirty
public ValidationTrackerImpl()
public void clear()
ValidationTracker
clear
in interface ValidationTracker
public String getError(Field field)
ValidationTracker
getError
in interface ValidationTracker
public List<String> getErrors()
ValidationTracker
getErrors
in interface ValidationTracker
public List<String> getUnassociatedErrors()
ValidationTracker
getUnassociatedErrors
in interface ValidationTracker
public boolean getHasErrors()
ValidationTracker
getHasErrors
in interface ValidationTracker
public String getInput(Field field)
ValidationTracker
getInput
in interface ValidationTracker
public boolean inError(Field field)
ValidationTracker
inError
in interface ValidationTracker
public void recordError(Field field, String errorMessage)
ValidationTracker
ValidationException
thrown by a Validator
or Translator
.recordError
in interface ValidationTracker
public void recordError(String errorMessage)
ValidationTracker
recordError
in interface ValidationTracker
public void recordInput(Field field, String input)
ValidationTracker
recordInput
in interface ValidationTracker
field
- the field recording the inputinput
- the value obtained from the forms submission5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.