// Path: eventbus-annotation/src/main/java/com/shizhefei/eventbus/EventProxyNameBuilder.java
// public class EventProxyNameBuilder {
// 
//     public static String getProxyClassName(Class<? extends IEvent> eventClass) {
//         return getProxyClassName(eventClass.getPackage().getName(), eventClass.getName());
//     }
// 
//     public static String getProxyClassName(String packageName, String interfaceEventClassName) {
//         return packageName + "." + getProxySimpleClassName(packageName, interfaceEventClassName);
//     }
// 
//     public static String getProxySimpleClassName(String packageName, String interfaceEventClassName) {
//         String withoutPackageClassName = interfaceEventClassName.substring(packageName.length() + 1);
//         withoutPackageClassName = withoutPackageClassName.replaceAll("\\$", "_");
//         withoutPackageClassName = withoutPackageClassName.replaceAll("\\.", "_");
//         String name = withoutPackageClassName + "Proxy";
//         return name;
//     }
// 
//     public static String getRemoteClassParamName() {
//         return "eventClassName";
//     }
// }


import com.shizhefei.eventbus.EventProxyNameBuilder;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic;
import static javax.lang.model.element.Modifier.PUBLIC;
package com.shizhefei.eventbus.plugin;





/**
 * Created by LuckyJayce on 2017/4/29.
 */

public class EventProxyBuilder {
    private Messager messager;

    public EventProxyBuilder(Messager messager) {
        this.messager = messager;
    }

    public JavaFile build(boolean isRemoteEvent, TypeElement typeElement) {
        PackageElement packageElement = getPackage(typeElement);

        String eventImpPackageName = packageElement.getQualifiedName().toString();
// Path: eventbus-annotation/src/main/java/com/shizhefei/eventbus/EventProxyNameBuilder.java
// public class EventProxyNameBuilder {
// 
//     public static String getProxyClassName(Class<? extends IEvent> eventClass) {
//         return getProxyClassName(eventClass.getPackage().getName(), eventClass.getName());
//     }
// 
//     public static String getProxyClassName(String packageName, String interfaceEventClassName) {
//         return packageName + "." + getProxySimpleClassName(packageName, interfaceEventClassName);
//     }
// 
//     public static String getProxySimpleClassName(String packageName, String interfaceEventClassName) {
//         String withoutPackageClassName = interfaceEventClassName.substring(packageName.length() + 1);
//         withoutPackageClassName = withoutPackageClassName.replaceAll("\\$", "_");
//         withoutPackageClassName = withoutPackageClassName.replaceAll("\\.", "_");
//         String name = withoutPackageClassName + "Proxy";
//         return name;
//     }
// 
//     public static String getRemoteClassParamName() {
//         return "eventClassName";
//     }
// }


// Path: eventbus-compiler/src/main/java/com/shizhefei/eventbus/plugin/EventProxyBuilder.java
import com.shizhefei.eventbus.EventProxyNameBuilder;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic;
import static javax.lang.model.element.Modifier.PUBLIC;

package com.shizhefei.eventbus.plugin;





/**
 * Created by LuckyJayce on 2017/4/29.
 */

public class EventProxyBuilder {
    private Messager messager;

    public EventProxyBuilder(Messager messager) {
        this.messager = messager;
    }

    public JavaFile build(boolean isRemoteEvent, TypeElement typeElement) {
        PackageElement packageElement = getPackage(typeElement);

        String eventImpPackageName = packageElement.getQualifiedName().toString();
        String proxySimpleClassName = EventProxyNameBuilder.getProxySimpleClassName(eventImpPackageName, typeElement.getQualifiedName().toString());