本文整理匯總了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