Interface ICompilerComponent
public interface ICompilerComponent
A service provider interface (SPI) for general purpose Java compiler manipulation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumUsed withinitOrder(ICompilerComponent)to control when this service initializes relative to others. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(com.sun.tools.javac.api.BasicJavacTask javacTask, TypeProcessor typeProcessor) Initializes this service.default ICompilerComponent.InitOrderinitOrder(ICompilerComponent compilerComponent) Override to control the order in which this class'init(BasicJavacTask, TypeProcessor)method is called relative to otherICompilerComponentservices.default booleanisSuppressed(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos, String issueKey, Object[] args) Suppresses the compiler warning/error specified byissueKey.default voidCalled when theJavacPlugininitializes and whenever the compiler context changes e.g., when annotation processors make rounds.
-
Method Details
-
init
Initializes this service.- Parameters:
javacTask- The Javac compiler task. Primarily used to callBasicJavacTask.addTaskListener(TaskListener).typeProcessor- Manifold's type processor.
-
initOrder
Override to control the order in which this class'init(BasicJavacTask, TypeProcessor)method is called relative to otherICompilerComponentservices. This method is called for eachICompilerComponent, excluding this one. ReturningBeforefor multiplecompilerComponents maintains the earliest position. ReturningAftermultiple times maintains the latest position. Returning bothBeforeandAftermaintains the latestAfterposition.- Parameters:
compilerComponent- A compiler component service from the set of services currently registered.- Returns:
- Whether this service should initialize before or after
compilerComponent.
-
isSuppressed
default boolean isSuppressed(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos, String issueKey, Object[] args) Suppresses the compiler warning/error specified byissueKey.- Parameters:
pos-issueKey- The compiler warning/error in question. These are the javac coded message keys such as those beginning with "compiler.err.".args-- Returns:
- Returns
trueif the message should be suppressed.
-
tailorCompiler
default void tailorCompiler()Called when theJavacPlugininitializes and whenever the compiler context changes e.g., when annotation processors make rounds. This is where, if need be, you hack into the compiler before compilation starts e.g., to override or replace part of the compiler.
-