> typeCheckExcludes();
/**
* This regular expression is used to exclude template files from the {@code templates} directory. Excluded templates are
@@ -57,8 +57,8 @@ public class QuteConfig {
*
* By default, the hidden files are excluded. The name of a hidden file starts with a dot.
*/
- @ConfigItem(defaultValue = "^\\..*|.*\\/\\..*$")
- public Pattern templatePathExclude;
+ @WithDefault("^\\..*|.*\\/\\..*$")
+ Pattern templatePathExclude();
/**
* The prefix is used to access the iteration metadata inside a loop section.
@@ -74,32 +74,30 @@ public class QuteConfig {
*
* By default, the {@code } constant is set.
*/
- @ConfigItem(defaultValue = "")
- public String iterationMetadataPrefix;
+ @WithDefault("")
+ String iterationMetadataPrefix();
/**
* The list of content types for which the {@code '}, {@code "}, {@code <}, {@code >} and {@code &} characters are escaped
* if a template variant is set.
*/
- @ConfigItem(defaultValue = "text/html,text/xml,application/xml,application/xhtml+xml")
- public List escapeContentTypes;
+ @WithDefault("text/html,text/xml,application/xml,application/xhtml+xml")
+ List escapeContentTypes();
/**
* The default charset of the templates files.
*/
- @ConfigItem(defaultValue = "UTF-8")
- public Charset defaultCharset;
+ @WithDefault("UTF-8")
+ Charset defaultCharset();
/**
* Development mode configuration.
*/
- @ConfigItem
- public QuteDevModeConfig devMode;
+ QuteDevModeConfig devMode();
/**
* Test mode configuration.
*/
- @ConfigItem
- public QuteTestModeConfig testMode;
+ QuteTestModeConfig testMode();
}
diff --git a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteDevModeConfig.java b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteDevModeConfig.java
index 843a08b3eadcf..eab9f8fe91d89 100644
--- a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteDevModeConfig.java
+++ b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteDevModeConfig.java
@@ -4,10 +4,9 @@
import java.util.regex.Pattern;
import io.quarkus.runtime.annotations.ConfigGroup;
-import io.quarkus.runtime.annotations.ConfigItem;
@ConfigGroup
-public class QuteDevModeConfig {
+public interface QuteDevModeConfig {
/**
* By default, a template modification results in an application restart that triggers build-time validations.
@@ -18,7 +17,6 @@ public class QuteDevModeConfig {
* The matched input is the template path that starts with a template root, and the {@code /} is used as a path separator.
* For example, {@code templates/foo.html}.
*/
- @ConfigItem
- public Optional noRestartTemplates;
+ Optional noRestartTemplates();
}
\ No newline at end of file
diff --git a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteRuntimeConfig.java b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteRuntimeConfig.java
index cb679eed25e32..f27dd96dc86b3 100644
--- a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteRuntimeConfig.java
+++ b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteRuntimeConfig.java
@@ -5,12 +5,14 @@
import io.quarkus.qute.Results;
import io.quarkus.qute.TemplateException;
import io.quarkus.qute.TemplateInstance;
-import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
+import io.smallrye.config.ConfigMapping;
+import io.smallrye.config.WithDefault;
-@ConfigRoot(name = "qute", phase = ConfigPhase.RUN_TIME)
-public class QuteRuntimeConfig {
+@ConfigRoot(phase = ConfigPhase.RUN_TIME)
+@ConfigMapping(prefix = "quarkus.qute")
+public interface QuteRuntimeConfig {
/**
* The strategy used when a standalone expression evaluates to a "not found" value at runtime and
@@ -22,14 +24,14 @@ public class QuteRuntimeConfig {
* By default, the {@code NOT_FOUND} constant is written to the output. However, in the development mode the
* {@link PropertyNotFoundStrategy#THROW_EXCEPTION} is used by default, i.e. when the strategy is not specified.
*/
- @ConfigItem
- public Optional propertyNotFoundStrategy;
+ Optional propertyNotFoundStrategy();
+
/**
* Specify whether the parser should remove standalone lines from the output. A standalone line is a line that contains at
* least one section tag, parameter declaration, or comment but no expression and no non-whitespace character.
*/
- @ConfigItem(defaultValue = "true")
- public boolean removeStandaloneLines;
+ @WithDefault("true")
+ boolean removeStandaloneLines();
/**
* If set to {@code true} then any expression that is evaluated to a {@link Results.NotFound} value will always result in a
@@ -38,21 +40,21 @@ public class QuteRuntimeConfig {
* Note that the {@code quarkus.qute.property-not-found-strategy} config property is completely ignored if strict rendering
* is enabled.
*/
- @ConfigItem(defaultValue = "true")
- public boolean strictRendering;
+ @WithDefault("true")
+ boolean strictRendering();
/**
* The global rendering timeout in milliseconds. It is used if no {@code timeout} template instance attribute is set.
*/
- @ConfigItem(defaultValue = "10000")
- public long timeout;
+ @WithDefault("10000")
+ long timeout();
/**
* If set to {@code true} then the timeout should also be used for asynchronous rendering methods, such as
* {@link TemplateInstance#createUni()} and {@link TemplateInstance#renderAsync()}.
*/
- @ConfigItem(defaultValue = "true")
- public boolean useAsyncTimeout;
+ @WithDefault("true")
+ boolean useAsyncTimeout();
public enum PropertyNotFoundStrategy {
/**
diff --git a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteTestModeConfig.java b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteTestModeConfig.java
index 13d4dfa30d294..ec4fd9a4b5bcd 100644
--- a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteTestModeConfig.java
+++ b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/QuteTestModeConfig.java
@@ -2,16 +2,16 @@
import io.quarkus.qute.RenderedResults;
import io.quarkus.runtime.annotations.ConfigGroup;
-import io.quarkus.runtime.annotations.ConfigItem;
+import io.smallrye.config.WithDefault;
@ConfigGroup
-public class QuteTestModeConfig {
+public interface QuteTestModeConfig {
/**
* By default, the rendering results of injected and type-safe templates are recorded in the managed
* {@link RenderedResults} which is registered as a CDI bean.
*/
- @ConfigItem(defaultValue = "true")
- public boolean recordRenderedResults;
+ @WithDefault("true")
+ boolean recordRenderedResults();
}
\ No newline at end of file