/** * Produce a string representation of the Abstract Syntax Tree for the expression. * This should ideally look like the input expression, but properly formatted since any * unnecessary whitespace will have been discarded during the parse of the expression. * @return the string representation of the AST */ public String toStringAST() { return this.ast.toStringAST(); }
/** * Produce a string representation of the Abstract Syntax Tree for the expression. * This should ideally look like the input expression, but properly formatted since any * unnecessary whitespace will have been discarded during the parse of the expression. * @return the string representation of the AST */ public String toStringAST() { return this.ast.toStringAST(); }
@Override public String toStringAST() { return getLeftOperand().toStringAST() + "++"; }
@Override public String toStringAST() { return getLeftOperand().toStringAST() + "--"; }
@Override public void setValue(@Nullable Object newValue) { throw new SpelEvaluationException( this.node.getStartPosition(), SpelMessage.NOT_ASSIGNABLE, this.node.toStringAST()); }
@Override public String toStringAST() { if (this.children.length < 2) { // unary plus return "+" + getLeftOperand().toStringAST(); } return super.toStringAST(); }
@Override public String toStringAST() { if (this.children.length < 2) { // unary minus return "-" + getLeftOperand().toStringAST(); } return super.toStringAST(); }
protected ValueRef getValueRef(ExpressionState state) throws EvaluationException { throw new SpelEvaluationException(getStartPosition(), SpelMessage.NOT_ASSIGNABLE, toStringAST()); }
/** * Attempt compilation of the supplied expression. A check is made to see * if it is compilable before compilation proceeds. The check involves * visiting all the nodes in the expression Ast and ensuring enough state * is known about them that bytecode can be generated for them. * @param expression the expression to compile * @return an instance of the class implementing the compiled expression, * or {@code null} if compilation is not possible */ @Nullable public CompiledExpression compile(SpelNodeImpl expression) { if (expression.isCompilable()) { if (logger.isDebugEnabled()) { logger.debug("SpEL: compiling " + expression.toStringAST()); } Class<? extends CompiledExpression> clazz = createExpressionClass(expression); if (clazz != null) { try { return ReflectionUtils.accessibleConstructor(clazz).newInstance(); } catch (Throwable ex) { throw new IllegalStateException("Failed to instantiate CompiledExpression", ex); } } } if (logger.isDebugEnabled()) { logger.debug("SpEL: unable to compile " + expression.toStringAST()); } return null; }
@Override public void setValue(@Nullable Object newValue) { throw new SpelEvaluationException(this.node.pos, SpelMessage.NOT_ASSIGNABLE, this.node.toStringAST()); }
@Override public String toStringAST() { return getLeftOperand().toStringAST() + "--"; }
@Override public String toStringAST() { return getLeftOperand().toStringAST() + "++"; }
@Override public String toStringAST() { if (this.children.length < 2) { // unary plus return "+" + getLeftOperand().toStringAST(); } return super.toStringAST(); }
@Override public String toStringAST() { if (this.children.length < 2) { // unary minus return "-" + getLeftOperand().toStringAST(); } return super.toStringAST(); }
/** * Attempt compilation of the supplied expression. A check is made to see * if it is compilable before compilation proceeds. The check involves * visiting all the nodes in the expression Ast and ensuring enough state * is known about them that bytecode can be generated for them. * @param expression the expression to compile * @return an instance of the class implementing the compiled expression, * or {@code null} if compilation is not possible */ @Nullable public CompiledExpression compile(SpelNodeImpl expression) { if (expression.isCompilable()) { if (logger.isDebugEnabled()) { logger.debug("SpEL: compiling " + expression.toStringAST()); } Class<? extends CompiledExpression> clazz = createExpressionClass(expression); if (clazz != null) { try { return ReflectionUtils.accessibleConstructor(clazz).newInstance(); } catch (Throwable ex) { throw new IllegalStateException("Failed to instantiate CompiledExpression", ex); } } } if (logger.isDebugEnabled()) { logger.debug("SpEL: unable to compile " + expression.toStringAST()); } return null; }
protected ValueRef getValueRef(ExpressionState state) throws EvaluationException { throw new SpelEvaluationException(getStartPosition(), SpelMessage.NOT_ASSIGNABLE, toStringAST()); }
SpelMessage.OPERAND_NOT_INCREMENTABLE, operand.toStringAST());
SpelMessage.OPERAND_NOT_DECREMENTABLE, operand.toStringAST());
SpelMessage.OPERAND_NOT_DECREMENTABLE, operand.toStringAST());
SpelMessage.OPERAND_NOT_INCREMENTABLE, operand.toStringAST());