Class WikiText.Template
java.lang.Object
org.getalp.dbnary.wiki.WikiText.Token
org.getalp.dbnary.wiki.WikiText.Template
- All Implemented Interfaces:
Visitable
- Enclosing class:
WikiText
-
Field Summary
Fields inherited from class WikiText.Token
offset -
Method Summary
Modifier and TypeMethodDescription<T> Tprotected voidreturn a MUTABLE clone of argName/argValue Map.return a MUTABLE clone of argName/argValue Map.voidget the WikiContent value of the requested argument key.getArgs()return the argName/argValue Map.getName()getParsedArg(String key) get the String value of the requested argument key.getParsedArg(String key, String defaultValue) get the String value of the requested argument key, or return default value if argument value is null.return the IMMUTABLE argName/argValue Map.protected voidsetEndOffset(int position) sets the end offset to the given position (should point to the first char of the closing "}}")Methods inherited from class WikiText.Token
addFlattenedTokens, asExternalLink, asHeading, asHTMLComment, asIndentation, asIndentedItem, asInternalLink, asItem, asLink, asListItem, asNoWiki, asNumberedListItem, asText, asWikiContent, asWikiSection, getBeginIndex, getEndIndex, getFullContent, getText, getWikiText, toString
-
Method Details
-
setEndOffset
protected void setEndOffset(int position) sets the end offset to the given position (should point to the first char of the closing "}}")- Overrides:
setEndOffsetin classWikiText.Token- Parameters:
position- the position of the first character of the enclosing "}}"
-
addToken
- Specified by:
addTokenin classWikiText.Token
-
fillText
- Specified by:
fillTextin classWikiText.Token
-
getName
-
getParsedArgs
return the IMMUTABLE argName/argValue Map. argName being a String and argValue a String.When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.
- Returns:
- the argName/argVal map
-
cloneParsedArgs
return a MUTABLE clone of argName/argValue Map. argName being a String and argValue a String.When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.
- Returns:
- the argName/argVal map
-
getParsedArg
get the String value of the requested argument key. If the argument contain wiki tokens, the source text is returned. Use getArgs if you want to get the WikiContent associated to the key.- Parameters:
key- the key of the argument to be retrieved- Returns:
- the value of the argument or null if the argument was not specified
-
getParsedArg
get the String value of the requested argument key, or return default value if argument value is null. If the argument contain wiki tokens, the source text is returned. Use getArgs if you want to get the WikiContent associated to the key.- Parameters:
key- the key of the argument to be retrieveddefaultValue- the default value returned if the argument is undefined- Returns:
- the value of the argument or defaultValue
-
getArgs
return the argName/argValue Map. argName being a String and argValue a WikiContent. When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.- Returns:
- the argName/argVal map
-
cloneArgs
return a MUTABLE clone of argName/argValue Map. argName being a String and argValue a String.When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.
- Returns:
- the argName/argVal map
-
getArg
get the WikiContent value of the requested argument key.- Parameters:
key- the key of the argument to be retrieved- Returns:
- the value of the argument or null if the argument was not specified
-
getContent
-
accept
-
asTemplate
- Overrides:
asTemplatein classWikiText.Token
-