Class WikiText.Token
java.lang.Object
org.getalp.dbnary.wiki.WikiText.Token
- All Implemented Interfaces:
Visitable
- Direct Known Subclasses:
WikiText.Heading, WikiText.HTMLComment, WikiText.IndentedItem, WikiText.Link, WikiText.NoWiki, WikiText.Template, WikiText.Text, WikiText.WikiContent, WikiText.WikiSection
- Enclosing class:
WikiText
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract voidasItem()asLink()asNoWiki()asText()protected abstract voidintget the index at which this token starts in its WikiText FullContent.intget the index at which this token ends in its WikiText FullContent.returns the full source content that support the wikiText as its specified offsets.getText()returns the content as a String.protected voidsetEndOffset(int endOffset) toString()
-
Field Details
-
offset
-
-
Constructor Details
-
Token
public Token()
-
-
Method Details
-
addToken
-
setEndOffset
protected void setEndOffset(int endOffset) -
addFlattenedTokens
-
getWikiText
-
toString
-
getText
returns the content as a String. All tokens will be rendered as their source text, without any html comments that were present in the wiki source. NOTE: the toString() method will return the wikiSource WITH comments and nowiki tags.- Returns:
- a list of tokens (either text or wikiTokens)
-
fillText
-
getFullContent
returns the full source content that support the wikiText as its specified offsets.- Returns:
- the MediaWiki source String
-
getBeginIndex
public int getBeginIndex()get the index at which this token starts in its WikiText FullContent.- Returns:
- the begin index, relative to the WikiText source content
-
getEndIndex
public int getEndIndex()get the index at which this token ends in its WikiText FullContent.- Returns:
- the end index, relative to the WikiText source content
-
asExternalLink
-
asHeading
-
asHTMLComment
-
asNoWiki
-
asInternalLink
-
asLink
-
asIndentedItem
-
asIndentation
-
asItem
-
asListItem
-
asNumberedListItem
-
asTemplate
-
asText
-
asWikiContent
-
asWikiSection
-