java.lang.Object
io.helidon.inject.tools.CodeGenFiler
This class is used to generate the source and resources originating from either annotation processing or maven-plugin
invocation. It also provides a circuit breaker in case the filer should be disabled from actually writing out source
and resources, and instead will use the filer's messager to report what it would have performed (applicable for apt cases).
-
Method Summary
Modifier and TypeMethodDescriptioncodegenJavaFilerOut
(TypeName typeName, String body) Code generate a java source file.void
codegenMetaInfServices
(io.helidon.inject.tools.CodeGenPaths paths, Map<String, List<String>> metaInfServices) Generate the meta-inf services given the provided map.codegenResourceFilerOut
(String outPath, String body) Code generates a resource.static CodeGenFiler
create
(AbstractFilerMessager filer) Creates a new code gen filer.static Path
scratchClassOutputPath
(Path targetOutputPath) Returns the path to the target scratch directory for Injection.static Path
targetClassOutputPath
(Filer filer) Returns the target class output directory.toString()
-
Method Details
-
create
Creates a new code gen filer.- Parameters:
filer
- the physical filer- Returns:
- a newly created code gen filer
-
scratchClassOutputPath
Returns the path to the target scratch directory for Injection.- Parameters:
targetOutputPath
- the target class output path- Returns:
- the target scratch path
-
targetClassOutputPath
Returns the target class output directory.- Parameters:
filer
- the filer- Returns:
- the path to the target class output directory
-
toString
-
codegenMetaInfServices
public void codegenMetaInfServices(io.helidon.inject.tools.CodeGenPaths paths, Map<String, List<String>> metaInfServices) Generate the meta-inf services given the provided map.- Parameters:
paths
- paths to where code should be writtenmetaInfServices
- the meta-inf services mapping
-
codegenResourceFilerOut
Code generates a resource.- Parameters:
outPath
- the path to output the resource tobody
- the resource body- Returns:
- file path coordinates corresponding to the resource in question, or empty if not generated
-
codegenJavaFilerOut
Code generate a java source file.- Parameters:
typeName
- the source type namebody
- the source body- Returns:
- the new file path coordinates or empty if nothing was written
-