public class AnsiStringFormat extends StringFormat
StringFormat implementation for the ANSI format.colorChar| Constructor and Description |
|---|
AnsiStringFormat(boolean trueColor) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite(TextFormatting formatting)
Check if this format can write the given text formatting.
|
boolean |
matches(TextStringReader reader)
Check if the reader matches the format of this string format.
This method is allowed to modify the current position of the reader. |
TextFormatting |
read(TextStringReader reader)
Read the next formatting code from the reader.
The reader should be at the start of the formatting code when this method is called. |
boolean |
shouldResetAtEnd() |
void |
write(java.lang.StringBuilder builder,
TextFormatting formatting)
Write the given text formatting to the builder.
This method should only be called if StringFormat.canWrite(TextFormatting) returns true. |
public boolean matches(TextStringReader reader)
StringFormatTextStringReader.mark() and TextStringReader.reset().matches in class StringFormatreader - The reader to check@Nullable public TextFormatting read(TextStringReader reader)
StringFormatStringFormat.matches(TextStringReader) before calling this method.null should be returned.read in class StringFormatreader - The reader to read fromnull if the formatting code is invalidpublic boolean canWrite(TextFormatting formatting)
StringFormatcanWrite in class StringFormatformatting - The formatting to checkpublic void write(java.lang.StringBuilder builder,
TextFormatting formatting)
StringFormatStringFormat.canWrite(TextFormatting) returns true.write in class StringFormatbuilder - The builder to write toformatting - The formatting to writepublic boolean shouldResetAtEnd()
shouldResetAtEnd in class StringFormat