- All Known Subinterfaces:
AptContext
,ScanContext
- All Known Implementing Classes:
CodegenContextBase
,CodegenContextDelegate
public interface CodegenContext
Code processing and generation context.
-
Method Summary
Modifier and TypeMethodDescriptionList of available annotation mappers in this environment.List of available element mappers in this environment.filer()
Filer to generate sources and resources.logger()
Logger to log messages according to the environment we run in (Annotation processor, Maven plugin, command line).Annotation packages supported by the mappers.Annotations supported by the mappers.module()
Module that is being processed.Configured module name usingCodegenOptions.CODEGEN_MODULE
, or name of the module if defined frommodule()
, or empty if not identified.options()
Code generation options.scope()
Current code generation scope.Codegen options supported by the mappers.Discover information about the provided type.typeInfo
(TypeName typeName, Predicate<TypedElementInfo> elementPredicate) Discover information about the provided type, with a predicate for child elements.List of available type mappers in this environment.
-
Method Details
-
module
Optional<ModuleInfo> module()Module that is being processed.- Returns:
- module info if defined, for modules without
module-info.java
returns empty optional
-
moduleName
Configured module name usingCodegenOptions.CODEGEN_MODULE
, or name of the module if defined frommodule()
, or empty if not identified.- Returns:
- name of the module
-
filer
CodegenFiler filer()Filer to generate sources and resources.- Returns:
- a filer abstraction
-
logger
CodegenLogger logger()Logger to log messages according to the environment we run in (Annotation processor, Maven plugin, command line).- Returns:
- a logger abstraction
-
scope
CodegenScope scope()Current code generation scope. Usually guessed from the environment, can be overridden usingCodegenOptions.CODEGEN_SCOPE
- Returns:
- scope
-
options
CodegenOptions options()Code generation options.- Returns:
- options of the current environment
-
typeInfo
Discover information about the provided type.- Parameters:
typeName
- type name to discover- Returns:
- discovered type information, or empty if the type cannot be discovered
-
typeInfo
Discover information about the provided type, with a predicate for child elements.- Parameters:
typeName
- type name to discoverelementPredicate
- predicate for child elements- Returns:
- discovered type information, or empty if the type cannot be discovered
-
elementMappers
List<ElementMapper> elementMappers()List of available element mappers in this environment. Used for example when discoveringtypeInfo(io.helidon.common.types.TypeName)
.- Returns:
- list of mapper
-
typeMappers
List<TypeMapper> typeMappers()List of available type mappers in this environment. Used for example when discoveringtypeInfo(io.helidon.common.types.TypeName)
.- Returns:
- list of mapper
-
annotationMappers
List<AnnotationMapper> annotationMappers()List of available annotation mappers in this environment. Used for example when discoveringtypeInfo(io.helidon.common.types.TypeName)
.- Returns:
- list of mapper
-
mapperSupportedAnnotations
Annotations supported by the mappers. This is augmented by the annotations supported by all extensions and used to discover types.- Returns:
- set of annotation types supported by the mapper
-
mapperSupportedAnnotationPackages
Annotation packages supported by the mappers. This is augmented by the annotation packages supported by all extensions and used to discover types.- Returns:
- set of annotation packages
-
supportedOptions
Codegen options supported by the mappers. This is augmented by the options supported by all extensions.- Returns:
- set of supported options
-