/** * Old API to add an error to the validation results when no context is available. * * @param reason - Features from {@link org.apache.bval.model.Features.Property} or custom validation reason * @param bean - (optional) owner bean or null * @param propertyName - (optional) propertyName where valiation error occurred or null */ public void addError(String reason, Object bean, String propertyName) { addError(createError(reason, bean, propertyName), null); }
/** * API to add an error to the validation results. * * @param reason - Features from {@link org.apache.bval.model.Features.Property} * or custom reason of validation error * @param context - context information (bean, propertyName, value, ...) */ @Override public <T extends ValidationListener> void addError(String reason, ValidationContext<T> context) { Error error = createError(reason, context.getBean(), context.getPropertyName()); addError(error, context); }