Package org.getalp.dbnary.wiki
Class WikiText.WikiContent
- java.lang.Object
-
- org.getalp.dbnary.wiki.WikiText.Token
-
- org.getalp.dbnary.wiki.WikiText.WikiContent
-
- All Implemented Interfaces:
Visitable
- Enclosing class:
- WikiText
public final class WikiText.WikiContent extends WikiText.Token
Upper element containing text/links/templates and comments interleaved
-
-
Field Summary
-
Fields inherited from class org.getalp.dbnary.wiki.WikiText.Token
offset
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(Visitor<T> visitor)
protected void
addToken(WikiText.Token t)
WikiText.WikiContent
asWikiContent()
WikiText.Text
endOfContent()
void
fillText(StringBuilder r)
WikiEventsSequence
filteredTokens(WikiEventFilter filter)
WikiEventsSequence
headers()
WikiEventsSequence
headers(int level)
WikiEventsSequence
headersMatching(int level, Pattern pattern)
WikiEventsSequence
headersMatching(Pattern pattern)
WikiEventsSequence
links()
WikiEventsSequence
sections()
WikiSectionsSequence
sections(int level)
WikiEventsSequence
templates()
WikiEventsSequence
templatesOnUpperLevel()
List<WikiText.Token>
tokens()
returns a List of wikiTokens including Text tokens that may be intertwined.List<WikiText.Token>
tokensWithHtmlComments()
returns a List of wikiTokens including Text tokens that may be intertwined.List<WikiText.Token>
wikiTokens()
returns all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments.Stream<WikiText.Token>
wikiTokensStream()
returns a stream serving all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments.Stream<WikiText.Token>
wikiTokensStreamWithHtmlComments()
returns a stream serving all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments.List<WikiText.Token>
wikiTokensWithHtmlComments()
returns all wikiTokens in the wikiText, that is all special media wiki constructs, including html comments.-
Methods inherited from class org.getalp.dbnary.wiki.WikiText.Token
addFlattenedTokens, asExternalLink, asHeading, asHTMLComment, asIndentation, asIndentedItem, asInternalLink, asItem, asLink, asListItem, asNoWiki, asNumberedListItem, asTemplate, asText, asWikiSection, getBeginIndex, getEndIndex, getFullContent, getText, getWikiText, setEndOffset, toString
-
-
-
-
Method Detail
-
addToken
protected void addToken(WikiText.Token t)
- Specified by:
addToken
in classWikiText.Token
-
wikiTokensStream
public Stream<WikiText.Token> wikiTokensStream()
returns a stream serving all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments. This does not return the text tokens that are intertwined between the wiki tokens.- Returns:
- a Stream of Tokens
-
wikiTokens
public List<WikiText.Token> wikiTokens()
returns all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments. This does not return the text tokens that are intertwined between the wiki tokens.- Returns:
- a sequence of Tokens
-
wikiTokensStreamWithHtmlComments
public Stream<WikiText.Token> wikiTokensStreamWithHtmlComments()
returns a stream serving all wikiTokens in the wikiText, that is all special media wiki constructs, excluding html comments. This does not return the text tokens that are intertwined between the wiki tokens.- Returns:
- a Stream of Tokens
-
wikiTokensWithHtmlComments
public List<WikiText.Token> wikiTokensWithHtmlComments()
returns all wikiTokens in the wikiText, that is all special media wiki constructs, including html comments. This does not return the text tokens that are intertwined between the wiki tokens.- Returns:
- a sequence of all Wiki Tokens
-
tokens
public List<WikiText.Token> tokens()
returns a List of wikiTokens including Text tokens that may be intertwined. HTML comments are ignored. Two successive Texts may be found if a comment was present in the wiki source.- Returns:
- a list of tokens (either text or wikiTokens)
-
tokensWithHtmlComments
public List<WikiText.Token> tokensWithHtmlComments()
returns a List of wikiTokens including Text tokens that may be intertwined. HTML comments are included in the list.- Returns:
- a list of tokens (either text or wikiTokens)
-
fillText
public void fillText(StringBuilder r)
- Specified by:
fillText
in classWikiText.Token
-
filteredTokens
public WikiEventsSequence filteredTokens(WikiEventFilter filter)
-
sections
public WikiSectionsSequence sections(int level)
-
endOfContent
public WikiText.Text endOfContent()
-
links
public WikiEventsSequence links()
-
templatesOnUpperLevel
public WikiEventsSequence templatesOnUpperLevel()
-
templates
public WikiEventsSequence templates()
-
headers
public WikiEventsSequence headers()
-
sections
public WikiEventsSequence sections()
-
headers
public WikiEventsSequence headers(int level)
-
headersMatching
public WikiEventsSequence headersMatching(Pattern pattern)
-
headersMatching
public WikiEventsSequence headersMatching(int level, Pattern pattern)
-
accept
public <T> T accept(Visitor<T> visitor)
-
asWikiContent
public WikiText.WikiContent asWikiContent()
- Overrides:
asWikiContent
in classWikiText.Token
-
-