Class ModelBasedEventDecorator
- java.lang.Object
-
- software.amazon.smithy.model.validation.suppressions.ModelBasedEventDecorator
-
public final class ModelBasedEventDecorator extends java.lang.ObjectCreates aValidationEventDecoratorthat applies custom suppressions, custom severity overrides, suppressions parsed from model metadata, and severity overrides parsed from model metadata.
-
-
Constructor Summary
Constructors Constructor Description ModelBasedEventDecorator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidatedResult<ValidationEventDecorator>createDecorator(Model model)Creates a ValidationEventDecorator for the given Model.ModelBasedEventDecoratorseverityOverrides(java.util.Collection<? extends SeverityOverride> severityOverrides)Sets custom severity overrides not found in the model.ModelBasedEventDecoratorsuppressions(java.util.Collection<? extends Suppression> suppressions)Sets custom suppressions not found in the model.
-
-
-
Method Detail
-
suppressions
public ModelBasedEventDecorator suppressions(java.util.Collection<? extends Suppression> suppressions)
Sets custom suppressions not found in the model.- Parameters:
suppressions- Suppressions to set.- Returns:
- Returns the ModelBasedEventDecorator.
-
severityOverrides
public ModelBasedEventDecorator severityOverrides(java.util.Collection<? extends SeverityOverride> severityOverrides)
Sets custom severity overrides not found in the model.- Parameters:
severityOverrides- Severity overrides to set.- Returns:
- Returns the ModelBasedEventDecorator.
-
createDecorator
public ValidatedResult<ValidationEventDecorator> createDecorator(Model model)
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.
-
-