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>>
ValidatesNodevalues provided forShapedefinitions.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 classNodeValidationVisitor.BuilderBuilds aNodeValidationVisitor.-
Nested classes/interfaces inherited from interface software.amazon.smithy.model.shapes.ShapeVisitor
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.Builderbuilder()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)voidsetEventId(java.lang.String eventId)Changes the event ID emitted for events created by this validator.voidsetEventShapeId(ShapeId eventShapeId)Changes the shape ID that emitted events are associated with.java.util.List<ValidationEvent>setShape(SetShape shape)voidsetStartingContext(java.lang.String startingContext)Changes the starting context of the messages emitted by events.voidsetValue(Node value)Changes the Node value the 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)
-
-
-
Method Detail
-
builder
public static NodeValidationVisitor.Builder builder()
-
setValue
public void setValue(Node value)
Changes the Node value the 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:
blobShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
booleanShape
public java.util.List<ValidationEvent> booleanShape(BooleanShape shape)
- Specified by:
booleanShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
byteShape
public java.util.List<ValidationEvent> byteShape(ByteShape shape)
- Specified by:
byteShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
shortShape
public java.util.List<ValidationEvent> shortShape(ShortShape shape)
- Specified by:
shortShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
integerShape
public java.util.List<ValidationEvent> integerShape(IntegerShape shape)
- Specified by:
integerShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
longShape
public java.util.List<ValidationEvent> longShape(LongShape shape)
- Specified by:
longShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
bigIntegerShape
public java.util.List<ValidationEvent> bigIntegerShape(BigIntegerShape shape)
- Specified by:
bigIntegerShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
floatShape
public java.util.List<ValidationEvent> floatShape(FloatShape shape)
- Specified by:
floatShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
documentShape
public java.util.List<ValidationEvent> documentShape(DocumentShape shape)
- Specified by:
documentShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
doubleShape
public java.util.List<ValidationEvent> doubleShape(DoubleShape shape)
- Specified by:
doubleShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
bigDecimalShape
public java.util.List<ValidationEvent> bigDecimalShape(BigDecimalShape shape)
- Specified by:
bigDecimalShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
stringShape
public java.util.List<ValidationEvent> stringShape(StringShape shape)
- Specified by:
stringShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
timestampShape
public java.util.List<ValidationEvent> timestampShape(TimestampShape shape)
- Specified by:
timestampShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
listShape
public java.util.List<ValidationEvent> listShape(ListShape shape)
- Specified by:
listShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
setShape
public java.util.List<ValidationEvent> setShape(SetShape shape)
- Specified by:
setShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
mapShape
public java.util.List<ValidationEvent> mapShape(MapShape shape)
- Specified by:
mapShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
structureShape
public java.util.List<ValidationEvent> structureShape(StructureShape shape)
- Specified by:
structureShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
unionShape
public java.util.List<ValidationEvent> unionShape(UnionShape shape)
- Specified by:
unionShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
memberShape
public java.util.List<ValidationEvent> memberShape(MemberShape shape)
- Specified by:
memberShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
operationShape
public java.util.List<ValidationEvent> operationShape(OperationShape shape)
- Specified by:
operationShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
resourceShape
public java.util.List<ValidationEvent> resourceShape(ResourceShape shape)
- Specified by:
resourceShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
serviceShape
public java.util.List<ValidationEvent> serviceShape(ServiceShape shape)
- Specified by:
serviceShapein interfaceShapeVisitor<java.util.List<ValidationEvent>>
-
-