@Environment(value=CLIENT) public class TextVisitFactory extends Object
Modifier and Type | Field and Description |
---|---|
private static Optional<Object> |
VISIT_TERMINATED |
Constructor and Description |
---|
TextVisitFactory() |
Modifier and Type | Method and Description |
---|---|
static String |
method_31402(StringVisitable stringVisitable) |
static String |
validateSurrogates(String text)
Returns a new string that has all surrogate characters within validated
from an original string.
|
static boolean |
visitBackwards(String text,
Style style,
CharacterVisitor visitor)
Visits the code points of a string in backward (right to left) direction.
|
static boolean |
visitFormatted(String text,
int startIndex,
Style style,
CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.
|
static boolean |
visitFormatted(String text,
int startIndex,
Style startingStyle,
Style resetStyle,
CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.
|
static boolean |
visitFormatted(String text,
Style style,
CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.
|
static boolean |
visitFormatted(StringVisitable text,
Style style,
CharacterVisitor visitor)
Visits the code points for every literal string and the formatting codes
supplied by the renderable.
|
static boolean |
visitForwards(String text,
Style style,
CharacterVisitor visitor)
Visits the code points of a string in forward (left to right) direction.
|
private static boolean |
visitRegularCharacter(Style style,
CharacterVisitor visitor,
int index,
char c) |
private static boolean visitRegularCharacter(Style style, CharacterVisitor visitor, int index, char c)
public static boolean visitForwards(String text, Style style, CharacterVisitor visitor)
text
- the stringstyle
- the style of the stringvisitor
- the visitor of characterstrue
if the full string was visited, or false
indicating
the visitor
terminated half-waypublic static boolean visitBackwards(String text, Style style, CharacterVisitor visitor)
text
- the stringstyle
- the style of the stringvisitor
- the visitortrue
if the full string was visited, or false
indicating
the visitor
terminated half-waypublic static boolean visitFormatted(String text, Style style, CharacterVisitor visitor)
The visit is in forward direction.
text
- the string visitedstyle
- the style of the stringvisitor
- the visitortrue
if the full string was visited, or false
indicating
the visitor
terminated half-waypublic static boolean visitFormatted(String text, int startIndex, Style style, CharacterVisitor visitor)
The visit is in forward direction.
text
- the string visitedstartIndex
- the starting index of the visitstyle
- the style of the stringtrue
if the full string was visited, or false
indicating
the visitor
terminated half-waypublic static boolean visitFormatted(String text, int startIndex, Style startingStyle, Style resetStyle, CharacterVisitor visitor)
The visit is in forward direction.
text
- the string visitedstartIndex
- the starting index of the visitstartingStyle
- the style of the string when the visit startsresetStyle
- the style to reset to when a §r
formatting code is encounteredvisitor
- the visitortrue
if the full string was visited, or false
indicating
the visitor
terminated half-waypublic static boolean visitFormatted(StringVisitable text, Style style, CharacterVisitor visitor)
The visit is in forward direction.
true
if the full string was visited, or false
indicating
the visitor
terminated half-wayStringRenderable#visit(StringRenderable.StyledVisitor, Style)
public static String validateSurrogates(String text)
text
- the original stringpublic static String method_31402(StringVisitable stringVisitable)