1 /*******************************************************************************
2  * Copyright (c) 2006, 2009 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *     BEA - Patch for bug 172743
11  *******************************************************************************/
12 package org.eclipse.jdt.internal.compiler;
13 
14 import java.io.PrintWriter;
15 
16 import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
17 import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
18 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
19 
20 public abstract class AbstractAnnotationProcessorManager {
21 	/**
22 	 * Configure the receiver using the given batch compiler and the given options.
23 	 * The parameter batchCompiler is expected to be an instance of the batch compiler. This method is
24 	 * only used for the batch mode. For the IDE mode, please see {@link #configureFromPlatform(Compiler, Object, Object)}.
25 	 *
26 	 * @param batchCompiler the given batch compiler object
27 	 * @param options the given options
28 	 */
configure(Object batchCompiler, String[] options)29 	public abstract void configure(Object batchCompiler, String[] options);
30 
31 	/**
32 	 * Configure the receiver using the given compiler, the given compilationUnitLocator and
33 	 * the given java project.
34 	 *
35 	 * @param compiler the given compiler
36 	 * @param compilationUnitLocator the given compilation unit locator
37 	 * @param javaProject the given java project
38 	 */
configureFromPlatform(Compiler compiler, Object compilationUnitLocator, Object javaProject)39 	public abstract void configureFromPlatform(Compiler compiler, Object compilationUnitLocator, Object javaProject);
40 
41 	/**
42 	 * Set the print writer for the standard output.
43 	 *
44 	 * @param out the given print writer for output
45 	 */
setOut(PrintWriter out)46 	public abstract void setOut(PrintWriter out);
47 
48 	/**
49 	 * Set the print writer for the standard error.
50 	 *
51 	 * @param err the given print writer for error
52 	 */
setErr(PrintWriter err)53 	public abstract void setErr(PrintWriter err);
54 
55 	/**
56 	 * Return the new units created in the last round.
57 	 *
58 	 * @return the new units created in the last round
59 	 */
getNewUnits()60 	public abstract ICompilationUnit[] getNewUnits();
61 
62 	/**
63 	 * Return the new binary bindings created in the last round.
64 	 *
65 	 * @return the new binary bindings created in the last round
66 	 */
getNewClassFiles()67 	public abstract ReferenceBinding[] getNewClassFiles();
68 
69 	/**
70 	 * Returns the deleted units.
71 	 * @return the deleted units
72 	 */
getDeletedUnits()73 	public abstract ICompilationUnit[] getDeletedUnits();
74 
75 	/**
76 	 * Reinitialize the receiver
77 	 */
reset()78 	public abstract void reset();
79 
80 	/**
81 	 * Run a new annotation processing round on the given values.
82 	 *
83 	 * @param units the given source type
84 	 * @param referenceBindings the given binary types
85 	 * @param isLastRound flag to notify the last round
86 	 */
processAnnotations(CompilationUnitDeclaration[] units, ReferenceBinding[] referenceBindings, boolean isLastRound)87 	public abstract void processAnnotations(CompilationUnitDeclaration[] units, ReferenceBinding[] referenceBindings, boolean isLastRound);
88 
89 	/**
90 	 * Set the processors for annotation processing.
91 	 *
92 	 * @param processors the given processors
93 	 */
setProcessors(Object[] processors)94 	public abstract void setProcessors(Object[] processors);
95 }
96