Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e776ad6c48b5809066ea42e77cb1f6d3b0ffabd2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2006, 2007 BEA Systems, Inc. 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    wharley@bea.com - initial API and implementation
 *    
 *******************************************************************************/

package org.eclipse.jdt.internal.compiler.apt.dispatch;

import java.util.List;

import javax.annotation.processing.Processor;

/**
 * Implementors know how to discover annotation processors, and maintain a list of processors that
 * have been discovered and initialized so far.
 */
public interface IProcessorProvider {

	/**
	 * Return the next processor that can be discovered, according to the order and discovery rules
	 *         of the provider (see, for instance, {@link Processor}.
	 * @return a ProcessorInfo wrapping an initialized Processor, or <code>null</code> if there are
	 * no more processors to be discovered.
	 */
	ProcessorInfo discoverNextProcessor();

	/**
	 * @return the list of all processors that have been discovered so far. This list will grow when
	 *         {@link #discoverNextProcessor()} is called.
	 */
	List<ProcessorInfo> getDiscoveredProcessors();
	
	/**
	 * Called when a processor throws an exception.  This may abort compilation, throw an
	 * unchecked exception, etc; the caller should not assume that this method will return.
	 * 
	 * @param p the processor, if known, or null if not.
	 * @param e
	 */
	void reportProcessorException(Processor p, Exception e);
}

Back to the top