Interface ArtifactValidation
- All Superinterfaces:
Validation
Defines a validation for an
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.
- Since:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mule.runtime.ast.api.validation.Validation
Validation.Level -
Method Summary
Modifier and TypeMethodDescriptiondefault Predicate<List<ComponentAst>>Determines if this validation has to be applied to a given component.getLevel()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.Methods inherited from interface org.mule.runtime.ast.api.validation.Validation
validateMany
-
Method Details
-
getName
String getName()- Specified by:
getNamein interfaceValidation- Returns:
- an internal name for this validation.
-
getDescription
String getDescription()- Specified by:
getDescriptionin interfaceValidation- Returns:
- a user-friendly description of the validation.
-
getLevel
Validation.Level getLevel()- Specified by:
getLevelin interfaceValidation- Returns:
- the severity level of a failure of this validation.
-
validate
Runs this validation in the provided artifact.This method will only be called if
validateMany(ArtifactAst)is not implemented.Refer to the factory methods in
ValidationResultItemfor creating the object to be returned.- Parameters:
artifact- the artifact under validation.- Returns:
emptyif the validation passed, or a result object describing the failure otherwise.
-
validateMany
Runs this validation in the provided artifact.Refer to the factory methods in
ValidationResultItemfor creating the object to be returned.- Parameters:
artifact- the artifact under validation.- Returns:
emptyif the validation passed, or a result object describing the failure otherwise.
-
applicable
Description copied from interface:ValidationDetermines if this validation has to be applied to a given component. The predicate will receive the hierarchy of the component, being the component asked for the last element of the list, and the root element the first one.Refer to
ComponentAstPredicatesFactory.- Specified by:
applicablein interfaceValidation- Returns:
- the predicate to determine if this validation has to be applied to a given component hierarchy.
-
validate
Description copied from interface:ValidationRuns this validation in the provided component.This method will only be called for components for which the
Validation.applicable()predicate wastrue, but only ifValidation.validateMany(ComponentAst, ArtifactAst)is not implemented.Refer to the factory methods in
ValidationResultItemfor creating the object to be returned.- Specified by:
validatein interfaceValidation- Parameters:
component- the component under validationartifact- the full artifact, for any context needed for the validation- Returns:
emptyif the validation passed, or a result object describing the failure otherwise.
-