Class NodeValidationVisitor
- java.lang.Object
-
- software.amazon.smithy.model.validation.NodeValidationVisitor
-
- All Implemented Interfaces:
ShapeVisitor<java.util.List<ValidationEvent>>
public final class NodeValidationVisitor extends java.lang.Object implements ShapeVisitor<java.util.List<ValidationEvent>>
ValidatesNode
values provided forShape
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
Nested Classes Modifier and Type Class Description static class
NodeValidationVisitor.Builder
Builds aNodeValidationVisitor
.static class
NodeValidationVisitor.Feature
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ValidationEvent>
bigDecimalShape(BigDecimalShape shape)
java.util.List<ValidationEvent>
bigIntegerShape(BigIntegerShape shape)
java.util.List<ValidationEvent>
blobShape(BlobShape shape)
java.util.List<ValidationEvent>
booleanShape(BooleanShape shape)
static NodeValidationVisitor.Builder
builder()
java.util.List<ValidationEvent>
byteShape(ByteShape shape)
java.util.List<ValidationEvent>
documentShape(DocumentShape shape)
java.util.List<ValidationEvent>
doubleShape(DoubleShape shape)
java.util.List<ValidationEvent>
floatShape(FloatShape shape)
java.util.List<ValidationEvent>
integerShape(IntegerShape shape)
java.util.List<ValidationEvent>
listShape(ListShape shape)
java.util.List<ValidationEvent>
longShape(LongShape shape)
java.util.List<ValidationEvent>
mapShape(MapShape shape)
java.util.List<ValidationEvent>
memberShape(MemberShape shape)
java.util.List<ValidationEvent>
operationShape(OperationShape shape)
java.util.List<ValidationEvent>
resourceShape(ResourceShape shape)
java.util.List<ValidationEvent>
serviceShape(ServiceShape shape)
void
setEventId(java.lang.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(java.lang.String startingContext)
Changes the starting context of the messages emitted by events.void
setValue(Node value)
Changes the Node value the visitor will evaluate.java.util.List<ValidationEvent>
shortShape(ShortShape shape)
java.util.List<ValidationEvent>
stringShape(StringShape shape)
java.util.List<ValidationEvent>
structureShape(StructureShape shape)
java.util.List<ValidationEvent>
timestampShape(TimestampShape shape)
java.util.List<ValidationEvent>
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 Detail
-
builder
public static NodeValidationVisitor.Builder builder()
-
setValue
public void setValue(Node value)
Changes the Node value the visitor will evaluate.- Parameters:
value
- Value to set.
-
setEventShapeId
public void setEventShapeId(ShapeId eventShapeId)
Changes the shape ID that emitted events are associated with.- Parameters:
eventShapeId
- Shape ID to set.
-
setStartingContext
public void setStartingContext(java.lang.String startingContext)
Changes the starting context of the messages emitted by events.- Parameters:
startingContext
- Starting context message to set.
-
setEventId
public void setEventId(java.lang.String eventId)
Changes the event ID emitted for events created by this validator.- Parameters:
eventId
- Event ID to set.
-
blobShape
public java.util.List<ValidationEvent> blobShape(BlobShape shape)
- Specified by:
blobShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
booleanShape
public java.util.List<ValidationEvent> booleanShape(BooleanShape shape)
- Specified by:
booleanShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
byteShape
public java.util.List<ValidationEvent> byteShape(ByteShape shape)
- Specified by:
byteShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
shortShape
public java.util.List<ValidationEvent> shortShape(ShortShape shape)
- Specified by:
shortShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
integerShape
public java.util.List<ValidationEvent> integerShape(IntegerShape shape)
- Specified by:
integerShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
longShape
public java.util.List<ValidationEvent> longShape(LongShape shape)
- Specified by:
longShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
bigIntegerShape
public java.util.List<ValidationEvent> bigIntegerShape(BigIntegerShape shape)
- Specified by:
bigIntegerShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
floatShape
public java.util.List<ValidationEvent> floatShape(FloatShape shape)
- Specified by:
floatShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
documentShape
public java.util.List<ValidationEvent> documentShape(DocumentShape shape)
- Specified by:
documentShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
doubleShape
public java.util.List<ValidationEvent> doubleShape(DoubleShape shape)
- Specified by:
doubleShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
bigDecimalShape
public java.util.List<ValidationEvent> bigDecimalShape(BigDecimalShape shape)
- Specified by:
bigDecimalShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
stringShape
public java.util.List<ValidationEvent> stringShape(StringShape shape)
- Specified by:
stringShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
timestampShape
public java.util.List<ValidationEvent> timestampShape(TimestampShape shape)
- Specified by:
timestampShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
listShape
public java.util.List<ValidationEvent> listShape(ListShape shape)
- Specified by:
listShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
mapShape
public java.util.List<ValidationEvent> mapShape(MapShape shape)
- Specified by:
mapShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
structureShape
public java.util.List<ValidationEvent> structureShape(StructureShape shape)
- Specified by:
structureShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
unionShape
public java.util.List<ValidationEvent> unionShape(UnionShape shape)
- Specified by:
unionShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
memberShape
public java.util.List<ValidationEvent> memberShape(MemberShape shape)
- Specified by:
memberShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
operationShape
public java.util.List<ValidationEvent> operationShape(OperationShape shape)
- Specified by:
operationShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
resourceShape
public java.util.List<ValidationEvent> resourceShape(ResourceShape shape)
- Specified by:
resourceShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
serviceShape
public java.util.List<ValidationEvent> serviceShape(ServiceShape shape)
- Specified by:
serviceShape
in interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
-