01: /**
02: * MVEL (The MVFLEX Expression Language)
03: *
04: * Copyright (C) 2007 Christopher Brock, MVFLEX/Valhalla Project and the Codehaus
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: */package org.mvel.integration;
19:
20: import org.mvel.ast.ASTNode;
21:
22: /**
23: * An interceptor can be used to decorate functionality into an expression.
24: *
25: * @author Christopher Brock
26: */
27: public interface Interceptor {
28: public static final int NORMAL_FLOW = 0;
29: public static final int SKIP = 1;
30: public static final int END = 2;
31:
32: /**
33: * This method is executed before the wrapped statement.
34: *
35: * @param node The ASTNode wrapped by the interceptor
36: * @param factory The variable factory
37: * @return The response code. Should return 0.
38: */
39: public int doBefore(ASTNode node, VariableResolverFactory factory);
40:
41: /**
42: * @param exitStackValue The value on the top of the stack after executing the statement.
43: * @param node The ASTNode wrapped by the interceptor
44: * @param factory The variable factory
45: * @return The response code. Should return 0.
46: */
47: public int doAfter(Object exitStackValue, ASTNode node,
48: VariableResolverFactory factory);
49: }
|