Class ExternalLink
java.lang.Object
com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextNode
com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextParentNode
com.lucaskjaerozhang.wikitext_parser.ast.link.ExternalLink
- All Implemented Interfaces:
WikiTextElement
A link that goes outside of the wiki.
WikiText: [link display]
XML: link
WikiText: [link display]
XML: link
-
Constructor Summary
ConstructorsConstructorDescriptionExternalLink
(String href, boolean hasArrow, List<WikiTextNode> display) Constructs an external link. -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>
accept
(WikiTextASTVisitor<T> visitor) Hook for an AST visitor.Base case for getting element attributes.Methods inherited from class com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextParentNode
getCategories, getFieldValuesFromChildren
-
Constructor Details
-
ExternalLink
Constructs an external link.- Parameters:
href
- The url the link points to.hasArrow
- Whether the link displays with an error.display
- The display text.
-
-
Method Details
-
getAttributes
Description copied from class:WikiTextNode
Base case for getting element attributes. Most nodes have no attributes- Overrides:
getAttributes
in classWikiTextNode
- Returns:
- Attributes
-
accept
Description copied from class:WikiTextNode
Hook for an AST visitor.- Specified by:
accept
in classWikiTextNode
- Type Parameters:
T
- Whatever the visitor produces.- Parameters:
visitor
- The visitor doing the visitor.- Returns:
- Whatever the visitor produced.
-
rebuildWithContext
- Overrides:
rebuildWithContext
in classWikiTextParentNode
-