01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.springframework.binding.expression;
17:
18: /**
19: * Parses expression strings, returing a configured evaluator instance capable
20: * of performing parsed expression evaluation in a thread safe way.
21: *
22: * @author Keith Donald
23: */
24: public interface ExpressionParser {
25:
26: /**
27: * Is this expression string delimited in a manner that indicates it is a
28: * parseable expression? For example "${expression}".
29: * @param expressionString the proposed expression string
30: * @return true if yes, false if not
31: */
32: public boolean isDelimitedExpression(String expressionString);
33:
34: /**
35: * Parse the provided expression string, returning an evaluator capable of
36: * evaluating it against input.
37: * @param expressionString the parseable expression string
38: * @return the evaluator for the parsed expression
39: * @throws ParserException an exception occured during parsing
40: */
41: public Expression parseExpression(String expressionString)
42: throws ParserException;
43:
44: /**
45: * Parse the provided settable expression string, returning an evaluator
46: * capable of evaluating its value as well as setting its value.
47: * @param expressionString the parseable expression string
48: * @return the evaluator for the parsed expression
49: * @throws ParserException an exception occured during parsing
50: * @throws UnsupportedOperationException this parser does not support
51: * settable expressions
52: */
53: public SettableExpression parseSettableExpression(
54: String expressionString) throws ParserException,
55: UnsupportedOperationException;
56:
57: }
|