public abstract class Token extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Token.InlineTag |
static class |
Token.LineBreak |
static class |
Token.Text |
Modifier and Type | Method and Description |
---|---|
String |
getValue() |
boolean |
isInlineTag() |
boolean |
isLineBreak() |
boolean |
isText() |
static Function<Token,Token> |
tagMapper(Elements elementUtils,
Types typeUtils,
TypeElement ownerElt)
Create a tag mapper that remaps tags with extra contexutal info like @link tags.
|
static String |
toHtml(List<Token> tokens,
String margin,
Function<Tag.Link,String> linkToHtml,
String sep)
Render a list of tokens to HTML markup and return it.
|
static void |
toHtml(List<Token> tokens,
String margin,
Function<Tag.Link,String> linkToHtml,
String sep,
PrintWriter writer)
Render a list of tokens to HTML markup.
|
static List<Token> |
tokenize(String s)
Tokenize the string.
|
public Token(String value)
public static List<Token> tokenize(String s)
s
- the string to tokenizepublic boolean isText()
public boolean isInlineTag()
public boolean isLineBreak()
public String getValue()
public static Function<Token,Token> tagMapper(Elements elementUtils, Types typeUtils, TypeElement ownerElt)
elementUtils
- the element utilstypeUtils
- the type utilsownerElt
- the type element in which this tag is declaredpublic static String toHtml(List<Token> tokens, String margin, Function<Tag.Link,String> linkToHtml, String sep)
tokens
- the tokens to rendermargin
- the left marginlinkToHtml
- the function that renders a tag link to HTML markupsep
- the separatorpublic static void toHtml(List<Token> tokens, String margin, Function<Tag.Link,String> linkToHtml, String sep, PrintWriter writer)
tokens
- the tokens to rendermargin
- the left marginlinkToHtml
- the function that renders a tag link to HTML markupsep
- the separatorwriter
- the writer for outputCopyright © 2021 Eclipse. All rights reserved.