Class YamlParser
java.lang.Object
me.wiefferink.interactivemessenger.parsers.YamlParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEscape a (user provided) string for including it in a messagestatic voidinsertMessage(List<String> message, List<String> insert, int line, int start, int end)Insert a message at the specified positionstatic booleanisTaggedInteractive(String line)Check if a line is an advanced declaration like hover or commandstatic InteractiveMessageParse input lines into an InteractiveMessagestatic InteractiveMessageParse input lines into an InteractiveMessagestatic StringReverse the escaping of control characters in a (user provided) string
-
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
-
-
Constructor Details
-
YamlParser
public YamlParser()
-
-
Method Details
-
parse
Parse input lines into an InteractiveMessage- Parameters:
input- The input to parse- Returns:
- InteractiveMessage representing the parsed input
-
parse
Parse input lines into an InteractiveMessage- Parameters:
input- The input to parsedoInteractives- 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 messageinsert- The message to insertline- The line number to insert atstart- The start of the variable to replaceend- The end of the variable to replace
-
isTaggedInteractive
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
Escape a (user provided) string for including it in a message- Parameters:
message- The message part to escape- Returns:
- The escaped message part
-
unescape
Reverse the escaping of control characters in a (user provided) string- Parameters:
message- The message part to escape- Returns:
- The escaped message part
-