当前位置: 首页>>代码示例>>Java>>正文


Java InjectPresenter类代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:MvpCompiler.java

示例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();
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:PresenterInjectorRules.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:MvpCompiler.java


注:本文中的com.arellomobile.mvp.presenter.InjectPresenter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。