Class GeneratorContext
java.lang.Object
io.micronaut.projectgen.core.generator.GeneratorContext
A context object used when generating projects.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGeneratorContext
(Project project, Options options, Set<Feature> features, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply features.findFrameworkDocumentationByRecipeName
(@NonNull String recipeName) findThirdPartyDocumentationByRecipeName
(@NonNull String recipeName) @NonNull BuildTool
Deprecated, for removal: This API element is subject to removal in a future version.getFeature
(Class<T> feature) @NonNull Features
@NonNull JdkVersion
@NonNull Language
getModuleByName
(String name) @NonNull Options
@NonNull Project
<T extends Feature>
TgetRequiredFeature
(Class<T> feature) getSourcePath
(String path) @NonNull TestFramework
getTestSourcePath
(String path) <T extends Feature>
booleanhasFeature
(Class<T> featureClass) boolean
isFeatureMissing
(Class<? extends Feature> feature) boolean
isFeaturePresent
(Class<? extends Feature> feature) resolveCoordinate
(String artifactId)
-
Field Details
-
ROOT_PROJECT
- See Also:
-
-
Constructor Details
-
GeneratorContext
public GeneratorContext(Project project, Options options, Set<Feature> features, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher)
-
-
Method Details
-
getRootModule
-
getModuleByName
-
getLanguage
- Returns:
- The language
-
getOptions
- Returns:
- Options
-
getBuildTool
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The test framework
-
getTestFramework
- Returns:
- The test framework
-
getProject
- Returns:
- The project
-
getFeatures
- Returns:
- The selected features
-
getJdkVersion
- Returns:
- The JDK version
-
applyFeatures
public void applyFeatures()Apply features. -
isFeaturePresent
- Parameters:
feature
- Feature is present- Returns:
- Whether the feature is present
-
isFeatureMissing
- Parameters:
feature
- Feature is present- Returns:
- Whether the feature is missing
-
getFeature
- Type Parameters:
T
- feature Type- Parameters:
feature
- Feature is present- Returns:
- the feature
-
getRequiredFeature
- Type Parameters:
T
- feature Type- Parameters:
feature
- Feature is present- Returns:
- the feature
-
getSourcePath
- Parameters:
path
- Path- Returns:
- source path
-
getTestSourcePath
- Parameters:
path
- Path- Returns:
- test path
-
resolveCoordinate
- Parameters:
artifactId
- Artifact ID- Returns:
- The coordinate
-
getModuleNames
- Returns:
- Module Names
-
hasFeature
- Type Parameters:
T
- feature Type- Parameters:
featureClass
- Feature class- Returns:
- Whether the feature is present
-
findFrameworkDocumentationByRecipeName
- Parameters:
recipeName
- recipe Name- Returns:
- documentation
-
findThirdPartyDocumentationByRecipeName
public Optional<String> findThirdPartyDocumentationByRecipeName(@NonNull @NonNull String recipeName) - Parameters:
recipeName
- recipe Name- Returns:
- documentation
-