Last active
January 5, 2017 08:32
-
-
Save babedev/c4827ba1b57da02240941d0727207bf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void generatePresenter() throws IOException { | |
MethodSpec attachView = MethodSpec.methodBuilder("attachView") | |
.addJavadoc(CodeBlock.of("Attach View")) | |
.addParameter(getViewType(), "view") | |
.addStatement("mView = view") | |
.build(); | |
TypeSpec mvpPresenter = TypeSpec.classBuilder(featureName + "Presenter") | |
.addMethod(attachView) | |
.addField(getViewType(), "mView", Modifier.PRIVATE) | |
.build(); | |
JavaFile javaFile = JavaFile.builder(packageName + "." + featureName.toLowerCase(), mvpPresenter) | |
.build(); | |
File file = new File("app/src/main/java"); | |
javaFile.writeTo(file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment