Class YamlParser

java.lang.Object
me.wiefferink.interactivemessenger.parsers.YamlParser

public class YamlParser extends Object
  • Field Details

    • ESCAPE_CHAR

      public static final char ESCAPE_CHAR
      See Also:
      Constant Field Values
    • SIMPLE_FORMAT_RESET_CHAR

      public static final char SIMPLE_FORMAT_RESET_CHAR
      See Also:
      Constant Field Values
    • tagPattern

      public static final Pattern tagPattern
  • Constructor Details

    • YamlParser

      public YamlParser()
  • Method Details

    • parse

      public static InteractiveMessage parse(List<String> input)
      Parse input lines into an InteractiveMessage
      Parameters:
      input - The input to parse
      Returns:
      InteractiveMessage representing the parsed input
    • parse

      public static InteractiveMessage parse(List<String> input, boolean doInteractives)
      Parse input lines into an InteractiveMessage
      Parameters:
      input - The input to parse
      doInteractives - true to parse interactive enums (hover, click, etc.), false to skip them
      Returns:
      InteractiveMessage representing the parsed input
    • insertMessage

      public static void insertMessage(List<String> message, List<String> insert, int line, int start, int end)
      Insert a message at the specified position
      Parameters:
      message - The current message
      insert - The message to insert
      line - The line number to insert at
      start - The start of the variable to replace
      end - The end of the variable to replace
    • isTaggedInteractive

      public static boolean isTaggedInteractive(String line)
      Check if a line is an advanced declaration like hover or command
      Parameters:
      line - The line to check
      Returns:
      true if the line is interactive, false when it is a text line
    • escape

      public static String escape(String message)
      Escape a (user provided) string for including it in a message
      Parameters:
      message - The message part to escape
      Returns:
      The escaped message part
    • unescape

      public static String unescape(String message)
      Reverse the escaping of control characters in a (user provided) string
      Parameters:
      message - The message part to escape
      Returns:
      The escaped message part