public static ValidationEvent fromNode(Node node) {
        ObjectNode objectNode = node.expectObjectNode();

        // A source location should always have at least a filename in the node
        // representation of a ValidationEvent. Expect that and default the
        // other properties.
        SourceLocation location = new SourceLocation(
                objectNode.expectStringMember("filename").getValue(),
                objectNode.getNumberMemberOrDefault("line", 0).intValue(),
                objectNode.getNumberMemberOrDefault("column", 0).intValue());
        Builder builder = builder().sourceLocation(location);
        objectNode.expectStringMember("id", builder::id)
                .expectMember("severity", Severity::fromNode, builder::severity)
                .expectStringMember("message", builder::message)
                .getStringMember("suppressionReason", builder::suppressionReason)
                .getStringMember("hint", builder::hint)
                .getMember("shapeId", ShapeId::fromNode, builder::shapeId);
        return builder.build();
    }
Creates a new ValidationEvent from a {@link SourceException}.

@param exception Exception to use to create the event.
@param prefix Prefix string to add to the message.
@param shapeId ShapeId to associate with the event.
@return Returns a created validation event with an ID of Model.
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationEvent.java