class NodeText
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
NodeText.Option |
Modifier and Type | Field and Description |
---|---|
private java.util.List<TextElement> |
elements |
private LexicalPreservingPrinter |
lexicalPreservingPrinter |
static int |
NOT_FOUND |
Constructor and Description |
---|
NodeText(LexicalPreservingPrinter lexicalPreservingPrinter)
Initialize with an empty list of elements.
|
NodeText(LexicalPreservingPrinter lexicalPreservingPrinter,
java.util.List<TextElement> elements) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addChild(int index,
Node child) |
(package private) void |
addChild(Node child) |
(package private) void |
addElement(int index,
TextElement nodeTextElement)
Add an element at the given position.
|
(package private) void |
addElement(TextElement nodeTextElement)
Add an element at the end.
|
(package private) void |
addToken(int index,
int tokenKind,
java.lang.String text) |
(package private) void |
addToken(int tokenKind,
java.lang.String text) |
(package private) java.lang.String |
expand()
Generate the corresponding string.
|
(package private) int |
findChild(Node child) |
(package private) int |
findChild(Node child,
int from) |
(package private) int |
findElement(TextElementMatcher matcher) |
(package private) int |
findElement(TextElementMatcher matcher,
int from) |
(package private) java.util.List<TextElement> |
getElements() |
(package private) LexicalPreservingPrinter |
getLexicalPreservingPrinter() |
(package private) TextElement |
getTextElement(int index) |
(package private) int |
numberOfElements() |
(package private) void |
remove(TextElementMatcher matcher) |
void |
remove(TextElementMatcher matcher,
boolean potentiallyFollowingWhitespace) |
(package private) void |
removeElement(int index) |
(package private) void |
replace(TextElementMatcher position,
TextElement newElement) |
java.lang.String |
toString() |
(package private) int |
tryToFindChild(Node child) |
(package private) int |
tryToFindChild(Node child,
int from) |
(package private) int |
tryToFindElement(TextElementMatcher matcher,
int from) |
private final LexicalPreservingPrinter lexicalPreservingPrinter
private final java.util.List<TextElement> elements
public static final int NOT_FOUND
NodeText(LexicalPreservingPrinter lexicalPreservingPrinter, java.util.List<TextElement> elements)
NodeText(LexicalPreservingPrinter lexicalPreservingPrinter)
LexicalPreservingPrinter getLexicalPreservingPrinter()
void addElement(TextElement nodeTextElement)
void addElement(int index, TextElement nodeTextElement)
void addChild(Node child)
void addChild(int index, Node child)
void addToken(int tokenKind, java.lang.String text)
void addToken(int index, int tokenKind, java.lang.String text)
int findElement(TextElementMatcher matcher)
int findElement(TextElementMatcher matcher, int from)
int tryToFindElement(TextElementMatcher matcher, int from)
int findChild(Node child)
int findChild(Node child, int from)
int tryToFindChild(Node child)
int tryToFindChild(Node child, int from)
void remove(TextElementMatcher matcher)
public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace)
void removeElement(int index)
void replace(TextElementMatcher position, TextElement newElement)
java.lang.String expand()
int numberOfElements()
TextElement getTextElement(int index)
java.util.List<TextElement> getElements()
public java.lang.String toString()
toString
in class java.lang.Object