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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aNodeValidationVisitor.static enumFeatures 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) voidsetEventId(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.voidsetStartingContext(String startingContext) Changes the starting context of the messages emitted by events.voidChanges 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, waitMethods 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:
blobShapein interfaceShapeVisitor<List<ValidationEvent>>
-
booleanShape
- Specified by:
booleanShapein interfaceShapeVisitor<List<ValidationEvent>>
-
byteShape
- Specified by:
byteShapein interfaceShapeVisitor<List<ValidationEvent>>
-
shortShape
- Specified by:
shortShapein interfaceShapeVisitor<List<ValidationEvent>>
-
integerShape
- Specified by:
integerShapein interfaceShapeVisitor<List<ValidationEvent>>
-
longShape
- Specified by:
longShapein interfaceShapeVisitor<List<ValidationEvent>>
-
bigIntegerShape
- Specified by:
bigIntegerShapein interfaceShapeVisitor<List<ValidationEvent>>
-
floatShape
- Specified by:
floatShapein interfaceShapeVisitor<List<ValidationEvent>>
-
documentShape
- Specified by:
documentShapein interfaceShapeVisitor<List<ValidationEvent>>
-
doubleShape
- Specified by:
doubleShapein interfaceShapeVisitor<List<ValidationEvent>>
-
bigDecimalShape
- Specified by:
bigDecimalShapein interfaceShapeVisitor<List<ValidationEvent>>
-
stringShape
- Specified by:
stringShapein interfaceShapeVisitor<List<ValidationEvent>>
-
timestampShape
- Specified by:
timestampShapein interfaceShapeVisitor<List<ValidationEvent>>
-
listShape
- Specified by:
listShapein interfaceShapeVisitor<List<ValidationEvent>>
-
mapShape
- Specified by:
mapShapein interfaceShapeVisitor<List<ValidationEvent>>
-
structureShape
- Specified by:
structureShapein interfaceShapeVisitor<List<ValidationEvent>>
-
unionShape
- Specified by:
unionShapein interfaceShapeVisitor<List<ValidationEvent>>
-
memberShape
- Specified by:
memberShapein interfaceShapeVisitor<List<ValidationEvent>>
-
operationShape
- Specified by:
operationShapein interfaceShapeVisitor<List<ValidationEvent>>
-
resourceShape
- Specified by:
resourceShapein interfaceShapeVisitor<List<ValidationEvent>>
-
serviceShape
- Specified by:
serviceShapein interfaceShapeVisitor<List<ValidationEvent>>
-