本文整理汇总了Java中javax.annotation.processing.Processor.process方法的典型用法代码示例。如果您正苦于以下问题:Java Processor.process方法的具体用法?Java Processor.process怎么用?Java Processor.process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.annotation.processing.Processor
的用法示例。
在下文中一共展示了Processor.process方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import javax.annotation.processing.Processor; //导入方法依赖的package包/类
public boolean apply(Processor processor) {
ProcessingEnvironment processingEnvironment = mock(ProcessingEnvironment.class);
when(processingEnvironment.getOptions()).thenReturn(options);
when(processingEnvironment.getTypeUtils()).thenReturn(types);
when(processingEnvironment.getElementUtils()).thenReturn(elements);
processor.init(processingEnvironment);
return processor.process(environment.getAnnotations(), environment);
}
示例2: testWrappedProcessCall
import javax.annotation.processing.Processor; //导入方法依赖的package包/类
@Test
public void testWrappedProcessCall() {
AbstractProcessor processorSpy = Mockito.spy(AbstractProcessor.class);
Messager messager = Mockito.spy(Messager.class);
ProcessingEnvironment processingEnvironment = Mockito.spy(ProcessingEnvironment.class);
Mockito.when(processingEnvironment.getMessager()).thenReturn(messager);
Processor unit = AnnotationProcessorWrapper.wrapProcessor(processorSpy);
unit.init(processingEnvironment);
Set<? extends TypeElement> set = new HashSet<TypeElement>();
RoundEnvironment roundEnvironment = Mockito.mock(RoundEnvironment.class);
unit.process(set, roundEnvironment);
Mockito.verify(messager).printMessage(Diagnostic.Kind.NOTE, AbstractAnnotationProcessorTest.TEST_EXECUTION_MESSAGE);
Mockito.verify(processorSpy).process(set, roundEnvironment);
}
开发者ID:toolisticon,项目名称:annotation-processor-toolkit,代码行数:24,代码来源:AnnotationProcessorWrapperTest.java