@Override public Expression parseExpression(String expressionString) throws ParseException { return parseExpression(expressionString, null); }
@Override public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException { if (context != null && context.isTemplate()) { return parseTemplate(expressionString, context); } else { return doParseExpression(expressionString, context); } }
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException { if (expressionString.isEmpty()) { return new LiteralExpression(""); } Expression[] expressions = parseExpressions(expressionString, context); if (expressions.length == 1) { return expressions[0]; } else { return new CompositeStringExpression(expressionString, expressions); } }
int suffixIndex = skipToCorrectEndSuffix(suffix, expressionString, afterPrefixIndex); if (suffixIndex == -1) { throw new ParseException(expressionString, prefixIndex, "' at character " + prefixIndex); expressions.add(doParseExpression(expr, context)); startIdx = suffixIndex + suffix.length();
if (isSuffixHere(expressionString, pos, suffix) && stack.isEmpty()) { break; Bracket.theCloseBracketFor(p.bracket) + "' for '" + p.bracket + "' at position " + p.pos); if (!isSuffixHere(expressionString, pos, suffix)) { return -1;
int suffixIndex = skipToCorrectEndSuffix(suffix, expressionString, afterPrefixIndex); if (suffixIndex == -1) { throw new ParseException(expressionString, prefixIndex, "' at character " + prefixIndex); expressions.add(doParseExpression(expr, context)); startIdx = suffixIndex + suffix.length();
if (isSuffixHere(expressionString, pos, suffix) && stack.isEmpty()) { break; Bracket.theCloseBracketFor(p.bracket) + "' for '" + p.bracket + "' at position " + p.pos); if (!isSuffixHere(expressionString, pos, suffix)) { return -1;
@Override public Expression parseExpression(String expressionString) throws ParseException { return parseExpression(expressionString, null); }
@Override public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException { if (context != null && context.isTemplate()) { return parseTemplate(expressionString, context); } else { return doParseExpression(expressionString, context); } }
int suffixIndex = skipToCorrectEndSuffix(suffix, expressionString, afterPrefixIndex); if (suffixIndex == -1) { throw new ParseException(expressionString, prefixIndex, "' at character " + prefixIndex); expressions.add(doParseExpression(expr, context)); startIdx = suffixIndex + suffix.length();
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException { if (expressionString.isEmpty()) { return new LiteralExpression(""); } Expression[] expressions = parseExpressions(expressionString, context); if (expressions.length == 1) { return expressions[0]; } else { return new CompositeStringExpression(expressionString, expressions); } }
if (isSuffixHere(expressionString, pos, suffix) && stack.isEmpty()) { break; Bracket.theCloseBracketFor(p.bracket) + "' for '" + p.bracket + "' at position " + p.pos); if (!isSuffixHere(expressionString, pos, suffix)) { return -1;
@Override public Expression parseExpression(String expressionString) throws ParseException { return parseExpression(expressionString, null); }
@Override public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException { if (context != null && context.isTemplate()) { return parseTemplate(expressionString, context); } else { return doParseExpression(expressionString, context); } }
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException { if (expressionString.isEmpty()) { return new LiteralExpression(""); } Expression[] expressions = parseExpressions(expressionString, context); if (expressions.length == 1) { return expressions[0]; } else { return new CompositeStringExpression(expressionString, expressions); } }
@SuppressWarnings("unchecked") private <T> T expression(String selector, Object bean) { if(selector == null) { return null; } StandardEvaluationContext evalCtx = new StandardEvaluationContext(); evalCtx.setRootObject(bean); evalCtx.setBeanResolver(beanResolver); return (T)expressionParser.parseExpression(selector).getValue(evalCtx); }
@SuppressWarnings("unchecked") private <T> T expression(String selector, Object bean) { if (selector == null) { return null; } StandardEvaluationContext evalCtx = new StandardEvaluationContext(bean); evalCtx.setBeanResolver(beanResolver); evalCtx.setPropertyAccessors(expressionPropertyAccessors); return (T) expressionParser.parseExpression(selector).getValue(evalCtx); }
@SuppressWarnings("unchecked") //cortiz, OK private <T> T expression(String selector, Object bean) { if (selector == null) { return null; } StandardEvaluationContext evalCtx = new StandardEvaluationContext(); evalCtx.setRootObject(bean); evalCtx.setBeanResolver(beanResolver); return (T)expressionParser.parseExpression(selector).getValue(evalCtx); }