public interface Validation
ComponentAst within an ArtifactAst.
Runtime and modules may implement their own validations by implementing this interface.
Implementations must be stateless.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Validation.Level
Defines the severity of a validation failure.
|
| Modifier and Type | Method and Description |
|---|---|
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(ComponentAst component,
ArtifactAst artifact)
Runs this validation in the provided component.
|
default List<ValidationResultItem> |
validateMany(ComponentAst component,
ArtifactAst artifact)
Runs this validation in the provided component.
|
String getName()
String getDescription()
Validation.Level getLevel()
Predicate<List<ComponentAst>> applicable()
Refer to ComponentAstPredicatesFactory.
default Optional<ValidationResultItem> validate(ComponentAst component, ArtifactAst artifact)
This method will only be called for components for which the applicable() predicate was true, but only if
validateMany(ComponentAst, ArtifactAst) is not implemented.
Refer to the factory methods in ValidationResultItem for creating the object to be returned.
component - 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.default List<ValidationResultItem> validateMany(ComponentAst component, ArtifactAst artifact)
This method will only be called for components for which the applicable() predicate was true.
Refer to the factory methods in ValidationResultItem for creating the object to be returned.
component - 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.