public class ConditionalVisitorFieldValidator extends VisitorFieldValidator
 
 <field name="colleaguePosition">
     <field-validator type="conditionalvisitor">
         <param name="expression">reason == 'colleague' and colleaguePositionID == 'OTHER'</param>
         <message>You must select reason Colleague and position Other</message>
     </field-validator>
 </field>
 
 VisitorFieldValidator.AppendingValidatorContextcurrentValue, fieldName, typedefaultMessage, EMPTY_STRING, messageKey, stack, textProviderFactory| Constructor and Description | 
|---|
| ConditionalVisitorFieldValidator() | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getExpression() | 
| void | setExpression(String expression) | 
| void | validate(Object object)If expression evaluates to true, invoke visitor validation. | 
| boolean | validateExpression(Object object)Validate the expression contained in the "expression" paramter. | 
getContext, isAppendPrefix, setActionValidatorManager, setAppendPrefix, setContextgetCurrentValue, getFieldName, getValidatorType, setFieldName, setValidatorTypeaddActionError, addFieldError, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStackclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStackpublic void setExpression(String expression)
public String getExpression()
public void validate(Object object) throws ValidationException
validate in interface Validatorvalidate in class VisitorFieldValidatorobject - the object being validatedValidationException - in case of validation problemspublic boolean validateExpression(Object object) throws ValidationException
object - the object you're validatingValidationException - if anything goes wrongCopyright © 2000–2025 Apache Software Foundation. All rights reserved.