Class TextChunk


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

      Fields 
      Modifier and Type Field Description
      private java.lang.String text
      This is the backing field for getText().
    • Constructor Summary

      Constructors 
      Constructor Description
      TextChunk​(java.lang.String text)
      Constructs a new instance of TextChunk with the specified text.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getText()
      Gets the raw text of this chunk.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • text

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

      • TextChunk

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

      • getText

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

        public java.lang.String toString()

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

        Overrides:
        toString in class java.lang.Object