// Path: easymvp-api/src/main/java/easymvp/Presenter.java
// public interface Presenter<V> {
// 
//     /**
//      * Called when the view attached to the screen.
//      * <p>
//      * This method will be invoked during {@link android.app.Activity#onStart()}, {@link android.app.Fragment#onResume()}
//      * and {@link android.view.View#onAttachedToWindow()}.
//      * @param view the view that the presenter interacts with
//      */
//     void onViewAttached(V view);
// 
//     /**
//      * Called when the view detached from the screen.
//      * <p>
//      * This method will be invoked during {@link android.app.Activity#onStop()}, {@link android.app.Fragment#onPause()}
//      * and {@link android.view.View#onDetachedFromWindow()}.
//      */
//     void onViewDetached();
// 
//     /**
//      * Called when a user leaves the view completely. After the invocation of this method, presenter instance will be destroyed.
//      * <p>
//      * Note that on configuration changes like rotation, presenter instance will be alive.
//      */
//     void onDestroyed();
// 
//     /**
//      * @return Returns true if the view is currently attached to the presenter, otherwise returns false.
//      **/
//     boolean isViewAttached();
// 
//     /**
//      * @return Returns the attached view. If view is already detached, null will be returned.
//      */
//     @Nullable
//     V getView();
// }
// 
// Path: easymvp-compiler/src/main/java/easymvp/compiler/util/ClassNames.java
// public static final ClassName CONTEXT = ClassName.get("android.content", "Context");
// 
// Path: easymvp-compiler/src/main/java/easymvp/compiler/util/ClassNames.java
// public static final ClassName PROVIDER = ClassName.get("javax.inject", "Provider");


import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName;
import javax.lang.model.element.Modifier;
import easymvp.Presenter;
import static easymvp.compiler.util.ClassNames.CONTEXT;
import static easymvp.compiler.util.ClassNames.PROVIDER;
package easymvp.compiler.generator;





/**
 * @author Saeed Masoumi (saeed@6thsolution.com)
 */
public final class PresenterLoaderGenerator extends ClassGenerator {
    private static final String METHOD_GET_PRESENTER = "get";
    private static final TypeName PRESENTER_FACTORY_FIELD =
// Path: easymvp-api/src/main/java/easymvp/Presenter.java
// public interface Presenter<V> {
// 
//     /**
//      * Called when the view attached to the screen.
//      * <p>
//      * This method will be invoked during {@link android.app.Activity#onStart()}, {@link android.app.Fragment#onResume()}
//      * and {@link android.view.View#onAttachedToWindow()}.
//      * @param view the view that the presenter interacts with
//      */
//     void onViewAttached(V view);
// 
//     /**
//      * Called when the view detached from the screen.
//      * <p>
//      * This method will be invoked during {@link android.app.Activity#onStop()}, {@link android.app.Fragment#onPause()}
//      * and {@link android.view.View#onDetachedFromWindow()}.
//      */
//     void onViewDetached();
// 
//     /**
//      * Called when a user leaves the view completely. After the invocation of this method, presenter instance will be destroyed.
//      * <p>
//      * Note that on configuration changes like rotation, presenter instance will be alive.
//      */
//     void onDestroyed();
// 
//     /**
//      * @return Returns true if the view is currently attached to the presenter, otherwise returns false.
//      **/
//     boolean isViewAttached();
// 
//     /**
//      * @return Returns the attached view. If view is already detached, null will be returned.
//      */
//     @Nullable
//     V getView();
// }
// 
// Path: easymvp-compiler/src/main/java/easymvp/compiler/util/ClassNames.java
// public static final ClassName CONTEXT = ClassName.get("android.content", "Context");
// 
// Path: easymvp-compiler/src/main/java/easymvp/compiler/util/ClassNames.java
// public static final ClassName PROVIDER = ClassName.get("javax.inject", "Provider");


// Path: easymvp-compiler/src/main/java/easymvp/compiler/generator/PresenterLoaderGenerator.java
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName;
import javax.lang.model.element.Modifier;
import easymvp.Presenter;
import static easymvp.compiler.util.ClassNames.CONTEXT;
import static easymvp.compiler.util.ClassNames.PROVIDER;

package easymvp.compiler.generator;





/**
 * @author Saeed Masoumi (saeed@6thsolution.com)
 */
public final class PresenterLoaderGenerator extends ClassGenerator {
    private static final String METHOD_GET_PRESENTER = "get";
    private static final TypeName PRESENTER_FACTORY_FIELD =
            ParameterizedTypeName.get(PROVIDER, TypeVariableName.get("P"));