Java 类org.androidannotations.annotations.EBean 实例源码

项目:android-modules    文件:InjectHandler.java   
@Override
public void process(Element element, EComponentHolder holder) throws Exception {

    // I just copied this block from BeanHandler, I'm not sure I understand it
    TypeMirror typeMirror = annotationHelper.extractAnnotationClassParameter(element);
    if (typeMirror == null) {
        typeMirror = element.asType();
        typeMirror = holder.processingEnvironment().getTypeUtils().erasure(typeMirror);
    }

    JClass injectedClass = refClass(typeMirror.toString());
    JFieldRef injectField = ref(element.getSimpleName().toString());

    final JBlock initBody = holder.getInitBody();
    initBody.assign(injectField, ModuleCodeGenerator.moduleGetInstanceOrAddDefaultIfNeeded(holder, annotationHelper, holder.getGeneratedClass(), holder.getInit(), injectedClass, "", typeHasAnnotation(typeMirror, EBean.class))); // field = Module.getInstance()
}