public final class NodeValidationVisitor extends java.lang.Object implements ShapeVisitor<java.util.List<ValidationEvent>>
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.
Modifier and Type | Class and Description |
---|---|
static class |
NodeValidationVisitor.Builder
Builds a
NodeValidationVisitor . |
ShapeVisitor.Default<R>
Modifier and Type | Method and 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.
|
java.util.List<ValidationEvent> |
setShape(SetShape shape) |
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) |
public static NodeValidationVisitor.Builder builder()
public void setValue(Node value)
value
- Value to set.public void setEventShapeId(ShapeId eventShapeId)
eventShapeId
- Shape ID to set.public void setStartingContext(java.lang.String startingContext)
startingContext
- Starting context message to set.public void setEventId(java.lang.String eventId)
eventId
- Event ID to set.public java.util.List<ValidationEvent> blobShape(BlobShape shape)
blobShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> booleanShape(BooleanShape shape)
booleanShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> byteShape(ByteShape shape)
byteShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> shortShape(ShortShape shape)
shortShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> integerShape(IntegerShape shape)
integerShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> longShape(LongShape shape)
longShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> bigIntegerShape(BigIntegerShape shape)
bigIntegerShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> floatShape(FloatShape shape)
floatShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> documentShape(DocumentShape shape)
documentShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> doubleShape(DoubleShape shape)
doubleShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> bigDecimalShape(BigDecimalShape shape)
bigDecimalShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> stringShape(StringShape shape)
stringShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> timestampShape(TimestampShape shape)
timestampShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> listShape(ListShape shape)
listShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> setShape(SetShape shape)
setShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> mapShape(MapShape shape)
mapShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> structureShape(StructureShape shape)
structureShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> unionShape(UnionShape shape)
unionShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> memberShape(MemberShape shape)
memberShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> operationShape(OperationShape shape)
operationShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> resourceShape(ResourceShape shape)
resourceShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>
public java.util.List<ValidationEvent> serviceShape(ServiceShape shape)
serviceShape
in interface ShapeVisitor<java.util.List<ValidationEvent>>