code: public boolean isCoreClass(TypeElement typeElement) {
          return utils.getEnclosingTypeElement(typeElement) == null || utils.isStatic(typeElement);
      }
docs: According to
  <cite>The Java&trade; Language Specification</cite>,
  all the outer classes and static nested classes are core classes.