Package org.apache.sling.models.spi
Interface ModelValidation
- 
@ConsumerType public interface ModelValidation 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <ModelType>
java.lang.RuntimeExceptionvalidate(java.lang.Object adaptable, java.lang.Class<ModelType> modelClass, boolean required)Triggers validation for the given model on the given adaptable 
 - 
 
- 
- 
Method Detail
- 
validate
<ModelType> java.lang.RuntimeException validate(java.lang.Object adaptable, java.lang.Class<ModelType> modelClass, boolean required) throws ValidationException, InvalidModelExceptionTriggers validation for the given model on the given adaptable- Type Parameters:
 ModelType- Model type- Parameters:
 adaptable- the adaptable about to be used instantiate the Sling Model ClassmodelClass- the class of the model which is about to be instantiatedrequired- iftruevalidation fails even if validation model can't be found.- Returns:
 nullif validation was successful, otherwise eitherValidationExceptionin case validation could not be performed for some reason (e.g. no validation information available) orInvalidModelExceptionin case the given model type could not be validated through theModelValidation.- Throws:
 ValidationExceptionInvalidModelException
 
 - 
 
 -