Class WParser.WikiText

java.lang.Object
org.fastily.jwiki.core.WParser.WikiText
Enclosing class:
WParser

public static class WParser.WikiText
extends Object
Mutable representation of parsed wikitext. May contain Strings and templates.
Author:
Fastily
  • Constructor Details

    • WikiText

      public WikiText​(Object... objects)
      Creates a new WikiText object
      Parameters:
      objects - Any Objects to pre-load this WikiText object with. Acceptable values are of type String or WTemplate.
  • Method Details

    • append

      public void append​(Object o)
      Appends an Object to this WikiText object.
      Parameters:
      o - The Object to append. Acceptable values are of type String or WTemplate.
    • getTemplates

      public ArrayList<WParser.WTemplate> getTemplates()
      Find top-level WTemplates contained by this WikiText
      Returns:
      A List of top-level WTemplates in this WikiText.
    • getTemplatesR

      public ArrayList<WParser.WTemplate> getTemplatesR()
      Recursively finds WTemplate objects contained by this WikiText.
      Returns:
      A List of all WTemplate objects in this WikiText.
    • toString

      public String toString()
      Render this WikiText object as a String. Trims whitespace by default.
      Overrides:
      toString in class Object
    • toString

      public String toString​(boolean doTrim)
      Render this WikiText as a String.
      Parameters:
      doTrim - If true, then trim whitespace.
      Returns:
      A String representation of this WikiText.