Java Code Examples for org.androidannotations.annotations.EBean

The following are top voted examples for showing how to use org.androidannotations.annotations.EBean. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: android-modules   File: InjectHandler.java   Source Code and License 6 votes vote down vote up
@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()
}