Package org.apache.sling.validation

# Interface ValidationFailure

All Known Implementing Classes:
  `DefaultValidationFailure`

@ProviderType public interface ValidationFailure

## Method Summary

Modifier and Type
Method
Description
`@NotNull String`
`getLocation()`
Returns the relative location of the property/resource/value which triggered this validation failure.
`@NotNull String`
`getMessage(ResourceBundle resourceBundle)`
`int`
`getSeverity()`

## Method Details

### getMessage

@NotNull @NotNull String getMessage(ResourceBundle resourceBundle)

Parameters:
  `resourceBundle` - ResourceBundle in which to look up the according message (used for i18n), if `null` is given, the default resource bundle is used.
Returns:
  the failure message

### getLocation

@NotNull @NotNull String 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)` or `ValidationService.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).

### 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`.