Package org.apache.sling.validation
Interface ValidationFailure
- All Known Implementing Classes:
DefaultValidationFailure
@ProviderType
public interface ValidationFailure
-
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns the relative location of the property/resource/value which triggered this validation failure.@NotNull StringgetMessage(ResourceBundle resourceBundle) int
-
Method Details
-
getMessage
- Parameters:
resourceBundle- ResourceBundle in which to look up the according message (used for i18n), ifnullis given, the default resource bundle is used.- Returns:
- the failure message
-
getLocation
Returns the relative location of the property/resource/value which triggered this validation failure. The location- is relative to the resource given in the first parameter in case it was returned by
ValidationService.validate(org.apache.sling.api.resource.Resource, org.apache.sling.validation.model.ValidationModel)orValidationService.validateResourceRecursively(org.apache.sling.api.resource.Resource, boolean, java.util.function.Predicate, boolean)or - contains just the value name in case it was returned by
ValidationService.validate(org.apache.sling.api.resource.ValueMap, org.apache.sling.validation.model.ValidationModel)
- Returns:
- the location (usually the validated resource's property path).
- is relative to the resource given in the first parameter in case it was returned by
-
getSeverity
int getSeverity()- Returns:
- the severity of this validation failure. If no explicit severity was set either in the validation model or in the validator, this returns
0.
-