Top Description Fields Constructors Methods
org.antlr.v4.runtime.tree.pattern

pack-priv Class TextChunk

extends Chunk
Class Inheritance
Imports
org.antlr.v4.runtime.misc.NotNull

Represents a span of raw text (concrete syntax) between tags in a tree pattern string.

Field Summary

Modifier and TypeField and Description
private final String
text

This is the backing field for getText.

Constructor Summary

AccessConstructor and Description
public
TextChunk(String
The text of this chunk.
text
)

Constructs a new instance of TextChunk with the specified text.

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

The text of the chunk.
getText
()

Gets the raw text of this chunk.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

textback to summary
private final String text

This is the backing field for getText.

Annotations
@NotNull

Constructor Detail

TextChunkback to summary
public TextChunk(String text)

Constructs a new instance of TextChunk with the specified text.

Parameters
text:String

The text of this chunk.

Exceptions
IllegalArgumentException:
if text is null.

Method Detail

getTextback to summary
public final String getText()

Gets the raw text of this chunk.

Returns:String

The text of the chunk.

Annotations
@NotNull
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

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

Returns:String

a string representation of the object.

Annotations
@Override