|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2009 the original author or authors. |
|
|
|
* Copyright 2002-2024 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -18,7 +18,8 @@ package org.springframework.expression; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Parses expression strings into compiled expressions that can be evaluated. |
|
|
|
* Parses expression strings into compiled expressions that can be evaluated. |
|
|
|
* Supports parsing templates as well as standard expression strings. |
|
|
|
* |
|
|
|
|
|
|
|
* <p>Supports parsing template expressions as well as standard expression strings. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Keith Donald |
|
|
|
* @author Keith Donald |
|
|
|
* @author Andy Clement |
|
|
|
* @author Andy Clement |
|
|
|
@ -27,29 +28,31 @@ package org.springframework.expression; |
|
|
|
public interface ExpressionParser { |
|
|
|
public interface ExpressionParser { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Parse the expression string and return an Expression object you can use for repeated evaluation. |
|
|
|
* Parse the expression string and return an {@link Expression} object that |
|
|
|
* <p>Some examples: |
|
|
|
* can be used for repeated evaluation. |
|
|
|
|
|
|
|
* <p>Examples: |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* 3 + 4 |
|
|
|
* 3 + 4 |
|
|
|
* name.firstName |
|
|
|
* name.firstName |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
|
* @param expressionString the raw expression string to parse |
|
|
|
* @param expressionString the raw expression string to parse |
|
|
|
* @return an evaluator for the parsed expression |
|
|
|
* @return an {@code Expression} for the parsed expression |
|
|
|
* @throws ParseException an exception occurred during parsing |
|
|
|
* @throws ParseException if an exception occurred during parsing |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Expression parseExpression(String expressionString) throws ParseException; |
|
|
|
Expression parseExpression(String expressionString) throws ParseException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Parse the expression string and return an Expression object you can use for repeated evaluation. |
|
|
|
* Parse the expression string and return an {@link Expression} object that |
|
|
|
* <p>Some examples: |
|
|
|
* can be used for repeated evaluation. |
|
|
|
|
|
|
|
* <p>Examples: |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* 3 + 4 |
|
|
|
* 3 + 4 |
|
|
|
* name.firstName |
|
|
|
* name.firstName |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
|
* @param expressionString the raw expression string to parse |
|
|
|
* @param expressionString the raw expression string to parse |
|
|
|
* @param context a context for influencing this expression parsing routine (optional) |
|
|
|
* @param context a context for influencing the expression parsing routine |
|
|
|
* @return an evaluator for the parsed expression |
|
|
|
* @return an {@code Expression} for the parsed expression |
|
|
|
* @throws ParseException an exception occurred during parsing |
|
|
|
* @throws ParseException if an exception occurred during parsing |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Expression parseExpression(String expressionString, ParserContext context) throws ParseException; |
|
|
|
Expression parseExpression(String expressionString, ParserContext context) throws ParseException; |
|
|
|
|
|
|
|
|
|
|
|
|