Class NodeValidationVisitor.Builder
java.lang.Object
software.amazon.smithy.model.validation.NodeValidationVisitor.Builder
- All Implemented Interfaces:
SmithyBuilder<NodeValidationVisitor>
- Enclosing class:
- NodeValidationVisitor
public static final class NodeValidationVisitor.Builder
extends Object
implements SmithyBuilder<NodeValidationVisitor>
Builds a
NodeValidationVisitor
.-
Method Summary
Modifier and TypeMethodDescriptionaddFeature
(NodeValidationVisitor.Feature feature) Adds a feature flag to the validator.allowBoxedNull
(boolean allowBoxedNull) Deprecated.allowOptionalNull
(boolean allowOptionalNull) Configure how null values are handled when they are provided for optional types.build()
Creates an immutable object that is created from the properties that have been set on the builder.Sets an optional custom event ID to use for created validation events.eventShapeId
(ShapeId eventShapeId) Sets an optional shape ID that is used as the shape ID in each validation event emitted by the validator.Sets the required model to use when traversing walking shapes during validation.startingContext
(String contextText) Sets an optional starting context of the validator that is prepended to each emitted validation event message.timestampValidationStrategy
(TimestampValidationStrategy timestampValidationStrategy) Sets the strategy used to validate timestamps.Sets the required node value to validate.
-
Method Details
-
model
Sets the required model to use when traversing walking shapes during validation.- Parameters:
model
- Model that contains shapes to validate.- Returns:
- Returns the builder.
-
value
Sets the required node value to validate.- Parameters:
value
- Value to validate.- Returns:
- Returns the builder.
-
eventId
Sets an optional custom event ID to use for created validation events.- Parameters:
id
- Custom event ID.- Returns:
- Returns the builder.
-
startingContext
Sets an optional starting context of the validator that is prepended to each emitted validation event message.- Parameters:
contextText
- Starting event message content.- Returns:
- Returns the builder.
-
eventShapeId
Sets an optional shape ID that is used as the shape ID in each validation event emitted by the validator.- Parameters:
eventShapeId
- Shape ID to set on every validation event.- Returns:
- Returns the builder.
-
timestampValidationStrategy
public NodeValidationVisitor.Builder timestampValidationStrategy(TimestampValidationStrategy timestampValidationStrategy) Sets the strategy used to validate timestamps.By default, timestamps are validated using
TimestampValidationStrategy.FORMAT
.- Parameters:
timestampValidationStrategy
- Timestamp validation strategy.- Returns:
- Returns the builder.
-
allowBoxedNull
Deprecated. -
allowOptionalNull
Configure how null values are handled when they are provided for optional types.By default, null values are not allowed for optional types.
- Parameters:
allowOptionalNull
- Set to true to allow null values for optional shapes.- Returns:
- Returns the builder.
-
addFeature
Adds a feature flag to the validator.- Parameters:
feature
- Feature to set.- Returns:
- Returns the builder.
-
build
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<NodeValidationVisitor>
- Returns:
- an instance of T
-