All Implemented Interfaces:
WikiTextElement

public class Article extends WikiTextParentNode implements WikiTextElement
The root of the AST, containing all content below.
  • Constructor Details

    • Article

      public Article(List<WikiTextNode> content)
      Creates a tree from the given content.
      Parameters:
      content - The child nodes contained in the article.
  • Method Details

    • from

      public static Article from(List<WikiTextNode> content, CategoryList categories)
      Creates an article with the given categories. Intended to be called from the visitor.
      Parameters:
      content - The child nodes contained in the article.
      categories - What categories the article falls under.
      Returns:
      The fully constructed article.
    • 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.