public interface ArtifactValidation extends Validation
ArtifactAst. This is NOT intended to do validations of the components within the artifact.
You must implement Validation for that.
Runtime and modules may implement their own validations by implementing this interface.
Implementations must be stateless.
Validation.Level| Modifier and Type | Method and Description |
|---|---|
default Predicate<List<ComponentAst>> |
applicable()
Determines if this validation has to be applied to a given component.
|
String |
getDescription() |
Validation.Level |
getLevel() |
String |
getName() |
default Optional<ValidationResultItem> |
validate(ArtifactAst artifact)
Runs this validation in the provided artifact.
|
default Optional<ValidationResultItem> |
validate(ComponentAst component,
ArtifactAst artifact)
Runs this validation in the provided component.
|
default List<ValidationResultItem> |
validateMany(ArtifactAst artifact)
Runs this validation in the provided artifact.
|
validateManyString getName()
getName in interface ValidationString getDescription()
getDescription in interface ValidationValidation.Level getLevel()
getLevel in interface Validationdefault Optional<ValidationResultItem> validate(ArtifactAst artifact)
This method will only be called if validateMany(ArtifactAst) is not implemented.
Refer to the factory methods in ValidationResultItem for creating the object to be returned.
artifact - the artifact under validation.empty if the validation passed, or a result object describing the failure otherwise.default List<ValidationResultItem> validateMany(ArtifactAst artifact)
Refer to the factory methods in ValidationResultItem for creating the object to be returned.
artifact - the artifact under validation.empty if the validation passed, or a result object describing the failure otherwise.default Predicate<List<ComponentAst>> applicable()
Validation
Refer to ComponentAstPredicatesFactory.
applicable in interface Validationdefault Optional<ValidationResultItem> validate(ComponentAst component, ArtifactAst artifact)
Validation
This method will only be called for components for which the Validation.applicable() predicate was true, but only if
Validation.validateMany(ComponentAst, ArtifactAst) is not implemented.
Refer to the factory methods in ValidationResultItem for creating the object to be returned.
validate in interface Validationcomponent - the component under validationartifact - the full artifact, for any context needed for the validationempty if the validation passed, or a result object describing the failure otherwise.Copyright © 2022 MuleSoft, Inc.. All rights reserved.