// Path: library-compiler/src/main/java/com/wangjie/rapidrouter/compiler/util/GlobalEnvironment.java
// public class GlobalEnvironment {
//     private static ProcessingEnvironment processingEnv;
// 
//     public static void init(ProcessingEnvironment processingEnv){
//         GlobalEnvironment.processingEnv = processingEnv;
//     }
//     public static ProcessingEnvironment getProcessingEnv() {
//         return processingEnv;
//     }
// }
// 
// Path: library-compiler/src/main/java/com/wangjie/rapidrouter/compiler/util/LogUtil.java
// public class LogUtil {
//     public static final boolean LOG_CONTROL = true;
//     public static final boolean LOG_FILE = false;
//     private static SimpleDateFormat LOGGER_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:sss");
// 
// 
//     public static void loggerE(Throwable throwable) {
//         if (!LOG_CONTROL && !LOG_FILE) {
//             return;
//         }
//         logger("[ERROR]" + transformStackTrace(throwable));
//     }
// 
//     public static void logger(String str) {
//         if (!LOG_CONTROL && !LOG_FILE) {
//             return;
//         }
//         String loggerDate = "...[" + LOGGER_DATE_FORMAT.format(new Date()) + "]";
//         String log = loggerDate + ": " + str;
//         if (LOG_CONTROL) {
//             GlobalEnvironment.getProcessingEnv().getMessager().printMessage(Diagnostic.Kind.NOTE, log);
//         }
//         if (LOG_FILE) {
//             writeToDisk(log);
//         }
//     }
// 
//     private static void writeToDisk(String log) {
//         try {
//             File logFile = new File("/Users/wangjie/Desktop/za/test/rapidorm/processor_http.txt");
//             if (!logFile.exists()) {
//                 logFile.getParentFile().mkdirs();
//                 logFile.createNewFile();
//             }
//             FileWriter fw = new FileWriter(logFile, true);
//             fw.write(log + "\n\n");
//             fw.close();
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static StringBuilder transformStackTrace(StackTraceElement[] elements){
//         StringBuilder sb = new StringBuilder();
//         for(StackTraceElement element : elements){
//             sb.append(element.toString()).append("\r\n");
//         }
//         return sb;
//     }
//     public static String transformStackTrace(Throwable throwable){
//         if(null == throwable){
//             return "throwable is null";
//         }
//         StringBuilder sb = new StringBuilder(throwable.getMessage()).append("\n");
//         for(StackTraceElement element : throwable.getStackTrace()){
//             sb.append(element.toString()).append("\r\n");
//         }
//         return sb.toString();
//     }
// 
// }


import com.google.auto.common.MoreElements;
import com.wangjie.rapidrouter.compiler.util.GlobalEnvironment;
import com.wangjie.rapidrouter.compiler.util.LogUtil;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
package com.wangjie.rapidrouter.compiler.base;




/**
 * Author: wangjie
 * Email: tiantian.china.2@gmail.com
 * Date: 3/15/16.
 */
public abstract class BaseAbstractProcessor extends AbstractProcessor {
    protected Elements elementUtils;
    protected Types typeUtils;
    protected Filer filer;

    @Override
    public synchronized void init(ProcessingEnvironment processingEnv) {
        super.init(processingEnv);
// Path: library-compiler/src/main/java/com/wangjie/rapidrouter/compiler/util/GlobalEnvironment.java
// public class GlobalEnvironment {
//     private static ProcessingEnvironment processingEnv;
// 
//     public static void init(ProcessingEnvironment processingEnv){
//         GlobalEnvironment.processingEnv = processingEnv;
//     }
//     public static ProcessingEnvironment getProcessingEnv() {
//         return processingEnv;
//     }
// }
// 
// Path: library-compiler/src/main/java/com/wangjie/rapidrouter/compiler/util/LogUtil.java
// public class LogUtil {
//     public static final boolean LOG_CONTROL = true;
//     public static final boolean LOG_FILE = false;
//     private static SimpleDateFormat LOGGER_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:sss");
// 
// 
//     public static void loggerE(Throwable throwable) {
//         if (!LOG_CONTROL && !LOG_FILE) {
//             return;
//         }
//         logger("[ERROR]" + transformStackTrace(throwable));
//     }
// 
//     public static void logger(String str) {
//         if (!LOG_CONTROL && !LOG_FILE) {
//             return;
//         }
//         String loggerDate = "...[" + LOGGER_DATE_FORMAT.format(new Date()) + "]";
//         String log = loggerDate + ": " + str;
//         if (LOG_CONTROL) {
//             GlobalEnvironment.getProcessingEnv().getMessager().printMessage(Diagnostic.Kind.NOTE, log);
//         }
//         if (LOG_FILE) {
//             writeToDisk(log);
//         }
//     }
// 
//     private static void writeToDisk(String log) {
//         try {
//             File logFile = new File("/Users/wangjie/Desktop/za/test/rapidorm/processor_http.txt");
//             if (!logFile.exists()) {
//                 logFile.getParentFile().mkdirs();
//                 logFile.createNewFile();
//             }
//             FileWriter fw = new FileWriter(logFile, true);
//             fw.write(log + "\n\n");
//             fw.close();
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static StringBuilder transformStackTrace(StackTraceElement[] elements){
//         StringBuilder sb = new StringBuilder();
//         for(StackTraceElement element : elements){
//             sb.append(element.toString()).append("\r\n");
//         }
//         return sb;
//     }
//     public static String transformStackTrace(Throwable throwable){
//         if(null == throwable){
//             return "throwable is null";
//         }
//         StringBuilder sb = new StringBuilder(throwable.getMessage()).append("\n");
//         for(StackTraceElement element : throwable.getStackTrace()){
//             sb.append(element.toString()).append("\r\n");
//         }
//         return sb.toString();
//     }
// 
// }


// Path: library-compiler/src/main/java/com/wangjie/rapidrouter/compiler/base/BaseAbstractProcessor.java
import com.google.auto.common.MoreElements;
import com.wangjie.rapidrouter.compiler.util.GlobalEnvironment;
import com.wangjie.rapidrouter.compiler.util.LogUtil;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;

package com.wangjie.rapidrouter.compiler.base;




/**
 * Author: wangjie
 * Email: tiantian.china.2@gmail.com
 * Date: 3/15/16.
 */
public abstract class BaseAbstractProcessor extends AbstractProcessor {
    protected Elements elementUtils;
    protected Types typeUtils;
    protected Filer filer;

    @Override
    public synchronized void init(ProcessingEnvironment processingEnv) {
        super.init(processingEnv);
        GlobalEnvironment.init(processingEnv);