|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ScriptSession.java | - | - | - | - |
|
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 {@link org.apache.tapestry.IScript script template}. This | |
25 | * ScriptSession provides support | |
26 | * | |
27 | * @author Howard M. Lewis Ship | |
28 | * @since 4.0 | |
29 | */ | |
30 | public interface ScriptSession extends IScriptProcessor | |
31 | { | |
32 | /** | |
33 | * Evaluates an OGNL expression, where the root object for the expression is the | |
34 | * {@link #getSymbols() symbols map}. | |
35 | */ | |
36 | public Object evaluate(String expression); | |
37 | ||
38 | /** | |
39 | * Returns the resource for the script template. | |
40 | */ | |
41 | ||
42 | public Resource getScriptTemplateResource(); | |
43 | ||
44 | /** | |
45 | * Returns the symbols (which may be created or updated during the execution of the script | |
46 | * template). | |
47 | */ | |
48 | ||
49 | public Map getSymbols(); | |
50 | ||
51 | /** | |
52 | * Returns the current request cycle. | |
53 | */ | |
54 | public IRequestCycle getRequestCycle(); | |
55 | ||
56 | /** | |
57 | * Evaluates an expression and coerces the result to a particlar type. | |
58 | * | |
59 | * @since 4.0 | |
60 | * @see org.apache.tapestry.coerce.ValueConverter | |
61 | */ | |
62 | ||
63 | public Object evaluate(String expression, Class desiredType); | |
64 | } |
|