private void validateType(TypeElement type) {
    ElementKind kind = type.getKind();
    boolean kindOk =
        kind.equals(ElementKind.CLASS)
            || (appliesToInterfaces && kind.equals(ElementKind.INTERFACE));
    if (!kindOk) {
      String appliesTo = appliesToInterfaces ? "classes and interfaces" : "classes";
      errorReporter.abortWithError(
          type,
          "[%sWrongType] @%s only applies to %s",
          simpleAnnotationName,
          simpleAnnotationName,
          appliesTo);
    }
    checkModifiersIfNested(type);
    if (!hasVisibleNoArgConstructor(type)) {
      errorReporter.reportError(
          type,
          "[%sConstructor] @%s class must have a non-private no-arg constructor",
          simpleAnnotationName,
          simpleAnnotationName);
    }
    if (type.getModifiers().contains(Modifier.FINAL)) {
      errorReporter.abortWithError(
          type,
          "[%sFinal] @%s class must not be final",
          simpleAnnotationName,
          simpleAnnotationName);
    }
  }
Validations common to all the subclasses. An {@code @AutoFoo} type must be a class, or possibly
an interface for {@code @AutoBuilder}. If it is a class then it must have a non-private no-arg
constructor. And, since we'll be generating a subclass, it can't be final.
value/src/main/java/com/google/auto/value/processor/AutoValueishProcessor.java