Set the raw expression object for this object.


@param exp the raw Expression object, which should not normally be null.
963626
public void setExpression(Expression exp)
  {
  	if(null != m_mainExp)
    	exp.exprSetParent(m_mainExp.exprGetParent()); // a bit bogus
    m_mainExp = exp;
  }
895894
private void copy(Expression expression) {
		this.operator = expression.operator;
		this.elementsArray = expression.elementsArray;
		this.elements = expression.elements;
	}
1278699
@Nonnull
  public static Value evalExpression(@Nonnull final String expression, @Nonnull final PreprocessorContext context) {
    try {
      final ExpressionTree tree = ExpressionParser.getInstance().parse(expression, context);
      return evalTree(tree, context);
    } catch (IOException unexpected) {
      throw context.makeException("[Expression]Wrong expression format detected [" + expression + ']', unexpected);
    }
  }
1047057
public void updateExpression(String expr, Object value, PageContext pageContext)
            throws ExpressionUpdateException, JspException
    {
        if (isExpression(expr)) {

            VariableResolver vr = ImplicitObjectUtil.getUpdateVariableResolver(pageContext.getRequest(), pageContext.getResponse(), false);
            ExpressionEvaluatorFactory.getInstance().update(expr, value, vr, false);
        }
        else {
            String s = Bundle.getString("Tags_BindingUpdateExpressionError", new Object[]{expr});
            _tag.registerTagError(s, null);
        }
    }
666013
public ValueExpression setVariable(String name, ValueExpression expression) {
		if (variables == null) {
			variables = new Variables();
		}
		return variables.setVariable(name, expression);
	}
120580
protected void setTextAndClassToExpression(JRDesignExpression expression, DJGroupVariable var, AbstractColumn col, String variableName) {

		if (var.getValueFormatter() != null){
			expression.setText(var.getTextForValueFormatterExpression(variableName));
			expression.setValueClassName(var.getValueFormatter().getClassName());
		}
		else if (col.getTextFormatter() != null) {

			expression.setText("$V{" + variableName + "}");
			expression.setValueClassName(col.getVariableClassName(var.getOperation()));
		}
		else {
			expression.setText("$V{" + variableName + "}");
			expression.setValueClassName(col.getVariableClassName(var.getOperation()));
		}
	}
842554
private boolean setField(PropertyExpression expression, Expression objectExpression, ClassNode rType, String name) {
        if (expression.isSafe()) return false;
        FieldNode fn = AsmClassGenerator.getDeclaredFieldOfCurrentClassOrAccessibleFieldOfSuper(controller.getClassNode(), rType, name, false);
        if (fn==null) return false;
        OperandStack stack = controller.getOperandStack();
        stack.doGroovyCast(fn.getType());

        MethodVisitor mv = controller.getMethodVisitor();
        String ownerName = BytecodeHelper.getClassInternalName(fn.getOwner());
        if (!fn.isStatic()) {
            controller.getCompileStack().pushLHS(false);
            objectExpression.visit(controller.getAcg());
            controller.getCompileStack().popLHS();
            if (!rType.equals(stack.getTopOperand())) {
                BytecodeHelper.doCast(mv, rType);
                stack.replace(rType);
            }
            stack.swap();
            mv.visitFieldInsn(PUTFIELD, ownerName, name, BytecodeHelper.getTypeDescription(fn.getType()));
            stack.remove(1);
        } else {
            mv.visitFieldInsn(PUTSTATIC, ownerName, name, BytecodeHelper.getTypeDescription(fn.getType()));
        }

        //mv.visitInsn(ACONST_NULL);
        //stack.replace(OBJECT_TYPE);
        return true;
    }
1323143
public SelectParameters withExpressionType(ExpressionType expressionType) {
        setExpressionType(expressionType == null ? null : expressionType.toString());
        return this;
    }
1018670
public static Object parseExpressWithException(String exp, Object paramObj) {
        Object obj;
        try {
            obj = MVEL.eval(exp, paramObj);
        } catch (Exception e) {
            throw new ParseExpressionException("解析Mvel表达式异常，解析出错的表达式为:" + exp, e);
        }
        return obj;
    }
861919
public void setFrom(final String from) {
    if (null == from) {
      this.from = null;
    } else {
      if (Strings.contains(from.toLowerCase(), "from")) {
        this.from = from;
      } else {
        this.from = " from " + from;
      }
    }
  }
206834
final public ThrowExpressionBuilder<T> throwExp() {
    final int sourceLineNumber = builder.getSourceLineNumber();
    return new ThrowExpressionBuilder<T>(new ExpressionHandler<T>() {
      public T handleExpression(Expression e) {
        return statementHandler().handleStatement(new ThrowStatement(sourceLineNumber, e));
      }
    });
  }
731315
@Override
	public void writeExpression(Expression oldExp)
	{
		if (null == oldExp)
		{
			throw new NullPointerException();
		}
		boolean oldWritingObject = writingObject;
		writingObject = true;
		// get expression value
		Object oldValue = expressionValue(oldExp);
		// check existence
		if (oldValue == null || get(oldValue) != null && (oldWritingObject || oldValue.getClass() != String.class))
		{
			return;
		}

		// record how the object is obtained
		if (!isBasicType(oldValue) || (!oldWritingObject && oldValue.getClass() == String.class))
		{
			recordExpression(oldValue, oldExp);
		}

		// try to detect if we run into a dead loop
		if (checkDeadLoop(oldValue))
		{
			return;
		}
		super.writeExpression(oldExp);
		writingObject = oldWritingObject;
	}
1372054
@Override
  public void setFilter(@NonNull Expression expression) {
    layerFilter = expression;
    layer.setFilter(layerFilter);
  }
572433
public void set(Expr expr) {
        this.type = expr.type;
        this.value = expr.value;
        this.left = expr.left;
        this.right = expr.right;
        this.query = expr.query;
    }
550714
@Override
	public void caseASetCompSetExp(ASetCompSetExp node) throws AnalysisException
	{
		if (!proceed(node))
		{
			return;
		}

		handleMultipleBindConstruct(node, node.getBindings(), node.getFirst(), node.getPredicate());
	}
1354475
@Override
    public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) {
        if (equals(expr)) {
            return s_reusableImmutableEmptyBinding;
        }
        return null;
    }
813508
public static SoyExpression isNonNull(final Expression expr) {
    if (BytecodeUtils.isPrimitive(expr.resultType())) {
      return SoyExpression.TRUE;
    }
    return SoyExpression.forBool(
        new Expression(Type.BOOLEAN_TYPE, expr.features()) {
          @Override
          protected void doGen(CodeBuilder adapter) {
            expr.gen(adapter);
            Label isNull = new Label();
            adapter.ifNull(isNull);
            // non-null
            adapter.pushBoolean(true);
            Label end = new Label();
            adapter.goTo(end);
            adapter.mark(isNull);
            adapter.pushBoolean(false);
            adapter.mark(end);
          }
        });
  }