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
-
Field Summary
Fields inherited from interface io.micronaut.starter.build.dependencies.DependencyContext
IS_COMPILE_API_OR_RUNTIME
-
Constructor Summary
ConstructorDescriptionGeneratorContext
(Project project, ApplicationType type, Options options, @Nullable OperatingSystem operatingSystem, Set<Feature> features, CoordinateResolver coordinateResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBuildPlugin
(BuildPlugin buildPlugin) void
addConfiguration
(@NonNull Configuration configuration) void
addDependency
(@NonNull 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
(@NonNull 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
long
countDependencies
(@NonNull String groupId) @NonNull Set<Configuration>
@NonNull ApplicationType
@NonNull BootstrapConfiguration
@Nullable BootstrapConfiguration
@NonNull BootstrapConfiguration
getBootstrapConfiguration
(String env, BootstrapConfiguration defaultConfig) @NonNull BuildProperties
@NonNull BuildTool
@NonNull ApplicationConfiguration
@Nullable ApplicationConfiguration
getConfiguration
(String env) @NonNull ApplicationConfiguration
getConfiguration
(String env, ApplicationConfiguration defaultConfig) @NonNull Collection<Dependency>
getFeature
(Class<T> feature) @NonNull Features
@NonNull String
@NonNull JdkVersion
@NonNull Language
@Nullable OperatingSystem
@NonNull Collection<Profile>
@NonNull Project
<T extends Feature>
TgetRequiredFeature
(Class<T> feature) getSourcePath
(String path) @NonNull TestFramework
getTestSourcePath
(String path) boolean
hasConfigurationEnvironment
(@NonNull String env) boolean
hasDependency
(@NonNull String groupId, @NonNull String artifactId) boolean
hasDependencyInScope
(@NonNull String groupId, @NonNull String artifactId, @NonNull Scope scope) <T extends Feature>
booleanhasFeature
(Class<T> featureClass) boolean
isFeatureMissing
(Class<? extends Feature> feature) boolean
isFeaturePresent
(Class<? extends Feature> feature) boolean
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, removeDuplicates
-
Constructor Details
-
GeneratorContext
public GeneratorContext(Project project, ApplicationType type, Options options, @Nullable @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 @NonNull ApplicationConfiguration getConfiguration(String env, ApplicationConfiguration defaultConfig) - Parameters:
env
- EnvironmentdefaultConfig
- Default Configuration- Returns:
- Application Configuration
-
getBootstrapConfiguration
- Parameters:
env
- Environment- Returns:
- The configuration
-
getBootstrapConfiguration
@NonNull public @NonNull 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
-
getFramework
- Returns:
- The 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
-
isFeatureMissing
-
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
-
isMicronautFramework
public boolean isMicronautFramework() -
hasDependencyInScope
-
hasDependency
-
countDependencies
-