Class ChildTextElement
- java.lang.Object
-
- com.github.javaparser.printer.lexicalpreservation.TextElement
-
- com.github.javaparser.printer.lexicalpreservation.ChildTextElement
-
- All Implemented Interfaces:
TextElementMatcher
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 boolean
equals(java.lang.Object o)
(package private) java.lang.String
expand()
(package private) Node
getChild()
(package private) NodeText
getNodeTextForWrappedNode()
(package private) java.util.Optional<Range>
getRange()
int
hashCode()
boolean
isChildOfClass(java.lang.Class<? extends Node> nodeClass)
Is this TextElement representing a child of the given class?boolean
isComment()
boolean
isIdentifier()
boolean
isKeyword()
boolean
isLiteral()
boolean
isNewline()
(package private) boolean
isNode(Node node)
boolean
isPrimitive()
boolean
isSeparator()
boolean
isSpaceOrTab()
(package private) boolean
isToken(int tokenKind)
boolean
isWhiteSpace()
java.lang.String
toString()
-
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
java.lang.String expand()
- Specified by:
expand
in classTextElement
-
getChild
Node getChild()
-
isToken
boolean isToken(int tokenKind)
- Specified by:
isToken
in classTextElement
-
isNode
boolean isNode(Node node)
- Specified by:
isNode
in classTextElement
-
getNodeTextForWrappedNode
NodeText getNodeTextForWrappedNode()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isWhiteSpace
public boolean isWhiteSpace()
- Specified by:
isWhiteSpace
in classTextElement
-
isSpaceOrTab
public boolean isSpaceOrTab()
- Specified by:
isSpaceOrTab
in classTextElement
-
isNewline
public boolean isNewline()
- Specified by:
isNewline
in classTextElement
-
isComment
public boolean isComment()
- Specified by:
isComment
in classTextElement
-
isSeparator
public boolean isSeparator()
- Specified by:
isSeparator
in classTextElement
-
isIdentifier
public boolean isIdentifier()
- Specified by:
isIdentifier
in classTextElement
-
isKeyword
public boolean isKeyword()
- Specified by:
isKeyword
in classTextElement
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in classTextElement
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteral
in classTextElement
-
isChildOfClass
public boolean isChildOfClass(java.lang.Class<? extends Node> nodeClass)
Description copied from class:TextElement
Is this TextElement representing a child of the given class?- Specified by:
isChildOfClass
in classTextElement
-
getRange
java.util.Optional<Range> getRange()
- Specified by:
getRange
in classTextElement
-
-