public Object internalEvaluate(final XExpression it, final Context ctx) { if (it instanceof XBinaryOperation) { return _internalEvaluate((XBinaryOperation)it, ctx); } else if (it instanceof XUnaryOperation) { return _internalEvaluate((XUnaryOperation)it, ctx); } else if (it instanceof XBooleanLiteral) { return _internalEvaluate((XBooleanLiteral)it, ctx); } else if (it instanceof XCastedExpression) { return _internalEvaluate((XCastedExpression)it, ctx); } else if (it instanceof XStringLiteral) { return _internalEvaluate((XStringLiteral)it, ctx); } else if (it instanceof XTypeLiteral) { return _internalEvaluate((XTypeLiteral)it, ctx); } else if (it instanceof XAnnotation) { return _internalEvaluate((XAnnotation)it, ctx); } else if (it != null) { return _internalEvaluate(it, ctx); } else if (it == null) { return _internalEvaluate((Void)null, ctx); } else { throw new IllegalArgumentException("Unhandled parameter types: " + Arrays.<Object>asList(it, ctx).toString()); } }
protected Object _internalEvaluate(final XExpression expression, final Context ctx) { throw this.notConstantExpression(expression); }
protected Object _internalEvaluate(final XBinaryOperation it, final Context ctx) { Object _xblockexpression = null; { final Context context = ctx.cloneWithExpectation(null); final Object left = this.evaluate(it.getLeftOperand(), context); final Object right = this.evaluate(it.getRightOperand(), context); _xblockexpression = this.evaluateBinaryOperation(it, left, right); } return _xblockexpression; }
protected Object evaluate(final XExpression expression, final Context ctx) { Object _xifexpression = null; boolean _add = ctx.getAlreadyEvaluating().add(expression); if (_add) { Object _xtrycatchfinallyexpression = null; try { _xtrycatchfinallyexpression = this.internalEvaluate(expression, ctx); } finally { ctx.getAlreadyEvaluating().remove(expression); } _xifexpression = _xtrycatchfinallyexpression; } else { throw this.notConstantExpression(expression); } return _xifexpression; }
protected Object _internalEvaluate(final XUnaryOperation it, final Context ctx) { Object _xblockexpression = null; final Object value = this.evaluate(it.getOperand(), ctx); final String op = this.getOperator(it); Object _switchResult = null; boolean _matched = false;
public ConstantExpressionEvaluationException notConstantExpression(final XExpression expression) { String _text = null; if (expression!=null) { _text=this.toText(expression); } String _plus = ("Not a constant expression : \'" + _text); String _plus_1 = (_plus + "\'"); return new ConstantExpressionEvaluationException(_plus_1, expression); }
protected Object _internalEvaluate(final XCastedExpression expression, final Context ctx) { return this.evaluate(expression.getTarget(), ctx); }
protected Object _internalEvaluate(final XTypeLiteral it, final Context ctx) { return this.toTypeReference(it.getType(), it.getArrayDimensions().size()); }
protected Object evaluateBinaryOperation(final XBinaryOperation binaryOperation, final Object left, final Object right) { Object _xblockexpression = null; final String op = this.getOperator(binaryOperation); Object _switchResult = null; if (op != null) {
protected Object _internalEvaluate(final Void nullValue, final Context ctx) { throw this.notConstantExpression(null); }