Source:
protected boolean validateAnnotatedFieldOrMethod(@NotNull final Element annotatedElement) { boolean valid = true; final Element enclosingElement = annotatedElement.getEnclosingElement(); if (enclosingElement.getKind() != CLASS) { throw new ProcessingException( annotatedElement, "Please apply " + getColumnAnnotationClass().getSimpleName() + " to fields or methods of class: " + annotatedElement.getSimpleName() ); } if (enclosingElement.getAnnotation(getTypeAnnotationClass()) == null) { Element superClass = typeUtils.asElement(((TypeElement) enclosingElement).getSuperclass()); if (superClass.getAnnotation(getTypeAnnotationClass()) != null) { valid = false; } else { throw new ProcessingException( annotatedElement, "Please annotate class " + enclosingElement.getSimpleName() + " with " + getTypeAnnotationClass().getSimpleName() ); } } if (annotatedElement.getKind() == FIELD && annotatedElement.getModifiers().contains(PRIVATE)) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to private field: " + annotatedElement.getSimpleName() ); } if (annotatedElement.getKind() == FIELD && annotatedElement.getModifiers().contains(FINAL)) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to final field: " + annotatedElement.getSimpleName() ); } if (annotatedElement.getKind() == METHOD && !((ExecutableElement) annotatedElement).getParameters().isEmpty()) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to method with parameters: " + annotatedElement.getSimpleName() ); } return valid; }

Target:
protected void validateAnnotatedFieldOrMethod(@NotNull final Element annotatedElement) throws SkipNotAnnotatedClassWithAnnotatedParentException { final Element enclosingElement = annotatedElement.getEnclosingElement(); if (enclosingElement.getKind() != CLASS) { throw new ProcessingException( annotatedElement, "Please apply " + getColumnAnnotationClass().getSimpleName() + " to fields or methods of class: " + annotatedElement.getSimpleName() ); } if (enclosingElement.getAnnotation(getTypeAnnotationClass()) == null) { Element superClass = typeUtils.asElement(((TypeElement) enclosingElement).getSuperclass()); if (superClass.getAnnotation(getTypeAnnotationClass()) != null) { throw new SkipNotAnnotatedClassWithAnnotatedParentException("Fields of classes not annotated with" + getTypeAnnotationClass().getSimpleName() + "which have parents annotated with" + getTypeAnnotationClass().getSimpleName() + "will be skipped (e.g. AutoValue case)"); } else { throw new ProcessingException( annotatedElement, "Please annotate class " + enclosingElement.getSimpleName() + " with " + getTypeAnnotationClass().getSimpleName() ); } } if (annotatedElement.getKind() == FIELD && annotatedElement.getModifiers().contains(PRIVATE)) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to private field: " + annotatedElement.getSimpleName() ); } if (annotatedElement.getKind() == FIELD && annotatedElement.getModifiers().contains(FINAL)) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to final field: " + annotatedElement.getSimpleName() ); } if (annotatedElement.getKind() == METHOD && !((ExecutableElement) annotatedElement).getParameters().isEmpty()) { throw new ProcessingException( annotatedElement, getColumnAnnotationClass().getSimpleName() + " can not be applied to method with parameters: " + annotatedElement.getSimpleName() ); } }