private void assertHasText(String expressionString) { if (expressionString.length() == 0) { throw new ParserException(expressionString, "The EL eval expression to parse must have text", null); } }
private void assertHasText(String expressionString) { if (expressionString.length() == 0) { throw new ParserException(expressionString, "The EL eval expression to parse must have text", null); } }
private void assertHasText(String expressionString) { if (expressionString.length() == 0) { throw new ParserException(expressionString, "The EL eval expression to parse must have text", null); } }
private void assertNotDelimited(String expressionString) { if ((expressionString.startsWith("#{") && expressionString.endsWith("}")) || (expressionString.startsWith("${") && expressionString.endsWith("}"))) { throw new ParserException(expressionString, "This expression '" + expressionString + "' being parsed is expected be an 'eval' EL expression string. " + "Do not attempt to enclose such expression strings in #{} or ${} delimiters. " + "If you need to parse a template that mixes literal text with evaluatable blocks, " + "set the 'template' parser context attribute to true.", null); } }
private void assertNotDelimited(String expressionString) { if ((expressionString.startsWith("#{") && expressionString.endsWith("}")) || (expressionString.startsWith("${") && expressionString.endsWith("}"))) { throw new ParserException(expressionString, "This expression '" + expressionString + "' being parsed is expected be an 'eval' EL expression string. " + "Do not attempt to enclose such expression strings in #{} or ${} delimiters. " + "If you need to parse a template that mixes literal text with evaluatable blocks, " + "set the 'template' parser context attribute to true.", null); } }
private void assertNotDelimited(String expressionString) { if ((expressionString.startsWith("#{") && expressionString.endsWith("}")) || (expressionString.startsWith("${") && expressionString.endsWith("}"))) { throw new ParserException(expressionString, "This expression '" + expressionString + "' being parsed is expected be an 'eval' EL expression string. " + "Do not attempt to enclose such expression strings in #{} or ${} delimiters. " + "If you need to parse a template that mixes literal text with evaluatable blocks, " + "set the 'template' parser context attribute to true.", null); } }
public SettableExpression doParseSettableExpression(String expressionString) throws ParserException { try { return new OgnlExpression(Ognl.parseExpression(expressionString)); } catch (OgnlException e) { throw new ParserException(expressionString, e); } }
private Expression parseExpressionInternal(String expressionString, ParserContext context, boolean template) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); try { ValueExpression expression = parseValueExpression(expressionString, context); ELContextFactory contextFactory = getContextFactory(context.getEvaluationContextType(), expressionString); return new ELExpression(contextFactory, expression); } catch (ELException e) { throw new ParserException(expressionString, e); } }
private Expression parseExpressionInternal(String expressionString, ParserContext context, boolean template) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); try { ValueExpression expression = parseValueExpression(expressionString, context); ELContextFactory contextFactory = getContextFactory(context.getEvaluationContextType(), expressionString); return new ELExpression(contextFactory, expression); } catch (ELException e) { throw new ParserException(expressionString, e); } }
private Expression parseExpressionInternal(String expressionString, ParserContext context, boolean template) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); try { ValueExpression expression = parseValueExpression(expressionString, context); ELContextFactory contextFactory = getContextFactory(context.getEvaluationContextType(), expressionString); return new ELExpression(contextFactory, expression); } catch (ELException e) { throw new ParserException(expressionString, e); } }
public Expression parseExpression(String expressionString, ParserContext context) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); if (context == null) { context = NullParserContext.INSTANCE; } if (context.isTemplate()) { return parseTemplate(expressionString, context); } else { if (expressionString.startsWith(getExpressionPrefix()) && expressionString.endsWith(getExpressionSuffix())) { if (!allowDelimitedEvalExpressions) { throw new ParserException( expressionString, "The expression '" + expressionString + "' being parsed is expected be an expression. " + "Do not enclose such expression strings in ${} delimiters as it's redundant. " + "If you need to parse a template that mixes literal text with evaluatable blocks, " + "set the 'template' parser context attribute to true.", null); } else { int lastIndex = expressionString.length() - getExpressionSuffix().length(); String expression = expressionString.substring(getExpressionPrefix().length(), lastIndex); return doParseExpression(expression, context); } } else { return doParseExpression(expressionString, context); } } }
public Expression parseExpression(String expressionString, ParserContext context) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); if (context == null) { context = NullParserContext.INSTANCE; } if (context.isTemplate()) { return parseTemplate(expressionString, context); } else { if (expressionString.startsWith(getExpressionPrefix()) && expressionString.endsWith(getExpressionSuffix())) { if (!allowDelimitedEvalExpressions) { throw new ParserException( expressionString, "The expression '" + expressionString + "' being parsed is expected be a standard OGNL expression. Do not attempt to enclose such expression strings in ${} delimiters--this is redundant. If you need to parse a template that mixes literal text with evaluatable blocks, set the 'template' parser context attribute to true.", null); } else { int lastIndex = expressionString.length() - getExpressionSuffix().length(); String ognlExpression = expressionString.substring(getExpressionPrefix().length(), lastIndex); return doParseExpression(ognlExpression, context); } } else { return doParseExpression(expressionString, context); } } }
public Expression parseExpression(String expressionString, ParserContext context) throws ParserException { Assert.notNull(expressionString, "The expression string to parse is required"); if (context == null) { context = NullParserContext.INSTANCE; } if (context.isTemplate()) { return parseTemplate(expressionString, context); } else { if (expressionString.startsWith(getExpressionPrefix()) && expressionString.endsWith(getExpressionSuffix())) { if (!allowDelimitedEvalExpressions) { throw new ParserException( expressionString, "The expression '" + expressionString + "' being parsed is expected be an expression. " + "Do not enclose such expression strings in ${} delimiters as it's redundant. " + "If you need to parse a template that mixes literal text with evaluatable blocks, " + "set the 'template' parser context attribute to true.", null); } else { int lastIndex = expressionString.length() - getExpressionSuffix().length(); String expression = expressionString.substring(getExpressionPrefix().length(), lastIndex); return doParseExpression(expression, context); } } else { return doParseExpression(expressionString, context); } } }
throw new ParserException(expressionString, "No ending suffix '" + getExpressionSuffix() + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex), null); } else if (suffixIndex == prefixIndex + getExpressionPrefix().length()) { throw new ParserException(expressionString, "No expression defined within delimiter '" + getExpressionPrefix() + getExpressionSuffix() + "' at character " + prefixIndex, null); } else {
throw new ParserException(expressionString, "No ending suffix '" + getExpressionSuffix() + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex), null); } else if (suffixIndex == prefixIndex + getExpressionPrefix().length()) { throw new ParserException(expressionString, "No expression defined within delimiter '" + getExpressionPrefix() + getExpressionSuffix() + "' at character " + prefixIndex, null); } else {
throw new ParserException(expressionString, "No ending suffix '" + getExpressionSuffix() + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex), null); } else if (suffixIndex == prefixIndex + getExpressionPrefix().length()) { throw new ParserException(expressionString, "No expression defined within delimiter '" + getExpressionPrefix() + getExpressionSuffix() + "' at character " + prefixIndex, null); } else {
throw new ParserException(expressionString, "No ending suffix '" + getExpressionSuffix() + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex), null); } else if (suffixIndex == prefixIndex + getExpressionPrefix().length()) { throw new ParserException(expressionString, "No expression defined within delimiter '" + getExpressionPrefix() + getExpressionSuffix() + "' at character " + prefixIndex, null); } else {
protected Expression doParseExpression(String expressionString, ParserContext context) throws ParserException { try { return new OgnlExpression(Ognl.parseExpression(expressionString), parseVariableExpressions(context .getExpressionVariables()), context.getExpectedEvaluationResultType(), expressionString, conversionService); } catch (OgnlException e) { throw new ParserException(expressionString, e); } } }