Package org.apache.tapestry5
Class ValidationTrackerWrapper
- java.lang.Object
-
- org.apache.tapestry5.ValidationTrackerWrapper
-
- All Implemented Interfaces:
ValidationTracker
public class ValidationTrackerWrapper extends java.lang.Object implements ValidationTracker
Wrapper around aValidationTrackerthat delegates all methods to the wrapped instance. Subclasses will often override specific methods.- Since:
- 5.2.0
-
-
Constructor Summary
Constructors Constructor Description ValidationTrackerWrapper(ValidationTracker delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all information stored by the tracker.protected ValidationTrackergetDelegate()Returns the instance to which methods are delegated.java.lang.StringgetError(Field field)Returns a previously recorded error message.java.util.List<java.lang.String>getErrors()Returns a list of all error messages.booleangetHasErrors()Returns true if any field contains an error.java.lang.StringgetInput(Field field)Returns a previously recorded input value.java.util.List<java.lang.String>getUnassociatedErrors()Returns just the errors that are not associated with any fields.booleaninError(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.voidrecordError(java.lang.String errorMessage)Records an error message that is not associated with any specific field.voidrecordError(Field field, java.lang.String errorMessage)Records an error message for a field.voidrecordInput(Field field, java.lang.String input)Called by a field to record the exact input from the user, prior to any validation.
-
-
-
Constructor Detail
-
ValidationTrackerWrapper
public ValidationTrackerWrapper(ValidationTracker delegate)
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:ValidationTrackerClears all information stored by the tracker.- Specified by:
clearin interfaceValidationTracker
-
getError
public java.lang.String getError(Field field)
Description copied from interface:ValidationTrackerReturns a previously recorded error message.- Specified by:
getErrorin interfaceValidationTracker
-
getErrors
public java.util.List<java.lang.String> getErrors()
Description copied from interface:ValidationTrackerReturns 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:
getErrorsin interfaceValidationTracker
-
getUnassociatedErrors
public java.util.List<java.lang.String> getUnassociatedErrors()
Description copied from interface:ValidationTrackerReturns just the errors that are not associated with any fields.- Specified by:
getUnassociatedErrorsin interfaceValidationTracker
-
getHasErrors
public boolean getHasErrors()
Description copied from interface:ValidationTrackerReturns true if any field contains an error.- Specified by:
getHasErrorsin interfaceValidationTracker
-
getInput
public java.lang.String getInput(Field field)
Description copied from interface:ValidationTrackerReturns a previously recorded input value.- Specified by:
getInputin interfaceValidationTracker
-
inError
public boolean inError(Field field)
Description copied from interface:ValidationTrackerFor a given field, determines if the field is "in error", meaning that an error message has been previously recorded for the field.- Specified by:
inErrorin interfaceValidationTracker- Returns:
- true if an error message is present
-
recordError
public void recordError(Field field, java.lang.String errorMessage)
Description copied from interface:ValidationTrackerRecords an error message for a field. The error message is primarily derived from aValidationExceptionthrown by aValidatororTranslator.- Specified by:
recordErrorin interfaceValidationTracker
-
recordError
public void recordError(java.lang.String errorMessage)
Description copied from interface:ValidationTrackerRecords an error message that is not associated with any specific field. This often reflects some amount of cross-form validation.- Specified by:
recordErrorin interfaceValidationTracker
-
recordInput
public void recordInput(Field field, java.lang.String input)
Description copied from interface:ValidationTrackerCalled 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:
recordInputin interfaceValidationTracker- Parameters:
field- the field recording the inputinput- the value obtained from the forms submission
-
getDelegate
protected ValidationTracker getDelegate()
Returns the instance to which methods are delegated.
-
-