Class ModuleTexts

java.lang.Object
com.ultikits.ultitools.text.internal.ModuleTexts

@Internal public final class ModuleTexts extends Object
Plain, server-fallback text for framework callers that accept a module message path or a literal.
  • Field Details

    • PATH

      private static final Pattern PATH
    • TEMPLATES

      private static final net.kyori.adventure.text.minimessage.MiniMessage TEMPLATES
    • SHIPPED

      private static final Map<Catalogue, Catalogue> SHIPPED
    • engine

      private final TextEngine engine
    • prepared

      private final TextEngine.Prepared prepared
  • Constructor Details

    • ModuleTexts

      public ModuleTexts(TextEngine engine, TextEngine.Prepared prepared)
      Binds to a module without publishing its prepared catalogue.
  • Method Details

    • resolve

      public Optional<String> resolve(@Nullable @Nullable String name)
      Renders a defined path as plain text, or returns empty for literals, missing entries or rendering failures. The effective catalogue includes operator overrides. During construction only the prepared snapshot is available.
      Parameters:
      name - the message path or literal
      Returns:
      the rendered text if a template is found in the server fallback or module source locale chain
    • shippedTemplates

      public List<String> shippedTemplates(String name)
      Returns distinct plain texts in language-tag order from the module's bundled catalogues only.
      Parameters:
      name - the module message path
      Returns:
      framework comment candidates, without any operator override entries
    • isPath

      private static boolean isPath(@Nullable @Nullable String name)
    • plain

      private static Optional<String> plain(String template)