Class ResourceValidationModelProviderImpl

java.lang.Object
org.apache.sling.validation.impl.resourcemodel.ResourceValidationModelProviderImpl
All Implemented Interfaces:
ValidationModelProvider, org.osgi.service.event.EventHandler

public class ResourceValidationModelProviderImpl extends Object implements ValidationModelProvider, org.osgi.service.event.EventHandler
  • Field Details

  • Constructor Details

    • ResourceValidationModelProviderImpl

      public ResourceValidationModelProviderImpl()
  • Method Details

    • activate

      protected void activate(org.osgi.service.component.ComponentContext componentContext) throws LoginException
      Throws:
      LoginException
    • deactivate

      protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • getValidationModels

      @Nonnull public List<ValidationModel> getValidationModels(@Nonnull String relativeResourceType)
      Description copied from interface: ValidationModelProvider
      Retrieves the models responsible for validating the given resourceType.
      Specified by:
      getValidationModels in interface ValidationModelProvider
      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).