Search in sources :

Example 1 with CompositeTextProvider

use of com.opensymphony.xwork2.CompositeTextProvider in project struts by apache.

the class VisitorFieldValidator method validateObject.

private void validateObject(String fieldName, Object o, String visitorContext) throws ValidationException {
    ValueStack stack = ActionContext.getContext().getValueStack();
    stack.push(o);
    ValidatorContext validatorContext;
    if (appendPrefix) {
        ValidatorContext parent = getValidatorContext();
        validatorContext = new AppendingValidatorContext(parent, createTextProvider(o, parent), fieldName, getMessage(o));
    } else {
        ValidatorContext parent = getValidatorContext();
        CompositeTextProvider textProvider = createTextProvider(o, parent);
        validatorContext = new DelegatingValidatorContext(parent, textProvider, parent);
    }
    actionValidatorManager.validate(o, visitorContext, validatorContext);
    stack.pop();
}
Also used : DelegatingValidatorContext(com.opensymphony.xwork2.validator.DelegatingValidatorContext) ValueStack(com.opensymphony.xwork2.util.ValueStack) DelegatingValidatorContext(com.opensymphony.xwork2.validator.DelegatingValidatorContext) ValidatorContext(com.opensymphony.xwork2.validator.ValidatorContext) CompositeTextProvider(com.opensymphony.xwork2.CompositeTextProvider)

Aggregations

CompositeTextProvider (com.opensymphony.xwork2.CompositeTextProvider)1 ValueStack (com.opensymphony.xwork2.util.ValueStack)1 DelegatingValidatorContext (com.opensymphony.xwork2.validator.DelegatingValidatorContext)1 ValidatorContext (com.opensymphony.xwork2.validator.ValidatorContext)1