All Implemented Interfaces:
WikiTextElement

public class ListItem extends WikiTextParentNode implements WikiTextElement
An item within a list
WikiText: * item, # item, or :item
XML: listItem
  • Constructor Details

    • ListItem

      public ListItem(Optional<Integer> level, List<WikiTextNode> content)
      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

      public <T> Optional<T> accept(WikiTextASTVisitor<T> visitor)
      Description copied from class: WikiTextNode
      Hook for an AST visitor.
      Specified by:
      accept in class WikiTextNode
      Type Parameters:
      T - Whatever the visitor produces.
      Parameters:
      visitor - The visitor doing the visitor.
      Returns:
      Whatever the visitor produced.
    • getAttributes

      public List<NodeAttribute> getAttributes()
      Description copied from class: WikiTextNode
      Base case for getting element attributes. Most nodes have no attributes
      Overrides:
      getAttributes in class WikiTextNode
      Returns:
      Attributes
    • getLevel

      public Integer getLevel()
      List items can have sublists. The level represents whether this is the case.
      Returns:
      The list level.