code: public void validate(final ValidationContext context) {
          if (!isValid()) {
              val messages = context.getMessageContext();
              messages.addMessage(new MessageBuilder()
                  .error()
                  .source("token")
                  .defaultText("Unable to accept credential with an empty or unspecified token")
                  .build());
          }
      }
docs: Validate.
  
  @param context the context