@Environment(value=CLIENT)
public static interface StringVisitable.StyledVisitor<T>
Style
.Modifier and Type | Method and Description |
---|---|
Optional<T> |
accept(Style style,
String asString)
Visits a string's content with a contextual style.
|
Optional<T> accept(Style style, String asString)
A contextual style is obtained by calling Style.withParent(Style)
on the current's text style, passing the previous contextual style or
the starting style if it is the beginning of a visit.
When a present optional
is returned,
the visit is terminated before visiting all text. Can return StringRenderable#TERMINATE_VISIT
for convenience.
style
- the current styleasString
- the literal stringOptional.empty()
to continue, a non-empty result to terminate