code: private static void validateId(String id) {
  
          if (id == null) {
              return;
          }
          int n = id.length();
          if (n < 1) {
              throw new IllegalArgumentException("Empty id attribute is not allowed");
          }
          for (int i = 0; i < n; i++) {
              char c = id.charAt(i);
              if (i == 0) {
                  if (!Character.isLetter(c) && (c != '_')) {
                      throw new IllegalArgumentException(id);
                  }
              } else {
                  if (!Character.isLetter(c) &&
                          !Character.isDigit(c) &&
                          (c != '-') && (c != '_')) {
                      throw new IllegalArgumentException(id);
                  }
              }
          }
  
      }
docs: <p>Throw <code>IllegalArgumentException</code> if the specified
  component identifier is non-<code>null</code> and not
  syntactically valid.  </p>
  
  @param id The component identifier to test