protected void removePropertyNameFromBeanValidationContext() { if (beanValidationDisabled) { return; } BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class); if (beanValidationContext == null) return; beanValidationContext.setCurrentProperty(null); }
protected void putPropertyNameIntoBeanValidationContext(String parameterName) { if (beanValidationDisabled) { return; } String propertyName = ((InternalComponentResources) resources).getPropertyName(parameterName); BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class); if (beanValidationContext == null) return; // If field is inside BeanEditForm, then property is already set if (beanValidationContext.getCurrentProperty() == null) { beanValidationContext.setCurrentProperty(propertyName); } }
private boolean inError(Field field) { ValidationTracker tracker = environment.peekRequired(ValidationTracker.class); return tracker.inError(field); }
private FormSupport getFormSupport() { return environment.peekRequired(FormSupport.class); }