Clover coverage report - Code Coverage for tapestry release 4.0.1
Coverage timestamp: Fri Mar 31 2006 09:12:14 EST
file stats: LOC: 79   Methods: 4
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ParsedScript.java - 100% 75% 90.9%
coverage coverage
 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  30 public ParsedScript(ExpressionEvaluator evaluator, ValueConverter valueConverter,
 45    Location location)
 46    {
 47  30 super(location);
 48   
 49  30 _evaluator = evaluator;
 50  30 _valueConverter = valueConverter;
 51  30 _scriptResource = location.getResource();
 52    }
 53   
 54  6 public Resource getScriptResource()
 55    {
 56  6 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  28 public void execute(IRequestCycle cycle, IScriptProcessor processor, Map symbols)
 64    {
 65  28 ScriptSession session = new ScriptSessionImpl(_scriptResource, cycle, processor,
 66    _evaluator, _valueConverter, symbols);
 67   
 68  28 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    }