Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
ScriptSession |
|
| 1.0;1 |
1 | // Copyright 2004, 2005 The Apache Software Foundation |
|
2 | // |
|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 | // you may not use this file except in compliance with the License. |
|
5 | // You may obtain a copy of the License at |
|
6 | // |
|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
|
8 | // |
|
9 | // Unless required by applicable law or agreed to in writing, software |
|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 | // See the License for the specific language governing permissions and |
|
13 | // limitations under the License. |
|
14 | ||
15 | package org.apache.tapestry.script; |
|
16 | ||
17 | import java.util.Map; |
|
18 | ||
19 | import org.apache.hivemind.Resource; |
|
20 | import org.apache.tapestry.IRequestCycle; |
|
21 | import org.apache.tapestry.IScriptProcessor; |
|
22 | ||
23 | /** |
|
24 | * Process object used when executing a |
|
25 | * {@link org.apache.tapestry.IScript script template}. This ScriptSession |
|
26 | * provides support |
|
27 | * |
|
28 | * @author Howard M. Lewis Ship |
|
29 | * @since 4.0 |
|
30 | */ |
|
31 | public interface ScriptSession extends IScriptProcessor |
|
32 | { |
|
33 | ||
34 | /** |
|
35 | * Evaluates an OGNL expression, where the root object for the expression is |
|
36 | * the {@link #getSymbols() symbols map}. |
|
37 | */ |
|
38 | Object evaluate(String expression); |
|
39 | ||
40 | /** |
|
41 | * Returns the resource for the script template. |
|
42 | */ |
|
43 | ||
44 | Resource getScriptTemplateResource(); |
|
45 | ||
46 | /** |
|
47 | * Returns the symbols (which may be created or updated during the execution |
|
48 | * of the script template). |
|
49 | */ |
|
50 | ||
51 | Map getSymbols(); |
|
52 | ||
53 | /** |
|
54 | * Returns the current request cycle. |
|
55 | */ |
|
56 | IRequestCycle getRequestCycle(); |
|
57 | ||
58 | /** |
|
59 | * Evaluates an expression and coerces the result to a particlar type. |
|
60 | * |
|
61 | * @since 4.0 |
|
62 | * @see org.apache.tapestry.coerce.ValueConverter |
|
63 | */ |
|
64 | ||
65 | Object evaluate(String expression, Class desiredType); |
|
66 | } |