@RequiresApi(api = Build.VERSION_CODES.GINGERBREAD) @Test public void init() throws Exception { JavaFileObject fileObject = JavaFileObjects.forSourceLines("ObjectHolder", "package ru.lliepmah.lib;", "", "import android.view.View;", "import ru.lliepmah.HolderBuilder;", "", "", "@HolderBuilder(1)", "public class ObjectHolder extends DefaultViewHolder<Object> {", " ", " public ObjectHolder(View itemView) {", " super(itemView);", " }", "", " @Override", " public void bind(Object model) {}", " ", "}"); JavaFileObject defaultViewHolderFile = readFile(PATH_LIBRARY_SOURCES, "DefaultViewHolder"); JavaFileObject builderFile = readFile(PATH_LIBRARY_SOURCES, "Builder"); Preconditions.checkArgument(true); Truth.assertAbout(JavaSourcesSubjectFactory.javaSources()) .that(Arrays.asList(fileObject, defaultViewHolderFile, builderFile)) .processedWith(new HolderBuilderProcessor()) .compilesWithoutError() .and() .generatesFileNamed(StandardLocation.CLASS_OUTPUT, "ru.lliepmah.lib", "ObjectHolderBuilder.class") .and() .generatesSources( loadBuilderSource("ObjectHolder", "ru.lliepmah.lib", 1, "Object", "java.lang")); }
@Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); mErrorReporter = new ErrorReporter(processingEnv); }
HolderBuilderProcessor extends AbstractProcessor { @Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); mErrorReporter = new ErrorReporter(processingEnv); } }
HolderBuilderProcessor extends AbstractProcessor { @Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); mErrorReporter = new ErrorReporter(processingEnv); }  }
HolderBuilderProcessor extends AbstractProcessor { @Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); mErrorReporter = new ErrorReporter(processingEnv); }  @Override synchronized void init(ProcessingEnvironment processingEnv); @Override Set<String> getSupportedAnnotationTypes(); @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment env); }
HolderBuilderProcessor extends AbstractProcessor { @Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); mErrorReporter = new ErrorReporter(processingEnv); }  @Override synchronized void init(ProcessingEnvironment processingEnv); @Override Set<String> getSupportedAnnotationTypes(); @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment env);  }