walhalla.data
WikiText
A utility class for parsing and manipulating wiki text. This class provides methods to extract key-value pairs, sections, and other structured data from a wiki text format.
WikiText
(String
text
)
String
text
)String text |
The raw wiki text to be parsed. |
Constructs a WikiText instance with the given raw text.
findKV
(String
key
, ConsumerString
value
)
void
String
key
, ConsumerString
value
)String key |
The key to search for. |
Consumer value |
A consumer to process the value associated with the key. |
Finds a key-value pair in the wiki text and processes its value.
peekKV
(String
key
, ConsumerString
value
)
void
String
key
, ConsumerString
value
)String key |
The key to search for. |
Consumer value |
A consumer to process the value associated with the key. |
Peeks at a key-value pair in the wiki text without advancing the parsing position.
peekSection
(String
text
, Runnable
action
)
void
String
text
, Runnable
action
)String text |
The section title to search for. |
Runnable action |
A runnable to execute if the section is found. |
Peeks at a section in the wiki text without advancing the parsing position.
peek
(String
value
)
boolean
String
value
)String value |
|
boolean |
optional
(String
value
)
boolean
String
value
)String value |
The value to search for. |
boolean |
True if the value is found, false otherwise. |
Optionally checks for the presence of a specific value in the text without throwing an exception.