java.lang.Object
io.helidon.pico.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.voidcodegenMetaInfServices(CodeGenPaths paths, Map<String, List<String>> metaInfServices) Generate the meta-inf services given the provided map.codegenResourceFilerOut(String outPath, String body, Optional<Function<InputStream, String>> optFnUpdater) Code generates a resource, providing the ability to update if the resource already exists.static CodeGenFilercreate(AbstractFilerMessager filer) Creates a new code gen filer.This map represents any move operations that were not capable at the time of code generation, that must be deferred until after the annotation processor has completed its round.
-
Method Details
-
create
Creates a new code gen filer.- Parameters:
filer- the physical filer- Returns:
- a newly created code gen filer
-
deferredMoves
This map represents any move operations that were not capable at the time of code generation, that must be deferred until after the annotation processor has completed its round.- Returns:
- map of deferred moves from source to target path locations
-
codegenMetaInfServices
Generate the meta-inf services given the provided map.- Parameters:
paths- paths to where code should be writtenmetaInfServices- the meta-inf services mapping
-
codegenResourceFilerOut
public Optional<Path> codegenResourceFilerOut(String outPath, String body, Optional<Function<InputStream, String>> optFnUpdater) Code generates a resource, providing the ability to update if the resource already exists.- Parameters:
outPath- the path to output the resource tobody- the resource bodyoptFnUpdater- the optional updater of the 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
-