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()
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 submissionprotected ValidationTracker getDelegate()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.