Class MessageRenderer
java.lang.Object
com.ultikits.ultitools.text.internal.MessageRenderer
The single locale-aware lookup and argument formatting implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Loggerprivate final Set<MessageRenderer.Missing> private final Set<MessageRenderer.BadFormat> private final LocaleResolver -
Constructor Summary
ConstructorsConstructorDescriptionMessageRenderer(Function<String, @Nullable Catalogue> catalogues, LocaleResolver resolver, Logger logger) Creates a renderer over immutable catalogue snapshots. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddCandidate(Set<Locale> candidates, Locale locale) private net.kyori.adventure.text.minimessage.tag.resolver.TagResolverargumentResolver(Arg arg, Locale locale, MessageKey key) private static net.kyori.adventure.text.Componentchoice(Arg.Numeric numeric, net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue arguments, net.kyori.adventure.text.minimessage.Context context) private static DateTimeFormatterprivate net.kyori.adventure.text.ComponentdefaultValue(Arg arg, Locale locale) private net.kyori.adventure.text.ComponentformatArgument(Arg arg, Locale locale, net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue arguments, net.kyori.adventure.text.minimessage.Context context) private voidlog(String message, MessageKey key, Locale locale, @Nullable String argument, @Nullable Throwable failure) private @Nullable Stringlookup(MessageKey key, Locale locale) private net.kyori.adventure.text.Componentnumber(Arg.Numeric numeric, Locale locale, net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue arguments, net.kyori.adventure.text.minimessage.Context context) net.kyori.adventure.text.ComponentRenders literal or translated text in the requested locale.private voidreportFormat(MessageKey key, Locale locale, String argument, RuntimeException malformed) private net.kyori.adventure.text.ComponentsafeDefault(Arg arg, Locale locale) private static TemporalAccessortemporal(Arg.Moment moment)
-
Field Details
-
catalogues
-
resolver
-
logger
-
reported
-
reportedFormats
-
-
Constructor Details
-
MessageRenderer
public MessageRenderer(Function<String, @Nullable Catalogue> catalogues, LocaleResolver resolver, Logger logger) Creates a renderer over immutable catalogue snapshots.
-
-
Method Details
-
render
-
argumentResolver
private net.kyori.adventure.text.minimessage.tag.resolver.TagResolver argumentResolver(Arg arg, Locale locale, MessageKey key) -
reportFormat
private void reportFormat(MessageKey key, Locale locale, String argument, RuntimeException malformed) -
log
private void log(String message, MessageKey key, Locale locale, @Nullable @Nullable String argument, @Nullable @Nullable Throwable failure) -
formatArgument
-
number
private net.kyori.adventure.text.Component number(Arg.Numeric numeric, Locale locale, net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue arguments, net.kyori.adventure.text.minimessage.Context context) -
choice
private static net.kyori.adventure.text.Component choice(Arg.Numeric numeric, net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue arguments, net.kyori.adventure.text.minimessage.Context context) -
safeDefault
-
defaultValue
-
defaultTimeFormat
-
temporal
-
lookup
-
addCandidate
-