public class YamlTokeniser extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<net.openhft.chronicle.wire.YamlTokeniser.YTContext> |
contexts
Stack to manage contextual information during tokenization.
|
| Constructor and Description |
|---|
YamlTokeniser(net.openhft.chronicle.bytes.BytesIn<?> in)
Constructs a new YAML tokenizer with the specified input.
|
| Modifier and Type | Method and Description |
|---|---|
long |
blockEnd()
Gets the end position of the current block in the stream.
|
char |
blockQuote()
Gets the current block's quotation character.
|
long |
blockStart()
Gets the start position of the current block in the stream.
|
YamlToken |
context()
Returns the context of the YAML tokenization process.
|
int |
contextSize()
Retrieves the number of context objects currently being managed.
|
YamlToken |
current()
Gets the current token in the tokenization process.
|
boolean |
isText(String s)
Checks if the text of the current block is equal to the provided string.
|
YamlKeys |
keys()
Retrieves the YamlKeys associated with the top context.
|
long |
lineStart()
Gets the start position of the current line in the stream.
|
void |
lineStart(long lineStart)
Sets the start position of the current line in the stream.
|
YamlToken |
next()
Fetches the next token based on the current context's indentation.
|
@NotNull YamlToken |
next(int minIndent)
Retrieves the next YAML token considering the minimum indentation provided.
|
double |
parseDouble()
Parses the current block's content as a double.
|
long |
parseLong()
Parses the current block's content as a long.
|
void |
push(YamlToken token)
Adds a YamlToken to the list of pushed tokens.
|
void |
rereadFrom(long offset)
Resets the reading to start from the specified offset.
|
net.openhft.chronicle.wire.YamlTokeniser.YTContext |
secondTopContext()
Retrieves the second to top context from the context stack.
|
String |
text()
Used primarily for testing purposes to extract the current block's text.
|
void |
text(StringBuilder sb)
Extracts the text of the current block into the provided StringBuilder.
|
net.openhft.chronicle.wire.YamlTokeniser.YTContext |
topContext()
Retrieves the top context from the context stack.
|
String |
toString() |
protected final List<net.openhft.chronicle.wire.YamlTokeniser.YTContext> contexts
public YamlTokeniser(net.openhft.chronicle.bytes.BytesIn<?> in)
in - The input source containing raw YAML content.public int contextSize()
public YamlToken context()
public net.openhft.chronicle.wire.YamlTokeniser.YTContext topContext()
public net.openhft.chronicle.wire.YamlTokeniser.YTContext secondTopContext()
public YamlToken current()
public YamlToken next()
@NotNull public @NotNull YamlToken next(int minIndent)
minIndent - The minimum indentation to consider while tokenizing.public long lineStart()
public void lineStart(long lineStart)
lineStart - the new starting position for the current line.public long blockStart()
public long blockEnd()
public char blockQuote()
public String text()
public void text(StringBuilder sb)
sb - StringBuilder to which the block's text will be appended.public double parseDouble()
public long parseLong()
public void push(YamlToken token)
token - The YamlToken to be pushed.public boolean isText(String s)
s - The string to be checked.public YamlKeys keys()
public void rereadFrom(long offset)
offset - The position from which the reading should start.Copyright © 2024. All rights reserved.