01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.forms.expression;
18:
19: import java.util.List;
20:
21: import org.outerj.expression.Expression;
22: import org.outerj.expression.ParseException;
23: import org.outerj.expression.ExpressionException;
24:
25: /**
26: * Work interface for the component that creates Expression objects.
27: * The reason for centralising the creation of expressions is so that
28: * new functions can be registered in one place.
29: *
30: * @version $Id: ExpressionManager.java 449149 2006-09-23 03:58:05Z crossley $
31: */
32: public interface ExpressionManager {
33:
34: String ROLE = ExpressionManager.class.getName();
35:
36: /**
37: * Parse the given expression.
38: * @param expression The string containing the expression to parse.
39: * @return The Expression object resulting from parse.
40: * @throws ParseException If something goes wrong while parsing.
41: * @throws ExpressionException If the expression has been parsed successfully but is invalid.
42: */
43: Expression parse(String expression) throws ParseException,
44: ExpressionException;
45:
46: /**
47: * Parse the given expression to extract variables.
48: * @param expressionString The string containing the expression to parse.
49: * @return A {@link List} of {@link org.outerj.expression.VariableFunction}, one for each variable used in the expression.
50: * @see org.outerj.expression.VariableFunction#getVariableName()
51: * @throws ParseException If something goes wrong while parsing.
52: * @throws ExpressionException If the expression has been parsed successfully but is invalid.
53: */
54: List parseVariables(String expressionString) throws ParseException,
55: ExpressionException;
56: }
|