Class CopilotExperimentalProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
com.github.copilot.CopilotExperimentalProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes("*")
@SupportedOptions("copilot.experimental.allowed")
@SupportedSourceVersion(RELEASE_17)
public class CopilotExperimentalProcessor
extends AbstractProcessor
Annotation processor that enforces compile-time gating of experimental APIs.
Any declaration-level reference to a type or method annotated with
CopilotExperimental in consumer source code causes a compilation
error unless the compiler option -Acopilot.experimental.allowed=true
is provided or the consuming declaration is annotated with
AllowCopilotExperimental.
This processor uses only standard JSR 269 APIs (javax.lang.model.*)
and works with any Java compiler (javac, ECJ, etc.). It checks declarations
(field types, method parameters, return types, supertypes, thrown types) but
does not inspect method body expressions.
- Since:
- 1.0.0
-
Field Summary
Fields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) Methods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
-
Constructor Details
-
CopilotExperimentalProcessor
public CopilotExperimentalProcessor()
-
-
Method Details
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-