java.lang.Object
com.github.javaparser.printer.lexicalpreservation.NodeText

class NodeText extends Object
This contains the lexical information for a single node. It is basically a list of tokens and children.
  • Field Details

  • Constructor Details

    • NodeText

      NodeText(List<TextElement> elements)
    • NodeText

      NodeText()
      Initialize with an empty list of elements.
  • Method Details

    • addElement

      void addElement(TextElement nodeTextElement)
      Add an element at the end.
    • addElement

      void addElement(int index, TextElement nodeTextElement)
      Add an element at the given position.
    • addChild

      void addChild(Node child)
    • addChild

      void addChild(int index, Node child)
    • addToken

      void addToken(int tokenKind, String text)
    • addToken

      void addToken(int index, int tokenKind, String text)
    • findElement

      int findElement(TextElementMatcher matcher)
    • findElement

      int findElement(TextElementMatcher matcher, int from)
    • tryToFindElement

      int tryToFindElement(TextElementMatcher matcher, int from)
    • findChild

      int findChild(Node child)
    • findChild

      int findChild(Node child, int from)
    • tryToFindChild

      int tryToFindChild(Node child)
    • tryToFindChild

      int tryToFindChild(Node child, int from)
    • remove

      public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace)
    • removeElement

      void removeElement(int index)
    • replace

      void replace(TextElementMatcher position, TextElement newElement)
    • expand

      String expand()
      Generate the corresponding string.
    • numberOfElements

      int numberOfElements()
    • getTextElement

      TextElement getTextElement(int index)
    • getElements

      List<TextElement> getElements()
    • toString

      public String toString()
      Overrides:
      toString in class Object