public class ValidationTrackerWrapper extends Object implements ValidationTracker
ValidationTracker that delegates all methods to the wrapped instance.
Subclasses will often override specific methods.| Constructor and Description |
|---|
ValidationTrackerWrapper(ValidationTracker delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all information stored by the tracker.
|
protected ValidationTracker |
getDelegate()
Returns the instance to which methods are delegated.
|
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.
|
public ValidationTrackerWrapper(ValidationTracker delegate)
public void clear()
ValidationTrackerclear in interface ValidationTrackerpublic String getError(Field field)
ValidationTrackergetError in interface ValidationTrackerpublic List<String> getErrors()
ValidationTrackergetErrors in interface ValidationTrackerpublic List<String> getUnassociatedErrors()
ValidationTrackergetUnassociatedErrors in interface ValidationTrackerpublic boolean getHasErrors()
ValidationTrackergetHasErrors in interface ValidationTrackerpublic String getInput(Field field)
ValidationTrackergetInput in interface ValidationTrackerpublic boolean inError(Field field)
ValidationTrackerinError in interface ValidationTrackerpublic void recordError(Field field, String errorMessage)
ValidationTrackerValidationException
thrown by a Validator or Translator.recordError in interface ValidationTrackerpublic void recordError(String errorMessage)
ValidationTrackerrecordError in interface ValidationTrackerpublic void recordInput(Field field, String input)
ValidationTrackerrecordInput in interface ValidationTrackerfield - the field recording the inputinput - the value obtained from the forms submissionprotected ValidationTracker getDelegate()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.