Class TextElement
java.lang.Object
com.github.javaparser.printer.lexicalpreservation.TextElement
- All Implemented Interfaces:
PrintableTextElement, TextElementMatcher
- Direct Known Subclasses:
ChildTextElement, TokenTextElement
public abstract class TextElement
extends Object
implements TextElementMatcher, PrintableTextElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract Stringexpand()getRange()booleanisChild()abstract booleanisChildOfClass(Class<? extends Node> nodeClass) Is this TextElement representing a child of the given class?abstract boolean(package private) final booleanabstract booleanabstract booleanabstract booleanabstract boolean(package private) abstract booleanabstract booleanabstract booleanabstract boolean(package private) abstract booleanisToken(int tokenKind) abstract booleanfinal booleanbooleanmatch(TextElement textElement) (package private) TextElementMatcherCreates aTextElementMatcherthat matches any TextElement with the same range as this TextElement.
This can be used to curry another TextElementMatcher.
e.g.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PrintableTextElement
acceptMethods inherited from interface TextElementMatcher
and
-
Constructor Details
-
TextElement
public TextElement()
-
-
Method Details
-
expand
-
isToken
abstract boolean isToken(int tokenKind) -
isCommentToken
final boolean isCommentToken() -
match
- Specified by:
matchin interfaceTextElementMatcher
-
isNode
-
isLiteral
public abstract boolean isLiteral() -
isWhiteSpace
public abstract boolean isWhiteSpace() -
isSpaceOrTab
public abstract boolean isSpaceOrTab() -
isNewline
public abstract boolean isNewline() -
isComment
public abstract boolean isComment() -
isSeparator
public abstract boolean isSeparator() -
isIdentifier
public abstract boolean isIdentifier() -
isKeyword
public abstract boolean isKeyword() -
isPrimitive
public abstract boolean isPrimitive() -
isWhiteSpaceOrComment
public final boolean isWhiteSpaceOrComment() -
isChildOfClass
-
isChild
public boolean isChild() -
getRange
-
matchByRange
TextElementMatcher matchByRange()Creates aTextElementMatcherthat matches any TextElement with the same range as this TextElement.
This can be used to curry another TextElementMatcher.
e.g.someTextElementMatcher.and(textElement.matchByRange());- Returns:
- TextElementMatcher that matches any TextElement with the same Range
-