Top Description Inners Fields Constructors Methods
com.github.javaparser.printer.lexicalpreservation

pack-priv Class NodeText

extends Object
Class Inheritance
Imports
com.github.javaparser.GeneratedJavaParserConstants, com.github.javaparser.ast.Node, java.util.LinkedList, .List, java.util.stream.Collectors

This contains the lexical information for a single node. It is basically a list of tokens and children.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final List<TextElement>
public static final int

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
NodeText()

Initialize with an empty list of elements.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addChild(Node child)

pack-priv void
addChild(int index, Node child)

pack-priv void
addElement(TextElement nodeTextElement)

Add an element at the end.

pack-priv void
addElement(int index, TextElement nodeTextElement)

Add an element at the given position.

pack-priv void
addToken(int tokenKind, String text)

pack-priv void
addToken(int index, int tokenKind, String text)

public boolean
pack-priv String
expand()

Generate the corresponding string.

pack-priv int
findChild(Node child)

pack-priv int
findChild(Node child, int from)

pack-priv int
pack-priv int
findElement(TextElementMatcher matcher, int from)

pack-priv List<TextElement>
pack-priv TextElement
getTextElement(int index)

pack-priv int
pack-priv void
public void
remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace)

pack-priv void
removeElement(int index)

public void
pack-priv void
replace(TextElementMatcher position, TextElement newElement)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv int
pack-priv int
tryToFindChild(Node child, int from)

pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

elementsback to summary
private final List<TextElement> elements
NOT_FOUNDback to summary
public static final int NOT_FOUND

Constructor Detail

NodeTextback to summary
pack-priv NodeText(List<TextElement> elements)
NodeTextback to summary
pack-priv NodeText()

Initialize with an empty list of elements.

Method Detail

addChildback to summary
pack-priv void addChild(Node child)
addChildback to summary
pack-priv void addChild(int index, Node child)
addElementback to summary
pack-priv void addElement(TextElement nodeTextElement)

Add an element at the end.

addElementback to summary
pack-priv void addElement(int index, TextElement nodeTextElement)

Add an element at the given position.

addTokenback to summary
pack-priv void addToken(int tokenKind, String text)
addTokenback to summary
pack-priv void addToken(int index, int tokenKind, String text)
endWithSpaceback to summary
public boolean endWithSpace()
expandback to summary
pack-priv String expand()

Generate the corresponding string.

findChildback to summary
pack-priv int findChild(Node child)
findChildback to summary
pack-priv int findChild(Node child, int from)
findElementback to summary
pack-priv int findElement(TextElementMatcher matcher)
findElementback to summary
pack-priv int findElement(TextElementMatcher matcher, int from)
getElementsback to summary
pack-priv List<TextElement> getElements()
getTextElementback to summary
pack-priv TextElement getTextElement(int index)
numberOfElementsback to summary
pack-priv int numberOfElements()
removeback to summary
pack-priv void remove(TextElementMatcher matcher)
removeback to summary
public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace)
removeElementback to summary
pack-priv void removeElement(int index)
removeLastElementback to summary
public void removeLastElement()
replaceback to summary
pack-priv void replace(TextElementMatcher position, TextElement newElement)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
tryToFindChildback to summary
pack-priv int tryToFindChild(Node child)
tryToFindChildback to summary
pack-priv int tryToFindChild(Node child, int from)
tryToFindElementback to summary
pack-priv int tryToFindElement(TextElementMatcher matcher, int from)
com.github.javaparser.printer.lexicalpreservation back to summary

pack-priv final Enum NodeText.Option

extends Enum<NodeText.Option>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final NodeText.Option
public static final NodeText.Option
public static final NodeText.Option

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static NodeText.Option
public static NodeText.Option[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXCLUDE_ENDback to summary
public static final NodeText.Option EXCLUDE_END
EXCLUDE_STARTback to summary
public static final NodeText.Option EXCLUDE_START
REMOVE_SPACE_IMMEDIATELY_AFTERback to summary
public static final NodeText.Option REMOVE_SPACE_IMMEDIATELY_AFTER

Constructor Detail

Optionback to summary
private Option()

Method Detail

valueOfback to summary
public static NodeText.Option valueOf(String name)
valuesback to summary
public static NodeText.Option[] values()