Top Description Inners Fields Constructors Methods
io.vertx.codegen.doc

public abstract Class Token

extends Object
Class Inheritance
Known Direct Subclasses
io.vertx.codegen.doc.Token.Text, io.vertx.codegen.doc.Token.LineBreak, io.vertx.codegen.doc.Token.InlineTag
Imports
io.vertx.codegen.Helper, .ModuleInfo, io.vertx.codegen.type.TypeMirrorFactory, javax.lang.model.element.Element, .TypeElement, javax.lang.model.type.DeclaredType, javax.lang.model.util.Elements, .Types, java.io.PrintWriter, .StringWriter, java.util.ArrayList, .List, java.util.function.Function, java.util.regex.Matcher, .Pattern

A comment token.
Author
Julien Viet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final Pattern
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
Token(String value)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the token text
getValue
()

public boolean

Returns:

true if the token is an inline tag
isInlineTag
()

public boolean

Returns:

true if the token is line break
isLineBreak
()

public boolean

Returns:

true if the token is text
isText
()

private static void
parse(String s, int prev, Matcher matcher, ArrayList<Token> events)

public static Function<Token, Token>

Returns:

the mapper
tagMapper
(Elements
the element utils
elementUtils
,
Types
the type utils
typeUtils
,
TypeElement
the type element in which this tag is declared
ownerElt
)

Create a tag mapper that remaps tags with extra contexutal info like @link tags.

public static String

Returns:

the rendered HTML
toHtml
(List<Token>
the tokens to render
tokens
,
String
the left margin
margin
,
Function<Tag.Link, String>
the function that renders a tag link to HTML markup
linkToHtml
,
String
the separator
sep
)

Render a list of tokens to HTML markup and return it.

public static void
toHtml(List<Token>
the tokens to render
tokens
,
String
the left margin
margin
,
Function<Tag.Link, String>
the function that renders a tag link to HTML markup
linkToHtml
,
String
the separator
sep
,
PrintWriter
the writer for output
writer
)

Render a list of tokens to HTML markup.

public static List<Token>

Returns:

the tokens after analysis
tokenize
(String
the string to tokenize
s
)

Tokenize the string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INLINE_TAG_PATTERNback to summary
private static final Pattern INLINE_TAG_PATTERN
TOKEN_SPLITTERback to summary
private static final Pattern TOKEN_SPLITTER
valueback to summary
pack-priv final String value

Constructor Detail

Tokenback to summary
public Token(String value)

Method Detail

getValueback to summary
public String getValue()
Returns:String

the token text

isInlineTagback to summary
public boolean isInlineTag()
Returns:boolean

true if the token is an inline tag

isLineBreakback to summary
public boolean isLineBreak()
Returns:boolean

true if the token is line break

isTextback to summary
public boolean isText()
Returns:boolean

true if the token is text

parseback to summary
private static void parse(String s, int prev, Matcher matcher, ArrayList<Token> events)
tagMapperback to summary
public 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.

Parameters
elementUtils:Elements

the element utils

typeUtils:Types

the type utils

ownerElt:TypeElement

the type element in which this tag is declared

Returns:Function<Token, Token>

the mapper

toHtmlback to summary
public 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.

Parameters
tokens:List<Token>

the tokens to render

margin:String

the left margin

linkToHtml:Function<Tag.Link, String>

the function that renders a tag link to HTML markup

sep:String

the separator

Returns:String

the rendered HTML

toHtmlback to summary
public 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.

Parameters
tokens:List<Token>

the tokens to render

margin:String

the left margin

linkToHtml:Function<Tag.Link, String>

the function that renders a tag link to HTML markup

sep:String

the separator

writer:PrintWriter

the writer for output

tokenizeback to summary
public static List<Token> tokenize(String s)

Tokenize the string.

Parameters
s:String

the string to tokenize

Returns:List<Token>

the tokens after analysis

io.vertx.codegen.doc back to summary

public Class Token.InlineTag

extends Token
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Tag
Inherited from io.vertx.codegen.doc.Token:
value

Constructor Summary

AccessConstructor and Description
public
InlineTag(String value, Tag tag)

Method Summary

Modifier and TypeMethod and Description
public Tag

Returns:

the parsed tag
getTag
()

public boolean
Inherited from io.vertx.codegen.doc.Token:
getValueisLineBreakisTexttagMappertoHtmltoHtmltokenize

Field Detail

tagback to summary
private final Tag tag

Constructor Detail

InlineTagback to summary
public InlineTag(String value, Tag tag)

Method Detail

getTagback to summary
public Tag getTag()
Returns:Tag

the parsed tag

isInlineTagback to summary
public boolean isInlineTag()

Overrides io.vertx.codegen.doc.Token.isInlineTag.

Returns:boolean

Doc from io.vertx.codegen.doc.Token.isInlineTag.

true if the token is an inline tag

Annotations
@Override
io.vertx.codegen.doc back to summary

public Class Token.LineBreak

extends Token
Class Inheritance

Field Summary

Inherited from io.vertx.codegen.doc.Token:
value

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
Inherited from io.vertx.codegen.doc.Token:
getValueisInlineTagisTexttagMappertoHtmltoHtmltokenize

Constructor Detail

LineBreakback to summary
public LineBreak(String value)

Method Detail

isLineBreakback to summary
public boolean isLineBreak()

Overrides io.vertx.codegen.doc.Token.isLineBreak.

Returns:boolean

Doc from io.vertx.codegen.doc.Token.isLineBreak.

true if the token is line break

Annotations
@Override
io.vertx.codegen.doc back to summary

public Class Token.Text

extends Token
Class Inheritance

Field Summary

Inherited from io.vertx.codegen.doc.Token:
value

Constructor Summary

AccessConstructor and Description
public
Text(String value)

Method Summary

Modifier and TypeMethod and Description
public boolean
Inherited from io.vertx.codegen.doc.Token:
getValueisInlineTagisLineBreaktagMappertoHtmltoHtmltokenize

Constructor Detail

Textback to summary
public Text(String value)

Method Detail

isTextback to summary
public boolean isText()

Overrides io.vertx.codegen.doc.Token.isText.

Returns:boolean

Doc from io.vertx.codegen.doc.Token.isText.

true if the token is text

Annotations
@Override