Class MergedValidationModel
java.lang.Object
org.apache.sling.validation.impl.model.MergedValidationModel
- All Implemented Interfaces:
ValidationModel
Generates a merged validation model out of one base
ValidationModel
and 1 or more models to merge.
The resource properties and children are basically concatenated with the exception that
if a resource property/child with the same name is already defined in the baseModel it is not added again.
That way you can overwrite and even remove validation rules from the model to merge.-
Constructor Summary
ConstructorDescriptionMergedValidationModel
(ValidationModel baseModel, ValidationModel... modelsToMerge) -
Method Summary
Modifier and TypeMethodDescriptionReturns the paths under which resources will be validated by this model.Returns the expected children for a resource validated by this model.Returns the properties validated by this model.Returns the type of resource this model validates.
-
Constructor Details
-
MergedValidationModel
-
-
Method Details
-
getResourceProperties
Description copied from interface:ValidationModel
Returns the properties validated by this model.- Specified by:
getResourceProperties
in interfaceValidationModel
- Returns:
- the properties list (never
null
, but might be empty list)
-
getValidatingResourceType
Description copied from interface:ValidationModel
Returns the type of resource this model validates.- Specified by:
getValidatingResourceType
in interfaceValidationModel
- Returns:
- the resource type to be validated, never
null
-
getApplicablePaths
Description copied from interface:ValidationModel
Returns the paths under which resources will be validated by this model. Might return a single element array containing only the empty string, in which case the validation model has no path restriction.- Specified by:
getApplicablePaths
in interfaceValidationModel
- Returns:
- a path array. Is never
null
nor an empty collection.
-
getChildren
Description copied from interface:ValidationModel
Returns the expected children for a resource validated by this model.- Specified by:
getChildren
in interfaceValidationModel
- Returns:
- the children list (can be empty if there are no children), never
null
-
getSource
- Specified by:
getSource
in interfaceValidationModel
- Returns:
- a string indicating the original source of this validation model, e.g. a resource path
-