Package org.apache.tapestry5
Class ValidationTrackerWrapper
java.lang.Object
org.apache.tapestry5.ValidationTrackerWrapper
- All Implemented Interfaces:
ValidationTracker
Wrapper around a
ValidationTracker
that delegates all methods to the wrapped instance.
Subclasses will often override specific methods.- Since:
- 5.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all information stored by the tracker.protected ValidationTracker
Returns the instance to which methods are delegated.Returns a previously recorded error message.Returns a list of all error messages.boolean
Returns true if any field contains an error.Returns a previously recorded input value.Returns just the errors that are not associated with any fields.boolean
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
(String errorMessage) Records an error message that is not associated with any specific field.void
recordError
(Field field, String errorMessage) Records an error message for a field.void
recordInput
(Field field, String input) Called by a field to record the exact input from the user, prior to any validation.
-
Constructor Details
-
ValidationTrackerWrapper
-
-
Method Details
-
clear
Description copied from interface:ValidationTracker
Clears all information stored by the tracker.- Specified by:
clear
in interfaceValidationTracker
-
getError
Description copied from interface:ValidationTracker
Returns a previously recorded error message.- Specified by:
getError
in interfaceValidationTracker
-
getErrors
Description copied from interface:ValidationTracker
Returns a list of all error messages. The messages are stored in the order that they were added to the tracker, except that unassociated errors (unassociated with any field) are listed first.- Specified by:
getErrors
in interfaceValidationTracker
-
getUnassociatedErrors
Description copied from interface:ValidationTracker
Returns just the errors that are not associated with any fields.- Specified by:
getUnassociatedErrors
in interfaceValidationTracker
-
getHasErrors
Description copied from interface:ValidationTracker
Returns true if any field contains an error.- Specified by:
getHasErrors
in interfaceValidationTracker
-
getInput
Description copied from interface:ValidationTracker
Returns a previously recorded input value.- Specified by:
getInput
in interfaceValidationTracker
-
inError
Description copied from interface:ValidationTracker
For a given field, determines if the field is "in error", meaning that an error message has been previously recorded for the field.- Specified by:
inError
in interfaceValidationTracker
- Returns:
- true if an error message is present
-
recordError
Description copied from interface:ValidationTracker
Records an error message for a field. The error message is primarily derived from aValidationException
thrown by aValidator
orTranslator
.- Specified by:
recordError
in interfaceValidationTracker
-
recordError
Description copied from interface:ValidationTracker
Records an error message that is not associated with any specific field. This often reflects some amount of cross-form validation.- Specified by:
recordError
in interfaceValidationTracker
-
recordInput
Description copied from interface:ValidationTracker
Called by a field to record the exact input from the user, prior to any validation. If the form is redisplayed (to present errors), the input value will be sent back to the user for correction.- Specified by:
recordInput
in interfaceValidationTracker
- Parameters:
field
- the field recording the inputinput
- the value obtained from the forms submission
-
getDelegate
Returns the instance to which methods are delegated.
-