public final class ConstantExpression extends Expression
SimpleType except SimpleType.OBJECT are allowed.| Modifier and Type | Field and Description |
|---|---|
static ConstantExpression |
FALSE
Predefined constant with
false value. |
static ConstantExpression |
NULL
Predefined constant with
null value. |
static ConstantExpression |
TRUE
Predefined constant with
true values. |
| Constructor and Description |
|---|
ConstantExpression(ASTInfo info,
java.lang.Object constant)
Creates new instance of
ConstantExpression. |
ConstantExpression(ASTInfo info,
java.lang.Object constant,
Type type)
Creates new instance of
ConstantExpression. |
| Modifier and Type | Method and Description |
|---|---|
<T,E extends java.lang.Throwable> |
accept(ExpressionVisitor<T,E> visitor)
Accepts visitor.
|
protected java.lang.Object |
basicInterpret(Interpreter interpreter,
InterpreterStackTrace stackTrace)
Interpret expression.
|
java.lang.Object |
getConstant()
Returns the constant.
|
java.lang.Object |
getParseTimeConstant()
Returns the value of the expression determined in parse time.
|
boolean |
isParseTimeConstant()
Returns
true if the value of the expression is known
in parse time. |
createANTLRParser, doInterpret, evalCondition, evaluateToExpressions, executeCompiled, getCompiled, getDebugLine, getIdentifierAst, getPrimaryRange, getPropertySelectorRange, getRange, getResultExpression, getResultExpressions, getType, interpret, interpretInCurrentNamespace, isCreatingNonModuleContextObjects, requiresNewNamespace, setCompiled, showInFullText, showInSurroundingText, showInText, toExpressionsgetFullText, getLine, getNodeText, getText, toStringcontains, getBeginIndex, getEndIndex, getLengthclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFullText, getLine, getNodeText, getTextcontains, getBeginIndex, getEndIndex, getLengthpublic static final ConstantExpression NULL
null value.public static final ConstantExpression FALSE
false value.public static final ConstantExpression TRUE
true values.public ConstantExpression(ASTInfo info, java.lang.Object constant)
ConstantExpression.info - constant - java.lang.NullPointerException - if constant is nulljava.lang.IllegalArgumentException - if constant type is invalidpublic ConstantExpression(ASTInfo info, java.lang.Object constant, Type type)
ConstantExpression.info - constant - type - java.lang.NullPointerException - if constant or type is nulljava.lang.IllegalArgumentException - if constant is not assignable to typepublic java.lang.Object getConstant()
public boolean isParseTimeConstant()
Expressiontrue if the value of the expression is known
in parse time. E.g. constant literals, enumerations, types (without free types).isParseTimeConstant in class Expressiontrue if the expression value is known during parsingExpression.getParseTimeConstant()public java.lang.Object getParseTimeConstant()
ExpressionUnsupportedOperationException.
Subclasses, which return true when Expression.isParseTimeConstant()
is called, should override this method.getParseTimeConstant in class ExpressionExpression.isParseTimeConstant()public <T,E extends java.lang.Throwable> T accept(ExpressionVisitor<T,E> visitor) throws E extends java.lang.Throwable
Expressionaccept in class ExpressionEE extends java.lang.Throwableprotected java.lang.Object basicInterpret(Interpreter interpreter, InterpreterStackTrace stackTrace)
ExpressionbasicInterpret in class ExpressionCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.