Package com.github.javaparser.ast.expr
Class Expression
java.lang.Object
com.github.javaparser.ast.Node
com.github.javaparser.ast.expr.Expression
- All Implemented Interfaces:
NodeWithRange<Node>
,NodeWithTokenRange<Node>
,Observable
,Visitable
,HasParentNode<Node>
,Cloneable
- Direct Known Subclasses:
AnnotationExpr
,ArrayAccessExpr
,ArrayCreationExpr
,ArrayInitializerExpr
,AssignExpr
,BinaryExpr
,CastExpr
,ClassExpr
,ConditionalExpr
,EnclosedExpr
,FieldAccessExpr
,InstanceOfExpr
,LambdaExpr
,LiteralExpr
,MethodCallExpr
,MethodReferenceExpr
,NameExpr
,ObjectCreationExpr
,PatternExpr
,SuperExpr
,SwitchExpr
,ThisExpr
,TypeExpr
,UnaryExpr
,VariableDeclarationExpr
A base class for all expressions.
- Author:
- Julio Vilmar Gesser
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.javaparser.ast.Node
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
-
Field Summary
Fields inherited from class com.github.javaparser.ast.Node
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionExpression(TokenRange tokenRange)
This constructor is used by the parser and is considered private. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
returns the type associated with the node.clone()
boolean
void
ifAnnotationExpr(Consumer<AnnotationExpr> action)
void
ifArrayAccessExpr(Consumer<ArrayAccessExpr> action)
void
ifArrayCreationExpr(Consumer<ArrayCreationExpr> action)
void
void
ifAssignExpr(Consumer<AssignExpr> action)
void
ifBinaryExpr(Consumer<BinaryExpr> action)
void
ifBooleanLiteralExpr(Consumer<BooleanLiteralExpr> action)
void
ifCastExpr(Consumer<CastExpr> action)
void
ifCharLiteralExpr(Consumer<CharLiteralExpr> action)
void
ifClassExpr(Consumer<ClassExpr> action)
void
ifConditionalExpr(Consumer<ConditionalExpr> action)
void
ifDoubleLiteralExpr(Consumer<DoubleLiteralExpr> action)
void
ifEnclosedExpr(Consumer<EnclosedExpr> action)
void
ifFieldAccessExpr(Consumer<FieldAccessExpr> action)
void
ifInstanceOfExpr(Consumer<InstanceOfExpr> action)
void
ifIntegerLiteralExpr(Consumer<IntegerLiteralExpr> action)
void
ifLambdaExpr(Consumer<LambdaExpr> action)
void
ifLiteralExpr(Consumer<LiteralExpr> action)
void
void
ifLongLiteralExpr(Consumer<LongLiteralExpr> action)
void
void
ifMethodCallExpr(Consumer<MethodCallExpr> action)
void
ifMethodReferenceExpr(Consumer<MethodReferenceExpr> action)
void
ifNameExpr(Consumer<NameExpr> action)
void
void
ifNullLiteralExpr(Consumer<NullLiteralExpr> action)
void
ifObjectCreationExpr(Consumer<ObjectCreationExpr> action)
void
ifPatternExpr(Consumer<PatternExpr> action)
void
void
ifStringLiteralExpr(Consumer<StringLiteralExpr> action)
void
ifSuperExpr(Consumer<SuperExpr> action)
void
ifSwitchExpr(Consumer<SwitchExpr> action)
void
void
ifThisExpr(Consumer<ThisExpr> action)
void
ifTypeExpr(Consumer<TypeExpr> action)
void
ifUnaryExpr(Consumer<UnaryExpr> action)
void
boolean
boolean
boolean
boolean
boolean
protected boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
protected boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
See https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2boolean
boolean
boolean
See https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, hasParentNode, isDescendantOf
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
-
Constructor Details
-
Expression
public Expression() -
Expression
This constructor is used by the parser and is considered private.
-
-
Method Details
-
remove
-
clone
-
getMetaModel
- Overrides:
getMetaModel
in classNode
- Returns:
- get JavaParser specific node introspection information.
-
replace
-
isAnnotationExpr
public boolean isAnnotationExpr() -
asAnnotationExpr
-
isArrayAccessExpr
public boolean isArrayAccessExpr() -
asArrayAccessExpr
-
isArrayCreationExpr
public boolean isArrayCreationExpr() -
asArrayCreationExpr
-
isArrayInitializerExpr
public boolean isArrayInitializerExpr() -
asArrayInitializerExpr
-
isAssignExpr
public boolean isAssignExpr() -
asAssignExpr
-
isBinaryExpr
public boolean isBinaryExpr() -
asBinaryExpr
-
isBooleanLiteralExpr
public boolean isBooleanLiteralExpr() -
asBooleanLiteralExpr
-
isCastExpr
public boolean isCastExpr() -
asCastExpr
-
isCharLiteralExpr
public boolean isCharLiteralExpr() -
asCharLiteralExpr
-
isClassExpr
public boolean isClassExpr() -
asClassExpr
-
isConditionalExpr
public boolean isConditionalExpr() -
asConditionalExpr
-
isDoubleLiteralExpr
public boolean isDoubleLiteralExpr() -
asDoubleLiteralExpr
-
isEnclosedExpr
public boolean isEnclosedExpr() -
asEnclosedExpr
-
isFieldAccessExpr
public boolean isFieldAccessExpr() -
asFieldAccessExpr
-
isInstanceOfExpr
public boolean isInstanceOfExpr() -
asInstanceOfExpr
-
isIntegerLiteralExpr
public boolean isIntegerLiteralExpr() -
asIntegerLiteralExpr
-
isLambdaExpr
public boolean isLambdaExpr() -
asLambdaExpr
-
isLiteralExpr
public boolean isLiteralExpr() -
asLiteralExpr
-
isLiteralStringValueExpr
public boolean isLiteralStringValueExpr() -
asLiteralStringValueExpr
-
isLongLiteralExpr
public boolean isLongLiteralExpr() -
asLongLiteralExpr
-
isMarkerAnnotationExpr
public boolean isMarkerAnnotationExpr() -
asMarkerAnnotationExpr
-
isMethodCallExpr
public boolean isMethodCallExpr() -
asMethodCallExpr
-
isMethodReferenceExpr
public boolean isMethodReferenceExpr() -
asMethodReferenceExpr
-
isNameExpr
public boolean isNameExpr() -
asNameExpr
-
isNormalAnnotationExpr
public boolean isNormalAnnotationExpr() -
asNormalAnnotationExpr
-
isNullLiteralExpr
public boolean isNullLiteralExpr() -
asNullLiteralExpr
-
isObjectCreationExpr
public boolean isObjectCreationExpr() -
asObjectCreationExpr
-
isSingleMemberAnnotationExpr
public boolean isSingleMemberAnnotationExpr() -
asSingleMemberAnnotationExpr
-
isStringLiteralExpr
public boolean isStringLiteralExpr() -
asStringLiteralExpr
-
isSuperExpr
public boolean isSuperExpr() -
asSuperExpr
-
isThisExpr
public boolean isThisExpr() -
asThisExpr
-
isTypeExpr
public boolean isTypeExpr() -
asTypeExpr
-
isUnaryExpr
public boolean isUnaryExpr() -
asUnaryExpr
-
isVariableDeclarationExpr
public boolean isVariableDeclarationExpr() -
asVariableDeclarationExpr
-
ifAnnotationExpr
-
ifArrayAccessExpr
-
ifArrayCreationExpr
-
ifArrayInitializerExpr
-
ifAssignExpr
-
ifBinaryExpr
-
ifBooleanLiteralExpr
-
ifCastExpr
-
ifCharLiteralExpr
-
ifClassExpr
-
ifConditionalExpr
-
ifDoubleLiteralExpr
-
ifEnclosedExpr
-
ifFieldAccessExpr
-
ifInstanceOfExpr
-
ifIntegerLiteralExpr
-
ifLambdaExpr
-
ifLiteralExpr
-
ifLiteralStringValueExpr
-
ifLongLiteralExpr
-
ifMarkerAnnotationExpr
-
ifMethodCallExpr
-
ifMethodReferenceExpr
-
ifNameExpr
-
ifNormalAnnotationExpr
-
ifNullLiteralExpr
-
ifObjectCreationExpr
-
ifSingleMemberAnnotationExpr
-
ifStringLiteralExpr
-
ifSuperExpr
-
ifThisExpr
-
ifTypeExpr
-
ifUnaryExpr
-
ifVariableDeclarationExpr
-
calculateResolvedType
returns the type associated with the node. -
toAnnotationExpr
-
toArrayAccessExpr
-
toArrayCreationExpr
-
toArrayInitializerExpr
-
toAssignExpr
-
toBinaryExpr
-
toBooleanLiteralExpr
-
toCastExpr
-
toCharLiteralExpr
-
toClassExpr
-
toConditionalExpr
-
toDoubleLiteralExpr
-
toEnclosedExpr
-
toFieldAccessExpr
-
toInstanceOfExpr
-
toIntegerLiteralExpr
-
toLambdaExpr
-
toLiteralExpr
-
toLiteralStringValueExpr
-
toLongLiteralExpr
-
toMarkerAnnotationExpr
-
toMethodCallExpr
-
toMethodReferenceExpr
-
toNameExpr
-
toNormalAnnotationExpr
-
toNullLiteralExpr
-
toObjectCreationExpr
-
toSingleMemberAnnotationExpr
-
toStringLiteralExpr
-
toSuperExpr
-
toThisExpr
-
toTypeExpr
-
toUnaryExpr
-
toVariableDeclarationExpr
-
isSwitchExpr
public boolean isSwitchExpr() -
asSwitchExpr
-
toSwitchExpr
-
ifSwitchExpr
-
isTextBlockLiteralExpr
public boolean isTextBlockLiteralExpr() -
asTextBlockLiteralExpr
-
toTextBlockLiteralExpr
-
ifTextBlockLiteralExpr
-
isPatternExpr
public boolean isPatternExpr() -
asPatternExpr
-
toPatternExpr
-
ifPatternExpr
-
isStandaloneExpression
public boolean isStandaloneExpression()See https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2- Returns:
- true if the expression is a standalone expression
-
isPolyExpression
public boolean isPolyExpression()See https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2- Returns:
- true if the expression is a poly expression
-
isQualified
public boolean isQualified() -
appearsInAssignmentContext
public final boolean appearsInAssignmentContext() -
isAssignmentContext
protected boolean isAssignmentContext() -
appearsInInvocationContext
public final boolean appearsInInvocationContext() -
isInvocationContext
protected boolean isInvocationContext() -
elidesTypeArguments
public final boolean elidesTypeArguments()
-