Class GeneratorContext
java.lang.Object
io.micronaut.starter.application.generator.GeneratorContext
- All Implemented Interfaces:
DependencyContext
A context object used when generating projects.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorsConstructorDescriptionGeneratorContext
(Project project, ApplicationType type, Options options, OperatingSystem operatingSystem, Set<Feature> features, CoordinateResolver coordinateResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBuildPlugin
(BuildPlugin buildPlugin) void
addConfiguration
(Configuration configuration) void
addDependency
(Dependency dependency) void
addHelpLink
(String label, String href) Ads a Link to a single help filevoid
addHelpTemplate
(Writable writable) Adds a template which will be consolidated into a single help file.void
addProfile
(Profile profile) void
addTemplate
(String name, Template template) Adds a template.void
addTemplate
(String templateName, String triggerFile, com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) void
addTemplate
(String name, String path, TestRockerModelProvider testRockerModelProvider) void
getBootstrapConfiguration
(String env, BootstrapConfiguration defaultConfig) getConfiguration
(String env) getConfiguration
(String env, ApplicationConfiguration defaultConfig) getFeature
(Class<T> feature) <T extends Feature>
TgetRequiredFeature
(Class<T> feature) getSourcePath
(String path) getTestSourcePath
(String path) boolean
<T extends Feature>
booleanhasFeature
(Class<T> featureClass) boolean
isFeaturePresent
(Class<? extends Feature> feature) protected com.fizzed.rocker.RockerModel
parseModel
(com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) void
removeTemplate
(String name) Adds a template.resolveCoordinate
(String artifactId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.starter.build.dependencies.DependencyContext
addDependency
-
Constructor Details
-
GeneratorContext
public GeneratorContext(Project project, ApplicationType type, Options options, @Nullable OperatingSystem operatingSystem, Set<Feature> features, CoordinateResolver coordinateResolver)
-
-
Method Details
-
addTemplate
Adds a template.- Parameters:
name
- The name of the templatetemplate
- The template
-
removeTemplate
Adds a template.- Parameters:
name
- The name of the template
-
addHelpTemplate
Adds a template which will be consolidated into a single help file.- Parameters:
writable
- The template
-
addHelpLink
Ads a Link to a single help file- Parameters:
label
- Link's labelhref
- Link's uri
-
getBuildProperties
- Returns:
- The build properties
-
getConfiguration
- Returns:
- The configuration
-
getConfiguration
- Parameters:
env
- Environment- Returns:
- The configuration
-
hasConfigurationEnvironment
-
getConfiguration
@NonNull public ApplicationConfiguration getConfiguration(String env, ApplicationConfiguration defaultConfig) - Parameters:
env
- EnvironmentdefaultConfig
- Default Configuration- Returns:
- Application Configuration
-
getBootstrapConfiguration
- Parameters:
env
- Environment- Returns:
- The configuration
-
getBootstrapConfiguration
@NonNull public BootstrapConfiguration getBootstrapConfiguration(String env, BootstrapConfiguration defaultConfig) -
getBootstrapConfiguration
- Returns:
- The bootstrap config
-
addConfiguration
-
getAllConfigurations
-
getTemplates
- Returns:
- The templates
-
getHelpTemplates
- Returns:
- The templates
-
getLanguage
- Returns:
- The language
-
getTestFramework
- Returns:
- The test framework
-
getBuildTool
- Returns:
- The build tool
-
getAdditionalOptions
- Returns:
- A map containing additional options
-
getProject
- Returns:
- The project
-
getApplicationType
- Returns:
- The application type
-
getFeatures
- Returns:
- The selected features
-
getJdkVersion
- Returns:
- The JDK version
-
getOperatingSystem
- Returns:
- The current OS
-
applyFeatures
public void applyFeatures() -
isFeaturePresent
-
getFeature
-
getRequiredFeature
-
getSourcePath
-
getTestSourcePath
-
parseModel
protected com.fizzed.rocker.RockerModel parseModel(com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) -
addTemplate
-
addTemplate
-
addBuildPlugin
-
resolveCoordinate
-
addDependency
- Specified by:
addDependency
in interfaceDependencyContext
-
getDependencies
- Specified by:
getDependencies
in interfaceDependencyContext
-
getBuildPlugins
-
getModuleNames
-
addProfile
-
getProfiles
-
hasFeature
-