Class Ktor
java.lang.Object
io.micronaut.starter.feature.kotlin.Ktor
- All Implemented Interfaces:
io.micronaut.core.naming.Described
,io.micronaut.core.naming.Named
,io.micronaut.core.order.Ordered
,ApplicationFeature
,Feature
,KotlinApplicationFeature
,KotlinSpecificFeature
,LanguageSpecificFeature
,OneOfFeature
,OpenRewriteFeature
,ServerFeature
,ThirdPartyServerFeature
@Requires(property="micronaut.starter.feature.ktor.enabled",
value="true",
defaultValue="true")
@Singleton
public class Ktor
extends Object
implements KotlinApplicationFeature, ThirdPartyServerFeature, KotlinSpecificFeature, OpenRewriteFeature
-
Field Summary
FieldsFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(GeneratorContext generatorContext) If this method is called for a given feature that means the feature was explicitly selected, included by default as a result ofDefaultFeature.shouldApply(io.micronaut.starter.options.Options, java.util.Set)
, or added explicitly by another feature throughFeatureContext.addFeature(Feature)
.@NonNull String
getName()
The name of the feature.int
getOrder()
The order of a feature controls the order in which it applies.getRecipes
(GeneratorContext generatorContext) getTitle()
boolean
Some features should not be visible to the user because they are a common parent of other selectable features, or they should always be applied, or any other reason.@Nullable String
mainClassName
(GeneratorContext generatorContext) void
processSelectedFeatures
(FeatureContext featureContext) If this method is called for a given feature then that feature was explicitly selected or was included by default as a result ofDefaultFeature.shouldApply(io.micronaut.starter.options.Options, java.util.Set)
.boolean
This method must be implemented to ensure it is only selectable for the desired application types.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.naming.Described
getDescription
Methods inherited from interface io.micronaut.projectgen.core.feature.Feature
isCommunity, isPreview
Methods inherited from interface io.micronaut.projectgen.core.feature.KotlinSpecificFeature
getRequiredLanguage
Methods inherited from interface io.micronaut.projectgen.core.openrewrite.OpenRewriteFeature
getFrameworkDocumentation, getThirdPartyDocumentation, processRecipes
Methods inherited from interface io.micronaut.starter.feature.server.ServerFeature
getFeatureClass
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
Ktor
-
-
Method Details
-
supports
Description copied from interface:Feature
This method must be implemented to ensure it is only selectable for the desired application types. This method is not used for determining if a default feature should be applied.- Specified by:
supports
in interfaceFeature
- Specified by:
supports
in interfaceServerFeature
- Parameters:
options
- Options- Returns:
- True if the feature can be selected by the user
-
processSelectedFeatures
Description copied from interface:Feature
If this method is called for a given feature then that feature was explicitly selected or was included by default as a result ofDefaultFeature.shouldApply(io.micronaut.starter.options.Options, java.util.Set)
. This method can be implemented to allow features to modify the list of features that will apply to the project. The methodsFeatureContext.addFeature(Feature)
andFeatureContext.exclude(FeaturePredicate)
are the primary ways to add and remove features from the context.FeatureContext.isPresent(Class)
can be used to determine the existence of other features in order to make decisions.- Specified by:
processSelectedFeatures
in interfaceFeature
- Parameters:
featureContext
- The feature context
-
getName
Description copied from interface:Feature
The name of the feature. It must be unique. -
getDescription
- Specified by:
getDescription
in interfaceio.micronaut.core.naming.Described
- Specified by:
getDescription
in interfaceFeature
-
getTitle
-
getCategory
- Specified by:
getCategory
in interfaceFeature
- Specified by:
getCategory
in interfaceServerFeature
- Returns:
- The Category to which the feature belongs to.
-
mainClassName
- Specified by:
mainClassName
in interfaceApplicationFeature
-
getRecipes
- Specified by:
getRecipes
in interfaceOpenRewriteFeature
-
isVisible
public boolean isVisible()Description copied from interface:Feature
Some features should not be visible to the user because they are a common parent of other selectable features, or they should always be applied, or any other reason.- Specified by:
isVisible
in interfaceApplicationFeature
- Specified by:
isVisible
in interfaceFeature
- Returns:
- True if the feature should be able to be selected by the user
-
getOrder
public int getOrder()Description copied from interface:Feature
The order of a feature controls the order in which it applies. The order of a feature is important to ensure that any previous work done by other features that may be required is done. SeeFeaturePhase
for a list of phases to choose from.- Specified by:
getOrder
in interfaceFeature
- Specified by:
getOrder
in interfaceKotlinApplicationFeature
- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
- Returns:
- The order of the feature
-
apply
Description copied from interface:Feature
If this method is called for a given feature that means the feature was explicitly selected, included by default as a result ofDefaultFeature.shouldApply(io.micronaut.starter.options.Options, java.util.Set)
, or added explicitly by another feature throughFeatureContext.addFeature(Feature)
. At this point the feature list is set and cannot change.- Specified by:
apply
in interfaceApplicationFeature
- Specified by:
apply
in interfaceFeature
- Specified by:
apply
in interfaceOpenRewriteFeature
- Parameters:
generatorContext
- THe generator context
-