@Override public TypedValue getValueInternal(ExpressionState state) throws EvaluationException { TypedValue tv = getValueInternal(state.getActiveContextObject(), state.getEvaluationContext(), state.getConfiguration().isAutoGrowNullReferences()); PropertyAccessor accessorToUse = this.cachedReadAccessor; if (accessorToUse instanceof CompilablePropertyAccessor) { CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) accessorToUse; setExitTypeDescriptor(CodeFlow.toDescriptor(accessor.getPropertyType())); } return tv; }
private InternalParseException internalException(int startPos, SpelMessage message, Object... inserts) { return new InternalParseException(new SpelParseException(this.expressionString, startPos, message, inserts)); }
/** * Create a parser with default settings. */ public SpelExpressionParser() { this.configuration = new SpelParserConfiguration(); }
private Operator findOperator(SpelNode node) { if (node instanceof Operator) { return (Operator) node; } int childCount = node.getChildCount(); for (int i = 0; i < childCount; i++) { Operator possible = findOperator(node.getChild(i)); if (possible != null) { return possible; } } return null; }
void setExitTypeDescriptor(String descriptor) { // If this property or field access would return a primitive - and yet // it is also marked null safe - then the exit type descriptor must be // promoted to the box type to allow a null value to be passed on if (this.nullSafe && CodeFlow.isPrimitive(descriptor)) { this.originalPrimitiveExitTypeDescriptor = descriptor; this.exitTypeDescriptor = CodeFlow.toBoxedDescriptor(descriptor); } else { this.exitTypeDescriptor = descriptor; } }
public SpelEvaluationException(int position, SpelMessage message, Object... inserts) { super(position, message.formatMessage(inserts)); this.message = message; this.inserts = inserts; }
/** * @return a new ExpressionState */ private ExpressionState getState() { EvaluationContext context = TestScenarioCreator.getTestEvaluationContext(); ExpressionState state = new ExpressionState(context); return state; }
@Override public boolean isCompilable() { PropertyAccessor accessorToUse = this.cachedReadAccessor; return (accessorToUse instanceof CompilablePropertyAccessor && ((CompilablePropertyAccessor) accessorToUse).isCompilable()); }
static Servlet3SecurityContextHolderAwareRequestWrapper getOne() { HttpServlet3RequestFactory outer = new HttpServlet3RequestFactory(); return outer.new Servlet3SecurityContextHolderAwareRequestWrapper(); }
public MessageHeaders getHeaders() { MessageHeaders mh = new MessageHeaders(); mh.put("command", "wibble"); mh.put("command2", "wobble"); return mh; }
@Anno public String doit(double d) { return "double "+d; } }
/** * Parse the supplied expression and then create a string representation of the resultant AST, it should be the same * as the original expression. * * @param expression the expression to parse *and* the expected value of the string form of the resultant AST */ public void parseCheck(String expression) { parseCheck(expression, expression); }
static Iterable<IntegerTestBean> createIterable() { final Set<IntegerTestBean> set = createSet(); return new Iterable<IntegerTestBean>() { @Override public Iterator<IntegerTestBean> iterator() { return set.iterator(); } }; }
/** * Evaluate the specified expression and ensure the expected message comes out. * The message may have inserts and they will be checked if otherProperties is specified. * The first entry in otherProperties should always be the position. * @param expression the expression to evaluate * @param expectedMessage the expected message * @param otherProperties the expected inserts within the message */ protected void evaluateAndCheckError(String expression, SpelMessage expectedMessage, Object... otherProperties) { evaluateAndCheckError(expression, null, expectedMessage, otherProperties); }
private void raiseParseException(int start, SpelMessage msg, Object... inserts) { throw new InternalParseException(new SpelParseException(this.expressionString, start, msg, inserts)); }
public SpelEvaluationException(Throwable cause, SpelMessage message, Object... inserts) { super(message.formatMessage(inserts), cause); this.message = message; this.inserts = inserts; }
public SpelParseException(int position, Throwable cause, SpelMessage message, Object... inserts) { super(position, message.formatMessage(inserts), cause); this.message = message; this.inserts = inserts; }
public SpelEvaluationException(SpelMessage message, Object... inserts) { super(message.formatMessage(inserts)); this.message = message; this.inserts = inserts; }
public SpelEvaluationException(int position, Throwable cause, SpelMessage message, Object... inserts) { super(position, message.formatMessage(inserts), cause); this.message = message; this.inserts = inserts; }
public SpelParseException(int position, SpelMessage message, Object... inserts) { super(position, message.formatMessage(inserts)); this.message = message; this.inserts = inserts; }