-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type-safe message bundles - support dynamic keys..
- ...in templates - resolves #11567
- Loading branch information
Showing
11 changed files
with
257 additions
and
87 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/Descriptors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.qute.deployment; | ||
|
||
import io.quarkus.gizmo.MethodDescriptor; | ||
import io.quarkus.qute.Template; | ||
import io.quarkus.qute.TemplateInstance; | ||
import io.quarkus.qute.i18n.MessageBundles; | ||
|
||
final class Descriptors { | ||
|
||
static final MethodDescriptor TEMPLATE_INSTANCE = MethodDescriptor.ofMethod(Template.class, "instance", | ||
TemplateInstance.class); | ||
static final MethodDescriptor TEMPLATE_INSTANCE_DATA = MethodDescriptor.ofMethod(TemplateInstance.class, "data", | ||
TemplateInstance.class, String.class, Object.class); | ||
static final MethodDescriptor TEMPLATE_INSTANCE_RENDER = MethodDescriptor.ofMethod(TemplateInstance.class, "render", | ||
String.class); | ||
static final MethodDescriptor BUNDLES_GET_TEMPLATE = MethodDescriptor.ofMethod(MessageBundles.class, "getTemplate", | ||
Template.class, String.class); | ||
|
||
} |
173 changes: 120 additions & 53 deletions
173
...ions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java
Large diffs are not rendered by default.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/Names.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.quarkus.qute.deployment; | ||
|
||
import java.util.Collection; | ||
import java.util.Iterator; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.stream.Stream; | ||
|
||
import org.jboss.jandex.DotName; | ||
|
||
import io.quarkus.qute.Template; | ||
import io.quarkus.qute.TemplateInstance; | ||
import io.quarkus.qute.api.CheckedTemplate; | ||
import io.quarkus.qute.api.ResourcePath; | ||
import io.quarkus.qute.i18n.Localized; | ||
import io.quarkus.qute.i18n.Message; | ||
import io.quarkus.qute.i18n.MessageBundle; | ||
import io.quarkus.qute.i18n.MessageParam; | ||
|
||
final class Names { | ||
|
||
static final DotName BUNDLE = DotName.createSimple(MessageBundle.class.getName()); | ||
static final DotName MESSAGE = DotName.createSimple(Message.class.getName()); | ||
static final DotName MESSAGE_PARAM = DotName.createSimple(MessageParam.class.getName()); | ||
static final DotName LOCALIZED = DotName.createSimple(Localized.class.getName()); | ||
static final DotName RESOURCE_PATH = DotName.createSimple(ResourcePath.class.getName()); | ||
static final DotName TEMPLATE = DotName.createSimple(Template.class.getName()); | ||
static final DotName ITERABLE = DotName.createSimple(Iterable.class.getName()); | ||
static final DotName ITERATOR = DotName.createSimple(Iterator.class.getName()); | ||
static final DotName STREAM = DotName.createSimple(Stream.class.getName()); | ||
static final DotName MAP = DotName.createSimple(Map.class.getName()); | ||
static final DotName MAP_ENTRY = DotName.createSimple(Entry.class.getName()); | ||
static final DotName COLLECTION = DotName.createSimple(Collection.class.getName()); | ||
static final DotName CHECKED_TEMPLATE = DotName.createSimple(CheckedTemplate.class.getName()); | ||
static final DotName TEMPLATE_INSTANCE = DotName.createSimple(TemplateInstance.class.getName()); | ||
|
||
private Names() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters