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
Feature that enables support for building Micronaut applications using Ktor as the HTTP server.
This feature is only applicable for Kotlin language and the default application type.
-
Field Summary
FieldsFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(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 StringgetName()The name of the feature.intgetOrder()The order of a feature controls the order in which it applies.getRecipes(GeneratorContext generatorContext) getTitle()booleanSome 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 StringmainClassName(GeneratorContext generatorContext) voidprocessSelectedFeatures(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).booleanThis 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, waitMethods inherited from interface io.micronaut.core.naming.Described
getDescriptionMethods inherited from interface io.micronaut.projectgen.core.feature.Feature
isCommunity, isPreviewMethods inherited from interface io.micronaut.projectgen.core.feature.KotlinSpecificFeature
getRequiredLanguageMethods inherited from interface io.micronaut.projectgen.core.openrewrite.OpenRewriteFeature
getFrameworkDocumentation, getThirdPartyDocumentation, processRecipesMethods 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:FeatureThis 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:
supportsin interfaceFeature- Specified by:
supportsin interfaceServerFeature- Parameters:
options- Options- Returns:
- True if the feature can be selected by the user
-
processSelectedFeatures
Description copied from interface:FeatureIf 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:
processSelectedFeaturesin interfaceFeature- Parameters:
featureContext- The feature context
-
getName
Description copied from interface:FeatureThe name of the feature. It must be unique. -
getDescription
- Specified by:
getDescriptionin interfaceio.micronaut.core.naming.Described- Specified by:
getDescriptionin interfaceFeature
-
getTitle
-
getCategory
- Specified by:
getCategoryin interfaceFeature- Specified by:
getCategoryin interfaceServerFeature- Returns:
- The Category to which the feature belongs to.
-
mainClassName
- Specified by:
mainClassNamein interfaceApplicationFeature
-
getRecipes
- Specified by:
getRecipesin interfaceOpenRewriteFeature
-
isVisible
public boolean isVisible()Description copied from interface:FeatureSome 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:
isVisiblein interfaceApplicationFeature- Specified by:
isVisiblein interfaceFeature- Returns:
- True if the feature should be able to be selected by the user
-
getOrder
public int getOrder()Description copied from interface:FeatureThe 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. SeeFeaturePhasefor a list of phases to choose from.- Specified by:
getOrderin interfaceFeature- Specified by:
getOrderin interfaceKotlinApplicationFeature- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered- Returns:
- The order of the feature
-
apply
Description copied from interface:FeatureIf 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:
applyin interfaceApplicationFeature- Specified by:
applyin interfaceFeature- Specified by:
applyin interfaceOpenRewriteFeature- Parameters:
generatorContext- THe generator context
-