Package manifold.api.type
Interface ICompilerComponent
-
public interface ICompilerComponentA service provider interface (SPI) for general purpose Java compiler manipulation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classICompilerComponent.InitOrderUsed withinitOrder(ICompilerComponent)to control when this service initializes relative to others.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidinit(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(com.sun.tools.javac.api.BasicJavacTask, manifold.internal.javac.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 voidtailorCompiler()Called when theJavacPlugininitializes and whenever the compiler context changes e.g., when annotation processors make rounds.
-
-
-
Method Detail
-
init
void init(com.sun.tools.javac.api.BasicJavacTask javacTask, TypeProcessor typeProcessor)Initializes this service.- Parameters:
javacTask- The Javac compiler task. Primarily used to callBasicJavacTask.addTaskListener(com.sun.source.util.TaskListener).typeProcessor- Manifold's type processor.
-
initOrder
default ICompilerComponent.InitOrder initOrder(ICompilerComponent compilerComponent)
Override to control the order in which this class'init(com.sun.tools.javac.api.BasicJavacTask, manifold.internal.javac.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.
-
-