本文整理汇总了Java中com.arellomobile.mvp.presenter.InjectPresenter类的典型用法代码示例。如果您正苦于以下问题:Java InjectPresenter类的具体用法?Java InjectPresenter怎么用?Java InjectPresenter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InjectPresenter类属于com.arellomobile.mvp.presenter包,在下文中一共展示了InjectPresenter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: throwableProcess
import com.arellomobile.mvp.presenter.InjectPresenter; //导入依赖的package包/类
private boolean throwableProcess(RoundEnvironment roundEnv) {
checkInjectors(roundEnv, InjectPresenter.class, new PresenterInjectorRules(ElementKind.FIELD, Modifier.PUBLIC, Modifier.DEFAULT));
ViewStateProviderClassGenerator viewStateProviderClassGenerator = new ViewStateProviderClassGenerator();
PresenterBinderClassGenerator presenterBinderClassGenerator = new PresenterBinderClassGenerator();
processInjectors(roundEnv, InjectViewState.class, ElementKind.CLASS, viewStateProviderClassGenerator);
processInjectors(roundEnv, InjectPresenter.class, ElementKind.FIELD, presenterBinderClassGenerator);
ViewStateClassGenerator viewStateClassGenerator = new ViewStateClassGenerator();
Set<TypeElement> usedViews = viewStateProviderClassGenerator.getUsedViews();
for (TypeElement usedView : usedViews) {
generateCode(ElementKind.INTERFACE, viewStateClassGenerator, usedView);
}
String moxyReflector = MoxyReflectorGenerator.generate(viewStateProviderClassGenerator.getPresenterClassNames(), presenterBinderClassGenerator.getPresentersContainers(), viewStateClassGenerator.getStrategyClasses());
ClassGeneratingParams classGeneratingParams = new ClassGeneratingParams();
classGeneratingParams.setName("com.arellomobile.mvp.MoxyReflector");
classGeneratingParams.setBody(moxyReflector);
createSourceFile(classGeneratingParams);
return true;
}
示例2: checkAnnotation
import com.arellomobile.mvp.presenter.InjectPresenter; //导入依赖的package包/类
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
@Override
public void checkAnnotation(Element annotatedField) {
checkEnvironment(annotatedField);
if (annotatedField.getKind() != mValidKind) {
mErrorBuilder.append("Field " + annotatedField + " of " + annotatedField.getEnclosingElement().getSimpleName() + " should be " + mValidKind.name() + ", or not mark it as @" + InjectPresenter.class.getSimpleName()).append("\n");
}
for (Modifier modifier : annotatedField.getModifiers()) {
if (!mValidModifiers.contains(modifier)) {
mErrorBuilder.append("Field " + annotatedField + " of " + annotatedField.getEnclosingElement().getSimpleName() + " can't be a " + modifier).append(". Use ").append(validModifiersToString()).append("\n");
}
}
Element enclosingElement = annotatedField.getEnclosingElement();
while (enclosingElement.getKind() == ElementKind.CLASS) {
if (!enclosingElement.getModifiers().contains(Modifier.PUBLIC)) {
mErrorBuilder.append(enclosingElement.getSimpleName() + " should be PUBLIC ");
break;
}
enclosingElement = enclosingElement.getEnclosingElement();
}
}
示例3: getSupportedAnnotationTypes
import com.arellomobile.mvp.presenter.InjectPresenter; //导入依赖的package包/类
@Override
public Set<String> getSupportedAnnotationTypes() {
Set<String> supportedAnnotationTypes = new HashSet<>();
Collections.addAll(supportedAnnotationTypes, InjectPresenter.class.getCanonicalName(), InjectViewState.class.getCanonicalName(), GenerateViewState.class.getCanonicalName());
return supportedAnnotationTypes;
}