@ConsumerType
public interface ModelValidation
Modifier and Type | Method and Description |
---|---|
<ModelType> |
validate(Object adaptable,
Class<ModelType> modelClass,
boolean required)
Triggers validation for the given model on the given adaptable
|
<ModelType> RuntimeException validate(Object adaptable, Class<ModelType> modelClass, boolean required) throws ValidationException, InvalidModelException
adaptable
- the adaptable about to be used instantiate the Sling Model ClassmodelClass
- the class of the model which is about to be instantiatedrequired
- if true
validation fails even if validation model can't be found.null
if validation was successful, otherwise either ValidationException
in case validation could not be performed for some reason (e.g. no validation information available)
or InvalidModelException
in case the given model type could not be validated through the ModelValidation
.ValidationException
InvalidModelException
Copyright © 2017 The Apache Software Foundation. All rights reserved.