@Override
        ValidationEvent validateVersionedTrait(ShapeId target, ShapeId traitId, Node value) {
            String errorMessage = null;
            if (traitId.equals(MixinTrait.ID)) {
                errorMessage = String.format("Mixins can only be used in Smithy 2.0 or later. Attempted to apply "
                        + "a @mixin trait to `%s` in a model file using version `%s`.",
                        target,
                        this);
            } else if (traitId.equals(DefaultTrait.ID)) {
                errorMessage = "The @default trait can only be used in Smithy 2.0 or later";
            }

            if (errorMessage != null) {
                return ValidationEvent.builder()
                        .severity(Severity.ERROR)
                        .id(Validator.MODEL_ERROR)
                        .shapeId(target)
                        .sourceLocation(value)
                        .message(errorMessage)
                        .build();
            }

            return null;
        }
Tracks version-specific features and validation.
smithy-model/src/main/java/software/amazon/smithy/model/loader/Version.java