Class ModelBasedEventDecorator
java.lang.Object
software.amazon.smithy.model.validation.suppressions.ModelBasedEventDecorator
Creates a
ValidationEventDecorator that applies custom suppressions, custom severity overrides,
suppressions parsed from model metadata, and severity overrides parsed from model metadata.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDecorator(Model model) Creates a ValidationEventDecorator for the given Model.severityOverrides(Collection<? extends SeverityOverride> severityOverrides) Sets custom severity overrides not found in the model.suppressions(Collection<? extends Suppression> suppressions) Sets custom suppressions not found in the model.
-
Constructor Details
-
ModelBasedEventDecorator
public ModelBasedEventDecorator()
-
-
Method Details
-
suppressions
Sets custom suppressions not found in the model.- Parameters:
suppressions- Suppressions to set.- Returns:
- Returns the ModelBasedEventDecorator.
-
severityOverrides
public ModelBasedEventDecorator severityOverrides(Collection<? extends SeverityOverride> severityOverrides) Sets custom severity overrides not found in the model.- Parameters:
severityOverrides- Severity overrides to set.- Returns:
- Returns the ModelBasedEventDecorator.
-
createDecorator
Creates a ValidationEventDecorator for the given Model.Validators, suppressions, and severity overrides found in the model are used each time
ValidationEventDecorator.decorate(ValidationEvent)is called. TheValidationEventDecorator.canDecorate(ValidationEvent)always returns true.- Parameters:
model- Model to load validation events from.- Returns:
- Returns a decorator that can be used to modify the severity and suppression reason of each given event.
-