Interface ValidationEventDecorator
-
public interface ValidationEventDecorator
Validation event decorators take validation events and transform them by adding more contextual information, usually adding a hint to let the user know what can it be done to solve the issue. This might add context specific information that is not relevant for all cases such as links to internal knowledge sites or explicit instructions relevant only to the context where Smithy is being used.
-
-
Field Summary
Fields Modifier and Type Field Description static ValidationEventDecorator
IDENTITY
A decorator that does nothing.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canDecorate(ValidationEvent ev)
Returns true if this decorator knows how to decorate this event, usually by looking at the event id.static ValidationEventDecorator
compose(java.util.List<ValidationEventDecorator> decorators)
Creates a decorator composed of one or more decorators.ValidationEvent
decorate(ValidationEvent ev)
Takes an event and potentially updates it to decorate it.
-
-
-
Field Detail
-
IDENTITY
static final ValidationEventDecorator IDENTITY
A decorator that does nothing.
-
-
Method Detail
-
canDecorate
boolean canDecorate(ValidationEvent ev)
Returns true if this decorator knows how to decorate this event, usually by looking at the event id.- Parameters:
ev
- The event to test against- Returns:
- true if this decorator knows how to decorate this event
-
decorate
ValidationEvent decorate(ValidationEvent ev)
Takes an event and potentially updates it to decorate it. Returns the same event if this decorators does not know how to handle the event.- Returns:
- The decorated event or the original one if no decoration took place.
-
compose
static ValidationEventDecorator compose(java.util.List<ValidationEventDecorator> decorators)
Creates a decorator composed of one or more decorators.- Parameters:
decorators
- Decorators to compose.- Returns:
- Returns the composed decorator.
-
-