diff --git a/docs/src/main/asciidoc/qute-reference.adoc b/docs/src/main/asciidoc/qute-reference.adoc index 6f49e38ac860f..64ba4bf0e3a39 100644 --- a/docs/src/main/asciidoc/qute-reference.adoc +++ b/docs/src/main/asciidoc/qute-reference.adoc @@ -1942,17 +1942,19 @@ public class HelloResource { } } ---- -<1> Declares a type-safe template with the Java record. +<1> Declares a type-safe template with the Java record. The template is located at `/src/main/resources/templates/HelloResource/Hello.html`. <2> Instantiate the record and use it as an ordinary `TemplateInstance`. ==== Customized Template Path -The template path of a `@CheckedTemplate` method consists of the _base path_ and a _defaulted name_. +The path of a type-safe template (`@CheckedTemplate` method or record) consists of a _base path_ and a _defaulted name_. The _base path_ is supplied by the `@CheckedTemplate#basePath()`. -By default, the simple name of the declaring class for a nested static class or an empty string for a top level class is used. +By default, the simple name of the enclosing class for a nested static class or an empty string for a top level class is used. The _defaulted name_ is derived by the strategy specified in `@CheckedTemplate#defaultName()`. -By default, the name of the `@CheckedTemplate` method is used as is. +By default, the name of the `@CheckedTemplate` method/record is used as is. + +NOTE: A template record that is not annotated with `@CheckedTemplate` is treated as if it was annotated with `@CheckedTemplate` with default values. .Customized Template Path Example [source,java] diff --git a/independent-projects/qute/core/src/main/java/io/quarkus/qute/CheckedTemplate.java b/independent-projects/qute/core/src/main/java/io/quarkus/qute/CheckedTemplate.java index 6d45284ffc484..cbaed8692f005 100644 --- a/independent-projects/qute/core/src/main/java/io/quarkus/qute/CheckedTemplate.java +++ b/independent-projects/qute/core/src/main/java/io/quarkus/qute/CheckedTemplate.java @@ -97,7 +97,7 @@ /** * Constant value for {@link #basePath()} indicating that the default strategy should be used, i.e. the simple name of the - * declaring class for a nested static class or an empty string for a top level class. + * enclosing class for a nested static class or an empty string for a top level class. */ String DEFAULTED = "<>";