code: private boolean ancestorIsTemplated(TypeElement type) {
          while (true) {
              TypeMirror parentMirror = type.getSuperclass();
              if (parentMirror.getKind() == TypeKind.NONE) {
                  return false;
              }
              TypeElement parentElement = (TypeElement) typeUtils.asElement(parentMirror);
              if (parentElement.getAnnotation(Templated.class) != null) {
                  return true;
              }
              type = parentElement;
          }
      }
docs: ------------------------------------------------------ helpers