Walhalla

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(Stringtext)

Stringtext

The raw wiki text to be parsed.

Constructs a WikiText instance with the given raw text.

findKV(Stringkey, ConsumerStringvalue)void

Stringkey

The key to search for.

ConsumerStringvalue

A consumer to process the value associated with the key.

Finds a key-value pair in the wiki text and processes its value.

peekKV(Stringkey, ConsumerStringvalue)void

Stringkey

The key to search for.

ConsumerStringvalue

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(Stringtext, Runnableaction)void

Stringtext

The section title to search for.

Runnableaction

A runnable to execute if the section is found.

Peeks at a section in the wiki text without advancing the parsing position.

peek(Stringvalue)boolean

Stringvalue
boolean

optional(Stringvalue)boolean

Stringvalue

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.