Class EventValueValidator
java.lang.Object
com.aquima.interactions.portal.model.session.page.EventValueValidator
- All Implemented Interfaces:
IVisitor
- Direct Known Subclasses:
ReadOnlyPageFieldValidator
Page visitor that checks if required fields are present. This visitor also performs validations for the values that
were changed (submitted). Any error that is detected will be added to the EventErrors object, but no modifications
will be made to the page object containing the field definitions.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEventValueValidator
(IPortalContext context, EventValue[] values, RequestAction action, Set<Object> previousWarnings, EventErrors errors) -
Method Summary
Modifier and TypeMethodDescriptionThis method will be invoked for each element that is encountered during the visit.boolean
This method returns a boolean indicating if any errors were detected while validating the page.protected IMultilingualText
getMessage
(String key, String[] parameters) The set of warnings is needed by the next page submit to determine if a warning has already been shown on the page or if this was the first time.void
leave
(ICompositeElement compositeElement, IVisitor childVisitor) This method will be invoked after all the children of the specified container have been processed with the childVisitor.protected boolean
validateValue
(IField field, IValue fieldValue, ValueReference valueReference, boolean isRequired, boolean isChanged)
-
Field Details
-
applicabilityEvaluator
-
-
Constructor Details
-
EventValueValidator
public EventValueValidator(IPortalContext context, EventValue[] values, RequestAction action, Set<Object> previousWarnings, EventErrors errors)
-
-
Method Details
-
getWarnings
The set of warnings is needed by the next page submit to determine if a warning has already been shown on the page or if this was the first time. A warning message should block the submit at least once to ensure the warning has been seen.- Returns:
- The set of warnings that were encountered for the field values.
-
accept
Description copied from interface:IVisitor
This method will be invoked for each element that is encountered during the visit. The return type of this method is the visitor that should be used to process the child elements of the current element. When the current element does not have any children, or when the child elements should not be processed, this method should return a null value as result. The returned visitor may either be a new visitor, for instance with specific context information for the element, or the same visitor. -
validateValue
protected boolean validateValue(IField field, IValue fieldValue, ValueReference valueReference, boolean isRequired, boolean isChanged) -
getMessage
-
leave
Description copied from interface:IVisitor
This method will be invoked after all the children of the specified container have been processed with the childVisitor. The implementation of this method may choose to merge the results of the child visitor with this visitor. -
containsErrors
public boolean containsErrors()This method returns a boolean indicating if any errors were detected while validating the page.- Returns:
- boolean indicating if any errors were detected while validating the page.
-