Interface Context


  • @NonExtendable
    public interface Context
    Parser context for use within transformations.

    This allows operating recursive parses, for cases where messages may include parse-specific tags.

    Since:
    4.10.0
    • Method Detail

      • deserialize

        @NotNull
        @NotNull Component deserialize​(@NotNull
                                       @NotNull java.lang.String message)
        Deserializes a MiniMessage string using all the settings of this context.
        Parameters:
        message - the message to parse
        Returns:
        the parsed message
        Since:
        4.10.0
      • deserialize

        @NotNull
        @NotNull Component deserialize​(@NotNull
                                       @NotNull java.lang.String message,
                                       @NotNull
                                       @NotNull TagResolver resolver)
        Deserializes a MiniMessage string using all the settings of this context.
        Parameters:
        message - the message to parse
        resolver - additional tag resolver, added to all other resolvers in this parse, but taking priority in the event of a name overlap
        Returns:
        the parsed message
        Since:
        4.10.0
      • deserialize

        @NotNull
        @NotNull Component deserialize​(@NotNull
                                       @NotNull java.lang.String message,
                                       @NotNull
                                       @NotNull TagResolver @NotNull ... resolvers)
        Deserializes a MiniMessage string using all the settings of this context.
        Parameters:
        message - the message to parse
        resolvers - additional tag resolvers, added to all other resolvers in this parse, but taking priority in the event of a name overlap
        Returns:
        the parsed message
        Since:
        4.10.0
      • newException

        @NotNull
        @NotNull ParsingException newException​(@NotNull
                                               @NotNull java.lang.String message,
                                               @NotNull
                                               @NotNull ArgumentQueue tags)
        Create a new parsing exception.
        Parameters:
        message - a detail message describing the error
        tags - the tag parts which caused the error
        Returns:
        the new parsing exception
        Since:
        4.10.0
      • newException

        @NotNull
        @NotNull ParsingException newException​(@NotNull
                                               @NotNull java.lang.String message)
        Create a new parsing exception without reference to a specific location.
        Parameters:
        message - a detail message describing the error
        Returns:
        the new parsing exception
        Since:
        4.10.0
      • newException

        @NotNull
        @NotNull ParsingException newException​(@NotNull
                                               @NotNull java.lang.String message,
                                               @Nullable
                                               @Nullable java.lang.Throwable cause,
                                               @NotNull
                                               @NotNull ArgumentQueue args)
        Create a new parsing exception.
        Parameters:
        message - a detail message describing the error
        cause - the cause
        args - arguments that caused the errors
        Returns:
        the new parsing exception
        Since:
        4.10.0