}
if (isConditionGloballyScoped(element)) {
configuration.addPropertyRule(propertyName, rule);
} else {
PropertyValidationRule propertyRule = new PropertyValidationRule(propertyName, rule);
// By definition, the applicability condition should be evaluated on the validated bean and not on the
// validated bean property. Thus we need to explicitely set the applicability condition on the validation
// rule otherwise the default applicability condition to be evaluated on the property value.
if (applicabilityCondition != null) {
propertyRule.setApplicabilityCondition(applicabilityCondition);
}
if (applicableContexts != null) {
propertyRule.setContextTokens(applicableContexts);
}
configuration.addPropertyRule(propertyName, propertyRule);
}