Class ListItem
java.lang.Object
com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextNode
com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextParentNode
com.lucaskjaerozhang.wikitext_parser.ast.list.ListItem
- All Implemented Interfaces:
WikiTextElement
An item within a list
WikiText: * item, # item, or :item
XML: listItem
WikiText: * item, # item, or :item
XML: listItem
-
Constructor Summary
ConstructorsConstructorDescriptionListItem
(Optional<Integer> level, List<WikiTextNode> content) Create a list item. -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>
accept
(WikiTextASTVisitor<T> visitor) Hook for an AST visitor.Base case for getting element attributes.getLevel()
List items can have sublists.Methods inherited from class com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextParentNode
getCategories, getFieldValuesFromChildren, rebuildWithContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.lucaskjaerozhang.wikitext_parser.ast.base.WikiTextElement
getCategories
-
Constructor Details
-
ListItem
Create a list item.- Parameters:
level
- The item level. This happens because items can contain items.content
- The child nodes of the list item.
-
-
Method Details
-
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.
-
getAttributes
Description copied from class:WikiTextNode
Base case for getting element attributes. Most nodes have no attributes- Overrides:
getAttributes
in classWikiTextNode
- Returns:
- Attributes
-
getLevel
List items can have sublists. The level represents whether this is the case.- Returns:
- The list level.
-