Class ChildTextElement
- java.lang.Object
-
- com.github.javaparser.printer.lexicalpreservation.TextElement
-
- com.github.javaparser.printer.lexicalpreservation.ChildTextElement
-
- All Implemented Interfaces:
PrintableTextElement,TextElementMatcher
public class ChildTextElement extends TextElement
Represent the position of a child node in the NodeText of its parent.
-
-
Constructor Summary
Constructors Constructor Description ChildTextElement(Node child)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(LexicalPreservingVisitor visitor)booleanequals(java.lang.Object o)java.lang.Stringexpand()NodegetChild()(package private) NodeTextgetNodeTextForWrappedNode()(package private) java.util.Optional<Range>getRange()inthashCode()booleanisChildOfClass(java.lang.Class<? extends Node> nodeClass)Is this TextElement representing a child of the given class?booleanisComment()booleanisIdentifier()booleanisKeyword()booleanisLiteral()booleanisNewline()booleanisNode(Node node)booleanisPrimitive()booleanisSeparator()booleanisSpaceOrTab()booleanisToken(int tokenKind)booleanisWhiteSpace()java.lang.StringtoString()-
Methods inherited from class com.github.javaparser.printer.lexicalpreservation.TextElement
isChild, isCommentToken, isWhiteSpaceOrComment, match, matchByRange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.printer.lexicalpreservation.TextElementMatcher
and
-
-
-
-
Field Detail
-
child
private final Node child
-
-
Constructor Detail
-
ChildTextElement
ChildTextElement(Node child)
-
-
Method Detail
-
expand
public java.lang.String expand()
- Specified by:
expandin classTextElement
-
getChild
public Node getChild()
-
isToken
public boolean isToken(int tokenKind)
- Specified by:
isTokenin classTextElement
-
isNode
public boolean isNode(Node node)
- Specified by:
isNodein classTextElement
-
getNodeTextForWrappedNode
NodeText getNodeTextForWrappedNode()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isWhiteSpace
public boolean isWhiteSpace()
- Specified by:
isWhiteSpacein classTextElement
-
isSpaceOrTab
public boolean isSpaceOrTab()
- Specified by:
isSpaceOrTabin classTextElement
-
isNewline
public boolean isNewline()
- Specified by:
isNewlinein classTextElement
-
isComment
public boolean isComment()
- Specified by:
isCommentin classTextElement
-
isSeparator
public boolean isSeparator()
- Specified by:
isSeparatorin classTextElement
-
isIdentifier
public boolean isIdentifier()
- Specified by:
isIdentifierin classTextElement
-
isKeyword
public boolean isKeyword()
- Specified by:
isKeywordin classTextElement
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein classTextElement
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteralin classTextElement
-
isChildOfClass
public boolean isChildOfClass(java.lang.Class<? extends Node> nodeClass)
Description copied from class:TextElementIs this TextElement representing a child of the given class?- Specified by:
isChildOfClassin classTextElement
-
getRange
java.util.Optional<Range> getRange()
- Specified by:
getRangein classTextElement
-
accept
public void accept(LexicalPreservingVisitor visitor)
-
-