TextMarkup
final class TextMarkup
Package: dev.joid.lib.font.markup · Module: core · Source: TextMarkup.java
The registry of the markup tags that every text reads, and the helpers that find the tags in a string.
Description
Section titled “Description”JOID registers no markup: the tags a text understands are the ones you register, or the ones you give a style with TextInfo.markups.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | register(ITextMarkup markup) static | Adds a markup in front of the others, so that it is tried first; registering it again moves it to the front. |
void | unregister(ITextMarkup markup) static | Removes a markup. |
List<ITextMarkup> | getRegistered() static | Returns the registered markups, the first tried first, as a list you cannot change. |
int | parse(List | Tries each markup of markups at index and returns the length of the first tag found, or 0 when no tag starts there. |
int[] | tags(String text, TextInfo info) static | Returns, for each character of text, the index where the tag that holds it starts, or -1 for a character outside any tag, with the markups of info. |
String | opened(String text, int[] tags, int end) static | Returns every tag found in text before end, joined, so that a line that starts at end reopens the styles of the previous one. |
Method details
Section titled “Method details”register
Section titled “register”void register(ITextMarkup markup) static
Adds a markup in front of the others, so that it is tried first; registering it again moves it to the front.
unregister
Section titled “unregister”void unregister(ITextMarkup markup) static
Removes a markup.
getRegistered
Section titled “getRegistered”List<ITextMarkup> getRegistered() static
Returns the registered markups, the first tried first, as a list you cannot change.
int parse(List<ITextMarkup> markups, String text, int index, TextStyle style) static
Tries each markup of markups at index and returns the length of the first tag found, or 0 when no tag starts there.
int[] tags(String text, TextInfo info) static
Returns, for each character of text, the index where the tag that holds it starts, or -1 for a character outside any tag, with the markups of info.
opened
Section titled “opened”String opened(String text, int[] tags, int end) static
Returns every tag found in text before end, joined, so that a line that starts at end reopens the styles of the previous one.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
