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 TypeMethodDescriptionbooleanbooleanreturns the type associated with the node.clone()booleanvoidifAnnotationExpr(Consumer<AnnotationExpr> action)voidifArrayAccessExpr(Consumer<ArrayAccessExpr> action)voidifArrayCreationExpr(Consumer<ArrayCreationExpr> action)voidvoidifAssignExpr(Consumer<AssignExpr> action)voidifBinaryExpr(Consumer<BinaryExpr> action)voidifBooleanLiteralExpr(Consumer<BooleanLiteralExpr> action)voidifCastExpr(Consumer<CastExpr> action)voidifCharLiteralExpr(Consumer<CharLiteralExpr> action)voidifClassExpr(Consumer<ClassExpr> action)voidifConditionalExpr(Consumer<ConditionalExpr> action)voidifDoubleLiteralExpr(Consumer<DoubleLiteralExpr> action)voidifEnclosedExpr(Consumer<EnclosedExpr> action)voidifFieldAccessExpr(Consumer<FieldAccessExpr> action)voidifInstanceOfExpr(Consumer<InstanceOfExpr> action)voidifIntegerLiteralExpr(Consumer<IntegerLiteralExpr> action)voidifLambdaExpr(Consumer<LambdaExpr> action)voidifLiteralExpr(Consumer<LiteralExpr> action)voidvoidifLongLiteralExpr(Consumer<LongLiteralExpr> action)voidvoidifMethodCallExpr(Consumer<MethodCallExpr> action)voidifMethodReferenceExpr(Consumer<MethodReferenceExpr> action)voidifNameExpr(Consumer<NameExpr> action)voidvoidifNullLiteralExpr(Consumer<NullLiteralExpr> action)voidifObjectCreationExpr(Consumer<ObjectCreationExpr> action)voidifPatternExpr(Consumer<PatternExpr> action)voidvoidifStringLiteralExpr(Consumer<StringLiteralExpr> action)voidifSuperExpr(Consumer<SuperExpr> action)voidifSwitchExpr(Consumer<SwitchExpr> action)voidvoidifThisExpr(Consumer<ThisExpr> action)voidifTypeExpr(Consumer<TypeExpr> action)voidifUnaryExpr(Consumer<UnaryExpr> action)voidbooleanbooleanbooleanbooleanbooleanprotected booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanprotected booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanSee https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2booleanbooleanbooleanSee https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanMethods 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, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walkMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, hasParentNode, isDescendantOfMethods 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
-
clone
-
getMetaModel
- Overrides:
getMetaModelin classNode- Returns:
- get JavaParser specific node introspection information.
-
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()
-