Class NodeValidationVisitor
java.lang.Object
software.amazon.smithy.model.validation.NodeValidationVisitor
- All Implemented Interfaces:
ShapeVisitor<List<ValidationEvent>>
public final class NodeValidationVisitor
extends Object
implements ShapeVisitor<List<ValidationEvent>>
Validates
Node
values provided for Shape
definitions.
This visitor validator is used to ensure that values provided for custom traits and examples are correct for their schema definitions. A map of shape types to a list of additional validators can be provided to perform additional, non-standard, validation of these values. For example, this can be used to provide additional validation needed for custom traits that are applied to the shape of the data.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds aNodeValidationVisitor
.static enum
Features to use when validating.Nested classes/interfaces inherited from interface software.amazon.smithy.model.shapes.ShapeVisitor
ShapeVisitor.DataShapeVisitor<R>, ShapeVisitor.Default<R>
-
Method Summary
Modifier and TypeMethodDescriptionbigDecimalShape
(BigDecimalShape shape) bigIntegerShape
(BigIntegerShape shape) booleanShape
(BooleanShape shape) builder()
documentShape
(DocumentShape shape) doubleShape
(DoubleShape shape) floatShape
(FloatShape shape) integerShape
(IntegerShape shape) memberShape
(MemberShape shape) operationShape
(OperationShape shape) resourceShape
(ResourceShape shape) serviceShape
(ServiceShape shape) void
setEventId
(String eventId) Changes the event ID emitted for events created by this validator.void
setEventShapeId
(ShapeId eventShapeId) Changes the shape ID that emitted events are associated with.void
setStartingContext
(String startingContext) Changes the starting context of the messages emitted by events.void
Changes the Node value the visitor will evaluate.shortShape
(ShortShape shape) stringShape
(StringShape shape) structureShape
(StructureShape shape) timestampShape
(TimestampShape shape) unionShape
(UnionShape shape) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.smithy.model.shapes.ShapeVisitor
enumShape, intEnumShape, setShape
-
Method Details
-
builder
-
setValue
Changes the Node value the visitor will evaluate.- Parameters:
value
- Value to set.
-
setEventShapeId
Changes the shape ID that emitted events are associated with.- Parameters:
eventShapeId
- Shape ID to set.
-
setStartingContext
Changes the starting context of the messages emitted by events.- Parameters:
startingContext
- Starting context message to set.
-
setEventId
Changes the event ID emitted for events created by this validator.- Parameters:
eventId
- Event ID to set.
-
blobShape
- Specified by:
blobShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
booleanShape
- Specified by:
booleanShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
byteShape
- Specified by:
byteShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
shortShape
- Specified by:
shortShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
integerShape
- Specified by:
integerShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
longShape
- Specified by:
longShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
bigIntegerShape
- Specified by:
bigIntegerShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
floatShape
- Specified by:
floatShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
documentShape
- Specified by:
documentShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
doubleShape
- Specified by:
doubleShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
bigDecimalShape
- Specified by:
bigDecimalShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
stringShape
- Specified by:
stringShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
timestampShape
- Specified by:
timestampShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
listShape
- Specified by:
listShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
mapShape
- Specified by:
mapShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
structureShape
- Specified by:
structureShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
unionShape
- Specified by:
unionShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
memberShape
- Specified by:
memberShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
operationShape
- Specified by:
operationShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
resourceShape
- Specified by:
resourceShape
in interfaceShapeVisitor<List<ValidationEvent>>
-
serviceShape
- Specified by:
serviceShape
in interfaceShapeVisitor<List<ValidationEvent>>
-