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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(org.osgi.service.component.ComponentContext componentContext) protected void
deactivate
(org.osgi.service.component.ComponentContext componentContext) getValidationModels
(String relativeResourceType) Retrieves the models responsible for validating the given resourceType.void
handleEvent
(org.osgi.service.event.Event event)
-
Field Details
-
NAME_REGEX
- See Also:
-
CHILDREN
- See Also:
-
VALIDATOR_ARGUMENTS
- See Also:
-
VALIDATORS
- See Also:
-
OPTIONAL
- See Also:
-
PROPERTY_MULTIPLE
- See Also:
-
PROPERTIES
- See Also:
-
VALIDATION_MODEL_RESOURCE_TYPE
- See Also:
-
APPLICABLE_PATHS
- See Also:
-
VALIDATING_RESOURCE_TYPE
- See Also:
-
SEVERITY
- See Also:
-
-
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 interfaceorg.osgi.service.event.EventHandler
-
getValidationModels
Description copied from interface:ValidationModelProvider
Retrieves the models responsible for validating the given resourceType.- Specified by:
getValidationModels
in interfaceValidationModelProvider
- Parameters:
relativeResourceType
- the relative resource (relative to one of the resource resolver's search paths)- Returns:
- a List of
ValidationModel
s. Nevernull
, 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 byValidationModel.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).
-