Interface ValidationModelProvider

All Known Implementing Classes:
ResourceValidationModelProviderImpl

@ProviderType public interface ValidationModelProvider
All providers of ValidationModels must implement this interface. Caching of validation models should be implemented in the provider itself, because the providers are asked potentially multiple times for each ValidationService.getValidationModel(org.apache.sling.api.resource.Resource, boolean) or ValidationService.getValidationModel(String, String, boolean) call.
  • Method Summary

    Modifier and Type
    Method
    Description
    getValidationModels(@NotNull String relativeResourceType)
    Retrieves the models responsible for validating the given resourceType.
  • Method Details

    • getValidationModels

      @NotNull @NotNull List<ValidationModel> getValidationModels(@NotNull @NotNull String relativeResourceType) throws IllegalStateException
      Retrieves the models responsible for validating the given resourceType.
      Parameters:
      relativeResourceType - the relative resource (relative to one of the resource resolver's search paths)
      Returns:
      a List of ValidationModels. Never null, but might be empty collection in case no model for the given resource type could be found. The order which model gets active is mostly determined by ValidationModel.getApplicablePaths() (longest path match wins) but in case there are multiple models having the same applicable path, the order being returned here is considered (i.e. the first one is taken).
      Throws:
      IllegalStateException - in case a validation model was found but it is invalid