Class Placeholder


  • public final class Placeholder
    extends java.lang.Object
    Tag resolvers producing tags that insert fixed values.

    These are effectively placeholders.

    Since:
    4.10.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull TagResolver.Single component​(@NotNull java.lang.String key, @NotNull ComponentLike value)
      Creates a replacement that inserts a component.
      static @NotNull TagResolver.Single parsed​(@NotNull java.lang.String key, @NotNull java.lang.String value)
      Creates a placeholder that inserts a MiniMessage string.
      static @NotNull TagResolver.Single styling​(@NotNull java.lang.String key, @NotNull StyleBuilderApplicable @NotNull ... style)
      Creates a style tag which will modify the style of the component.
      static @NotNull TagResolver.Single unparsed​(@NotNull java.lang.String key, @NotNull java.lang.String value)
      Creates a placeholder that inserts a literal string, without attempting to parse any contained tags.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parsed

        public static @NotNull TagResolver.Single parsed​(@TagPattern @NotNull
                                                         @NotNull java.lang.String key,
                                                         @NotNull
                                                         @NotNull java.lang.String value)
        Creates a placeholder that inserts a MiniMessage string.

        The inserted string will impact the rest of the parse process.

        Parameters:
        key - the key
        value - the replacement
        Returns:
        the placeholder
        Since:
        4.10.0
      • unparsed

        public static @NotNull TagResolver.Single unparsed​(@TagPattern @NotNull
                                                           @NotNull java.lang.String key,
                                                           @NotNull
                                                           @NotNull java.lang.String value)
        Creates a placeholder that inserts a literal string, without attempting to parse any contained tags.
        Parameters:
        key - the key
        value - the replacement
        Returns:
        the placeholder
        Since:
        4.10.0
      • component

        public static @NotNull TagResolver.Single component​(@TagPattern @NotNull
                                                            @NotNull java.lang.String key,
                                                            @NotNull
                                                            @NotNull ComponentLike value)
        Creates a replacement that inserts a component.

        This replacement is auto-closing, so its style will not influence the style of following components.

        Parameters:
        key - the key
        value - the replacement
        Returns:
        the placeholder
        Since:
        4.10.0
      • styling

        public static @NotNull TagResolver.Single styling​(@TagPattern @NotNull
                                                          @NotNull java.lang.String key,
                                                          @NotNull
                                                          @NotNull StyleBuilderApplicable @NotNull ... style)
        Creates a style tag which will modify the style of the component.

        This style can be used like other styles.

        Parameters:
        key - the key
        style - the style
        Returns:
        the placeholder
        Since:
        4.13.0