public interface ICompilerComponent
Modifier and Type | Interface and Description |
---|---|
static class |
ICompilerComponent.InitOrder
Used with
initOrder(ICompilerComponent) to control when this service initializes relative to others. |
Modifier and Type | Method and Description |
---|---|
void |
init(com.sun.tools.javac.api.BasicJavacTask javacTask,
TypeProcessor typeProcessor)
Initializes this service.
|
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 other ICompilerComponent
services. |
default boolean |
isSuppressed(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos,
String issueKey,
Object[] args)
Suppresses the compiler warning/error specified by
issueKey . |
default void |
tailorCompiler()
Called when the
JavacPlugin initializes and whenever the compiler context changes e.g., when annotation
processors make rounds. |
void init(com.sun.tools.javac.api.BasicJavacTask javacTask, TypeProcessor typeProcessor)
javacTask
- The Javac compiler task. Primarily used to call BasicJavacTask.addTaskListener(com.sun.source.util.TaskListener)
.typeProcessor
- Manifold's type processor.default ICompilerComponent.InitOrder initOrder(ICompilerComponent compilerComponent)
init(com.sun.tools.javac.api.BasicJavacTask, manifold.internal.javac.TypeProcessor)
method is called relative to other ICompilerComponent
services. This method is called for each ICompilerComponent
, excluding this one.
Returning Before
for multiple compilerComponent
s maintains the earliest position. Returning After
multiple times maintains the latest position. Returning both Before
and After
maintains the latest
After
position.compilerComponent
- A compiler component service from the set of services currently registered.compilerComponent
.default boolean isSuppressed(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos, String issueKey, Object[] args)
issueKey
.pos
- issueKey
- The compiler warning/error in question. These are the javac coded message keys such as those
beginning with "compiler.err.".args
- true
if the message should be suppressed.default void tailorCompiler()
JavacPlugin
initializes 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.Copyright © 2024. All rights reserved.