Class TextChunk

java.lang.Object
org.antlr.v4.runtime.tree.pattern.Chunk
org.antlr.v4.runtime.tree.pattern.TextChunk

class TextChunk extends Chunk
Represents a span of raw text (concrete syntax) between tags in a tree pattern string.
  • Field Details

    • text

      private final String text
      This is the backing field for getText().
  • Constructor Details

    • TextChunk

      public TextChunk(String text)
      Constructs a new instance of TextChunk with the specified text.
      Parameters:
      text - The text of this chunk.
      Throws:
      IllegalArgumentException - if text is null.
  • Method Details

    • getText

      public final String getText()
      Gets the raw text of this chunk.
      Returns:
      The text of the chunk.
    • toString

      public String toString()

      The implementation for TextChunk returns the result of getText() in single quotes.

      Overrides:
      toString in class Object