@Override
    public List<ValidationEvent> validate(Model model) {
        // Create a reusable validation visitor so that the
        // selector cache is shared for each trait.
        NodeValidationVisitor validator = NodeValidationVisitor.builder()
                .eventId(NAME)
                .model(model)
                .value(Node.nullNode())
                .build();

        List<ValidationEvent> events = new ArrayList<>();
        boolean validatePrelude = model.getMetadataProperty(VALIDATE_PRELUDE).isPresent();
        for (Shape shape : model.toSet()) {
            for (Trait trait : shape.getAllTraits().values()) {
                events.addAll(validateTrait(model, validator, shape, trait, validatePrelude));
            }
        }

        return events;
    }
Validates that trait values are valid for their trait definitions.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValueValidator.java