private void processType(TypeElement type) {
        RuntimePermissions annotation = type.getAnnotation(RuntimePermissions.class);
        if (annotation == null) {
            mErrorReporter.abortWithError("@RuntimePermissions annotation is null on Type %s", type);
            return;
        }
        if (type.getKind() != ElementKind.CLASS) {
            mErrorReporter.abortWithError("@RuntimePermissions" + " only applies to class", type);
        }

        NestingKind nestingKind = type.getNestingKind();
        if (nestingKind != NestingKind.TOP_LEVEL) {
            mErrorReporter.abortWithError("@RuntimePermissions" + " only applies to top level class", type);
        }

        checkModifiersIfNested(type);

        // get the fully-qualified class name
        if (annotation.classNameSubFix().length() == 0) {
            mErrorReporter.abortWithError("classNameSubFix should not be empty", type);
        }
        String fqClassName = generatedSubclassName(type, 0, annotation.classNameSubFix());
        // class name
        String className = CompilerUtil.simpleNameOf(fqClassName);
        // Create source.
        String source = generateClass(type, className, type.getSimpleName().toString(), false);

        source = Reformatter.fixup(source);
        writeSourceFile(processingEnv, fqClassName, source, type);
    }
Created by guohao4 on 2017/9/6.
Email: Tornaco@163.com
android/annotation_processors/permission-requester-compiler/src/main/java/github/tornaco/permission/compiler/RuntimePermissionsCompiler.java