|
|||||||||||||||||||
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ParsedScript.java | - | 100% | 75% | 90.9% |
|
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.Location; | |
20 | import org.apache.hivemind.Resource; | |
21 | import org.apache.tapestry.IRequestCycle; | |
22 | import org.apache.tapestry.IScript; | |
23 | import org.apache.tapestry.IScriptProcessor; | |
24 | import org.apache.tapestry.coerce.ValueConverter; | |
25 | import org.apache.tapestry.services.ExpressionEvaluator; | |
26 | ||
27 | /** | |
28 | * A top level container for a number of {@link IScriptToken script tokens}. | |
29 | * | |
30 | * @author Howard Lewis Ship | |
31 | * @since 0.2.9 | |
32 | */ | |
33 | ||
34 | public class ParsedScript extends AbstractToken implements IScript | |
35 | { | |
36 | private Resource _scriptResource; | |
37 | ||
38 | private ExpressionEvaluator _evaluator; | |
39 | ||
40 | /** @since 4.0 */ | |
41 | ||
42 | private ValueConverter _valueConverter; | |
43 | ||
44 | 15 | public ParsedScript(ExpressionEvaluator evaluator, ValueConverter valueConverter, |
45 | Location location) | |
46 | { | |
47 | 15 | super(location); |
48 | ||
49 | 15 | _evaluator = evaluator; |
50 | 15 | _valueConverter = valueConverter; |
51 | 15 | _scriptResource = location.getResource(); |
52 | } | |
53 | ||
54 | 3 | public Resource getScriptResource() |
55 | { | |
56 | 3 | return _scriptResource; |
57 | } | |
58 | ||
59 | /** | |
60 | * Creates the {@link ScriptSessionImpl}and invokes | |
61 | * {@link org.apache.tapestry.script.AbstractToken#writeChildren(java.lang.StringBuffer, org.apache.tapestry.script.ScriptSession)}. | |
62 | */ | |
63 | 14 | public void execute(IRequestCycle cycle, IScriptProcessor processor, Map symbols) |
64 | { | |
65 | 14 | ScriptSession session = new ScriptSessionImpl(_scriptResource, cycle, processor, |
66 | _evaluator, _valueConverter, symbols); | |
67 | ||
68 | 14 | writeChildren(null, session); |
69 | } | |
70 | ||
71 | /** | |
72 | * Does nothing; never invoked. | |
73 | */ | |
74 | 0 | public void write(StringBuffer buffer, ScriptSession session) |
75 | { | |
76 | ||
77 | } | |
78 | ||
79 | } |
|