Interface Feature

All Superinterfaces:
io.micronaut.core.naming.Described, io.micronaut.core.naming.Named, io.micronaut.core.order.Ordered
All Known Subinterfaces:
AgoraPulseFeature, ApplicationFeature, AwsApiFeature, AwsFeature, AwsLambdaEventFeature, BuildFeature, BuildPluginFeature, CacheFeature, CamundaCommunityFeature, ChatBotsFeature, CloudObjectStorageFeature, CodeContributingFeature, CommunityFeature, ConfigurationFeature, ContributingInterceptUrlMapFeature, ContributingStaticResources, CpuArchitecture, DatabaseDriverConfigurationFeature, DataDocumentFeature, DataFeature, DefaultConfigurationFeature, DefaultFeature, DiscoveryFeature, DistributedConfigFeature, EclipseStoreFeature, FunctionFeature, GradleSpecificFeature, GroovyApplicationFeature, GroovyModuleFeature, HandlerClassFeature, HttpClientFeature, InfrastructureAsCodeFeature, JavaApplicationFeature, JmsFeature, JpaFeature, JsonFeature, JunitCompanionFeature, KotlinApplicationFeature, KotlinSpecificFeature, KotlinSupportFeature, KotlinSymbolProcessingFeature, LanguageFeature, LanguageSpecificFeature, LoggingFeature, MavenSpecificFeature, MessagingFeature, MicrometerRegistryFeature, MicronautCommunityFeature, MicroStreamFeature, MigrationFeature, MinJdkFeature, MockingFeature, MqttFeature, MultiProjectFeature, ObjectStorageFeature, OneOfFeature, OpenTelemetryFeature, ParentPomFeature, PicocliTestFeature, R2dbcFeature, ReactiveFeature, ReactiveHttpClientFeature, ReloadingFeature, RequireEagerSingletonInitializationFeature, RequireKaptFeature, RequiresMavenLocal, RequiresRepository, SerializationFeature, ServerFeature, SharedTestResourceFeature, TestFeature, ThirdPartyLibraryFeature, ThirdPartyServerFeature, TracingFeature, ValidationFeature, ViewFeature
All Known Implementing Classes:
AbstractAzureContainerInstanceWorkflow, AbstractAzureFunction, AbstractCloudRunWorkflow, AbstractDekorateFeature, AbstractDekoratePlatformFeature, AbstractDekorateServiceFeature, AbstractDockerRegistryWorkflow, AbstractFunctionFeature, AbstractGoogleCloudFunction, AbstractJmsFeature, AbstractMicronautServerFeature, AbstractOpenTelemetry, AbstractOracleFunctionsWorkflow, AbstractServletFeature, Acme, ActiveMqArtemis, ActiveMqClassic, AmazonApiGateway, AmazonApiGatewayHttp, AmazonCognito, AmazonSesEmailFeature, AnnotationApi, AOP, ApiGatewayV2AwsLambdaHandlerProvider, AppName, AppOptics, Archaius, Arm, Asciidoctor, AssertJ, Atlas, Awaitility, AwsAlexa, AWSCiWorkflowFeature, AwsLambda, AwsLambdaCustomRuntime, AwsLambdaEventFunctionFeature, AwsLambdaEventsSerde, AwsLambdaRelatedFeature, AwsLambdaS3EventNotification, AwsLambdaScheduledEvent, AwsLambdaSnapstart, AwsParameterStore, AwsSecretsManager, AwsV2Sdk, AzureContainerInstanceGraalWorkflow, AzureContainerInstanceJavaWorkflow, AzureCosmosDbFeature, AzureHttpFunction, AzureKeyVaultFeature, AzureMonitor, AzureRawFunction, BasecampAwsChatBot, BasecampAzureChatBot, BasecampGcpChatBot, BasecampHttpChatBot, Buildless, Caffeine, Cassandra, Cdk, CdkFeature, ChatBots, CIWorkflowFeature, CloudTrace, CloudWatch, Coherence, CoherenceData, CoherenceDistributedConfiguration, CoherenceFeature, CoherenceGrpcClient, CoherenceSessionStore, Config4k, Console, Consul, ControlPanel, Core, Crac, Data, DataAzureCosmosFeature, DatabaseDriverFeature, DataDog, DataHibernateReactive, DataJdbc, DataJpa, DataMongo, DataMongoFeature, DataMongoReactive, DataR2dbc, DataSpringJdbcFeature, DatetimeGroovyModule, DateUtilGroovyModule, Dbcp, DefaultAwsLambdaHandlerProvider, DekorateHalkyon, DekorateJaeger, DekorateKnative, DekorateKubernetes, DekorateOpenshift, DekoratePrometheus, DekorateServiceCatalog, DiscoveryClient, DiscoveryConsul, DiscoveryCore, DiscoveryKubernetes, DistributedConfigConsul, DockerRegistryWorkflow, DynamoDb, Dynatrace, EaseTestingFeature, EclipseStore, EclipseStoreRest, EHCache, Elastic, Elasticsearch, EnforcerPlugin, Eureka, ExternalWorker, Flyway, Freemarker, FunctionAwsLambdaHandlerProvider, Ganglia, GinqGroovyModule, GithubCiWorkflowFeature, GitHubWorkflowFeature, GitlabCiWorkflowFeature, GoogleCloudCiWorkflowFeature, GoogleCloudEventsFunction, GoogleCloudFunction, GoogleCloudRawFunction, GoogleCloudRunGraalWorkflow, GoogleCloudRunJavaWorkflow, GoogleSecretManager, GraalVM, GraalVMDockerRegistryWorkflow, Gradle, GradleEnterprise, Graphite, GraphQL, Groovy, GroovyApplication, GroovyMavenPlusPlugin, Grpc, GrpcRandomPort, GruHttp, H2, Hamcrest, Handlebars, Hazelcast, HibernateJpa, HibernateJpaModelgen, HibernateReactiveFeature, HibernateReactiveJpa, HibernateValidator, Hikari, HttpClient, HttpClientJdk, HttpClientTest, HttpSession, Humio, Hystrix, Infinispan, Influx, JacksonDatabindFeature, JacksonXml, Jaeger, JAsyncSQLFeature, Java, JavaApplication, JavaGradlePlugin, JavamailFeature, JaxRs, JaxRsSecurity, JdbcFeature, JdbiFeature, Jetty, Jib, JmsCore, Jmx, Jmx, JobRunrFeature, Jooq, Jrebel, JsonGroovyModule, JsonPath, JsonSchemaFeature, JsonSchemaValidationFeature, JsonSmart, JTE, Junit, JunitParams, JunitPlatformSuiteEngine, Kafka, KafkaStreams, Kairos, Kapt, Knative, KoTest, Kotlin, KotlinApplication, KotlinExtensionFunctions, KotlinSymbolProcessing, Ktor, Kubernetes, KubernetesClient, KubernetesConfig, KubernetesInformer, KubernetesReactorClient, KubernetesRxJava2Client, LambdaFunctionUrl, Liquibase, LocalStack, Log4j2, Logback, MailjetEmailFeature, Management, MariaDB, Maven, MicrometerAnnotations, MicrometerFeature, MicrometerObservation, MicrometerObservationHttp, MicronautAot, MicronautBuildPlugin, MicronautGradleEnterprise, MicronautGuice, MicronautHttpValidation, MicronautRestAssured, MicronautValidationFeature, MicroStream, MicroStreamCache, MicroStreamRest, Mockito, Mockk, MockServerClient, MongoFeature, MongoReactive, MongoSync, Mqtt, MqttHiveMq, MqttV3, Multitenancy, MySQL, MySQLCompatibleFeature, Nats, Neo4jBolt, Netty, NewRelic, ObjectStorageAws, ObjectStorageAzure, ObjectStorageGcp, ObjectStorageLocal, ObjectStorageOracleCloud, OCICiWorkflowFeature, OpenApi, OpenApiAdoc, OpenApiExplorer, OpenRewrite, OpenSearchAmazon, OpenSearchFeature, OpenSearchHttpClient5, OpenSearchRestClient, OpenTelemetry, OpenTelemetryAnnotations, OpenTelemetryExporterFeature, OpenTelemetryExporterGoogleCloudTrace, OpenTelemetryExporterJaeger, OpenTelemetryExporterLogging, OpenTelemetryExporterOtlp, OpenTelemetryExporterZipkin, OpenTelemetryGoogleCloudTrace, OpenTelemetryGrpc, OpenTelemetryHttp, OpenTelemetryJaeger, OpenTelemetryXray, OpenTelemetryZipkin, Oracle, OracleAdvancedQueuing, OracleCloud, OracleCloudAutonomousDatabase, OracleCloudMicronautNettyClient, OracleCloudSdk, OracleCloudVault, OracleFunction, OracleFunctionsGraalWorkflow, OracleFunctionsJavaWorkflow, OracleRawFunction, Pebble, Permissions, Picocli, PicocliGroovyApplication, PicocliJavaApplication, PicocliJunit, PicocliKoTest, PicocliKotlinApplication, PicocliSpock, Platform7, PostgreSQL, PostmarkEmailFeature, ProblemJson, ProjectLombok, Prometheus, Properties, PubSub, R2dbc, RabbitMQ, RandomPort, RapiDoc, Reactor, ReactorHttpClient, Readme, RedisLettuce, Redoc, Retry, Ribbon, Rocker, Rss, RssItunes, RxJava1, RxJava2, RxJava2HttpClient, RxJava2HttpServerNetty, RxJava3, RxJava3HttpClient, Security, SecurityAnnotations, SecurityFeature, SecurityJWT, SecurityLdap, SecurityOAuth2, SecurityOAuth2Feature, SecuritySession, SendGridEmailFeature, SerializationBsonFeature, SerializationJacksonFeature, SerializationJsonpFeature, ShadePlugin, Signalfx, SimpleLogging, Slack, Slf4jJulBridge, Slf4jSimpleLogger, SourcegenJava, Soy, Spock, Spring, SpringBoot, SpringDataJdbc, SpringDataJpa, SpringFeature, SpringWeb, SqlGroovyModule, SQLServer, SQS, Stackdriver, StaticResourceFeature, Statsd, SwaggerUI, TelegramAwsChatBot, TelegramAzureChatBot, TelegramGcpChatBot, TelegramHttpChatBot, TemplateEmailFeature, TestContainers, TestResources, Thymeleaf, Tomcat, Tomcat, Toml, TomlGroovyModule, Ucp, Undertow, Velocity, VertxMySql, VertxPg, ViewsFieldset, ViewsFieldsetTck, Wavefront, Websocket, Worker, X86, XmlGroovyModule, Yaml, YamlGroovyModule, Zeebe, Zipkin

@Indexed(Feature.class) public interface Feature extends io.micronaut.core.naming.Named, io.micronaut.core.order.Ordered, io.micronaut.core.naming.Described
A feature is a class that affects the outcome of a generated project.
Since:
2.0.0
Author:
James Kleeh
  • Method Details

    • getName

      @NonNull @NonNull String getName()
      The name of the feature. It must be unique.
      Specified by:
      getName in interface io.micronaut.core.naming.Named
      Returns:
      the name of the feature
    • isPreview

      default boolean isPreview()
      Returns:
      Indicates the feature is in preview status and is subject to change.
    • isCommunity

      default boolean isCommunity()
      Returns:
      Indicates the feature is a community contribution.
    • getTitle

      default String getTitle()
      Returns:
      The title of the feature
    • getDescription

      default String getDescription()
      Specified by:
      getDescription in interface io.micronaut.core.naming.Described
    • getOrder

      default int getOrder()
      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. See FeaturePhase for a list of phases to choose from.
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
      Returns:
      The order of the feature
    • processSelectedFeatures

      default 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 of DefaultFeature.shouldApply(ApplicationType, 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 methods FeatureContext.addFeature(Feature) and FeatureContext.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.
      Parameters:
      featureContext - The feature context
    • apply

      default void 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 of DefaultFeature.shouldApply(ApplicationType, io.micronaut.starter.options.Options, java.util.Set), or added explicitly by another feature through FeatureContext.addFeature(Feature). At this point the feature list is set and cannot change. This method can be implemented to modify the generated project. The feature can add templates by executing GeneratorContext.addTemplate(String, io.micronaut.starter.template.Template), modify configuration by modifying GeneratorContext.getConfiguration() or GeneratorContext.getBootstrapConfiguration(), or modify build properties through GeneratorContext.getBuildProperties().
      Parameters:
      generatorContext - THe generator context
    • supports

      boolean supports(ApplicationType applicationType)
      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.
      Parameters:
      applicationType - The application type
      Returns:
      True if the feature can be selected by the user
    • isVisible

      default boolean isVisible()
      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.
      Returns:
      True if the feature should able to be selected by the user
    • getCategory

      default String getCategory()
      Returns:
      The Category to which the feature belongs to.
    • getMicronautDocumentation

      @Nullable default @Nullable String getMicronautDocumentation()
      Returns:
      Returns a link to Micronaut documentation about the feature. eg. https://micronaut-projects.github.io/micronaut-cache/latest/guide/index.html#hazelcast
    • getThirdPartyDocumentation

      @Nullable default @Nullable String getThirdPartyDocumentation()
      Returns:
      Returns a link to third party. E.g. https://hazelcast.org