Skip navigation links
oracle.javatools.parser.java.v2.model.expression
Interface SourceExpression
- All Superinterfaces:
- CompiledExpression, Element, JavaElement, JavaHasType, SourceElement
- All Known Subinterfaces:
- SourceAnnotationExpression, SourceArrayAccessExpression, SourceAssignmentExpression, SourceDereferenceExpression, SourceDotExpression, SourceInfixExpression, SourceInvokeExpression, SourceListExpression, SourceLiteralExpression, SourceMethodCallExpression, SourceNewArrayExpression, SourceNewClassExpression, SourceOperatorExpression, SourceQuestionExpression, SourceSimpleNameExpression, SourceTypecastExpression, SourceTypeExpression, SourceUnaryExpression, SourceWrapperExpression
-
public interface SourceExpression
- extends SourceElement, CompiledExpression
The SourceExpression is essentially the union of all the various operators and primaries. If it is a primary, selector, or method invocation, it has a name. Otherwise, it is an operator of some sort and has operands. With each enumerated constant is a description of which fields are non-null and useful.
Methods inherited from interface oracle.javatools.parser.java.v2.model.SourceElement |
addSelf, addSelf, addSelfAfter, addSelfBefore, adjustTextIndentation, clearBinding, cloneSelf, compile, getBinding, getChildren, getChildren, getCompiledObject, getContainedElements, getEndOffset, getOwningFile, getOwningSourceFile, getParent, getSiblingAfter, getSiblingBefore, getSiblings, getSiblings, getStartOffset, getSymbolKind, getText, hasErrors, print, print, reformatSelf, removeSelf, replaceSelf, resolve, setBinding, setContext, visitSelf |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaElement |
getElementKind, getFile, getModifiers, getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfo |
EMPTY_ARRAY
static final SourceExpression[] EMPTY_ARRAY
getConstantValue
java.lang.Object getConstantValue()
- Determine if this expression is a constant expression, and if so, compute the constant value of this expression
-
- Returns:
- An Object representing the constant value of this expression or null if this expression is not a constant expression
getExpressionCode
int getExpressionCode()
-
- Returns:
- One of the OPT_* constants exactly identifying what kind of expression this is. Valid values are found in JavaOperators.
getOperatorCode
int getOperatorCode()
- Same thing as getExpressionCode(). Provided in case that's the first appropriate method a client would have expected.
getFirstOperand
SourceExpression getFirstOperand()
-
- Returns:
- the SourceExpression representing the first operand. Non-null if this expression is an operator (and hence has operands).
getSecondOperand
SourceExpression getSecondOperand()
-
- Returns:
- the SourceExpression representing the second operand. Non-null if this operator has a second operand.
getThirdOperand
SourceExpression getThirdOperand()
-
- Returns:
- the SourceExpression representing the third operand. Non-null if this has a third operand, e.g. "x? x: x".
getOperands
java.util.List<SourceExpression> getOperands()
-
- Returns:
- the array of SourceExpressions. Always non-null. May be zero-length. Returns a collection of SourceExpressions.
getOperandCount
int getOperandCount()
-
- Returns:
- The size of the operand array.
getOperandAt
SourceExpression getOperandAt(int index)
- Gets the operand at the specified index in the operand array.
-
- Parameters:
index
- 0-based.
- Returns:
- Null if the indicated operand doesn't exist.
Skip navigation links
Copyright © 1997, 2012, Oracle. All rights reserved.