Package io.quarkus.deployment
Interface CodeGenProvider
public interface CodeGenProvider
Service providers for this interface are triggered during generate-sources phase of build of Quarkus applications
-
Method Summary
Modifier and TypeMethodDescriptiondefault PathProvides the possibility for the provider to override the default input directory.default voidProvides the possibility for the provider to initialize itself using the application model and properties.Name of the directory containing input files for a givenCodeGenProviderimplementation relative to a sources root directory.default StringDeprecated.default String[]File extensions that CodeGenProvider will generate code fromstatic PathResolve path; e.g.default booleanbooleantrigger(CodeGenContext context) Trigger code generation
-
Method Details
-
providerId
- Returns:
- unique name of the code gen provider, will correspond to the directory in
generated-sources
-
inputExtension
Deprecated.File extension that CodeGenProvider will generate code from Deprecated: use inputExtensions instead- Returns:
- file extension
-
inputExtensions
File extensions that CodeGenProvider will generate code from- Returns:
- file extensions
-
inputDirectory
Name of the directory containing input files for a givenCodeGenProviderimplementation relative to a sources root directory. For example, if an input directory is configured asfoo, for a production build of an application the sources will be looked up atsrc/main/foopath and atsrc/test/foofor tests.- Returns:
- the input directory
-
getInputDirectory
Provides the possibility for the provider to override the default input directory. This method is called afterinit(ApplicationModel, Map). Returningnullwill result in theinputDirectorymethod being called to retrieve the default input directory.The returned path must be an absolute path. However, pointing to a directory outside of the project structure should be avoided for security purposes.
- Returns:
- the input directory, must be an absolute path.
nullwould result in the default input directory being used.
-
init
Provides the possibility for the provider to initialize itself using the application model and properties.- Parameters:
model- the application modelproperties- the build time properties defined in the application build file (pom.xml or gradle.build)
-
trigger
Trigger code generation- Parameters:
context- code generation context- Returns:
- true if files were generated/modified
- Throws:
CodeGenException
-
shouldRun
-
resolve
Resolve path; e.g. symlinks, etc- Parameters:
path- the path to resolve- Returns:
- resolved path
-