Parser rules:
[red] — valid; parsed and styled.[notastyle] — valid syntax, unrecognized style; passed through as-is unless
strict parsing is enabled.[nested[nested]] — nested tags are not supported; passed through as-is.\[red] — escaped bracket; rendered as the literal text [red].[ is encountered before the current tag closes, the entire tag is ignored.AnsiStringParser prior to version 4.0.0.
| Modifier and Type | Field and Description |
|---|---|
| public static final MarkupParser | DEFAULT
A parser using |
| private final ParserConfiguration | parserConfiguration
Record Component accessed by parserConfiguration(). |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public String | Returns: the plain text content with all markup and ANSI sequences removed, or the original value ifnull or blanka string that may contain markup tags or ANSI sequences;
may be tokenedString)nullStrips markup tags and residual ANSI sequences from a previously tokenized string, returning the plain text content. |
| pack-priv ParseResult | |
| public final int | |
| public String | |
| public String | Returns: the styled stringthe object to parse; must not be object)nullParses the |
| public ParserConfiguration | |
| public void | |
| public void | print(Object
the object to parse and print; must not be object)nullParses the |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| DEFAULT | back to summary |
|---|---|
| public static final MarkupParser DEFAULT A parser using | |
| parserConfiguration | back to summary |
|---|---|
| private final ParserConfiguration parserConfiguration Record Component accessed by parserConfiguration(). | |
| MarkupParser | back to summary |
|---|---|
| public MarkupParser() | |
| MarkupParser | back to summary |
|---|---|
| public MarkupParser(ParserConfiguration parserConfiguration) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| getOriginalString | back to summary |
|---|---|
| public String getOriginalString(String tokenedString) Strips markup tags and residual ANSI sequences from a previously tokenized string, returning the plain text content. If Example:
| |
| getParseResult | back to summary |
|---|---|
| pack-priv ParseResult getParseResult(String input) | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| parse | back to summary |
|---|---|
| public String parse(String string) Parses a markup-tagged string and returns the ANSI-styled result. | |
| parse | back to summary |
|---|---|
| public String parse(Object object) Parses the
| |
| parserConfiguration | back to summary |
|---|---|
| public ParserConfiguration parserConfiguration() Record Component getter of parserConfiguration. | |
| back to summary | |
|---|---|
| public void print(String string) Parses
| |
| back to summary | |
|---|---|
| public void print(Object object) Parses the
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |