Coverage Report - org.apache.tapestry.script.ParsedScript
 
Classes in this File Line Coverage Branch Coverage Complexity
ParsedScript
0%
0/13
N/A
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.Location;
 20  
 import org.apache.hivemind.Resource;
 21  
 import org.apache.tapestry.IComponent;
 22  
 import org.apache.tapestry.IRequestCycle;
 23  
 import org.apache.tapestry.IScript;
 24  
 import org.apache.tapestry.IScriptProcessor;
 25  
 import org.apache.tapestry.coerce.ValueConverter;
 26  
 import org.apache.tapestry.services.ExpressionEvaluator;
 27  
 
 28  
 /**
 29  
  * A top level container for a number of {@link IScriptToken script tokens}.
 30  
  * 
 31  
  * @author Howard Lewis Ship
 32  
  * @since 0.2.9
 33  
  */
 34  
 
 35  
 public class ParsedScript extends AbstractToken implements IScript
 36  
 {
 37  
 
 38  
     private Resource _scriptResource;
 39  
 
 40  
     private ExpressionEvaluator _evaluator;
 41  
 
 42  
     /** @since 4.0 */
 43  
 
 44  
     private ValueConverter _valueConverter;
 45  
 
 46  
     public ParsedScript(ExpressionEvaluator evaluator,
 47  
             ValueConverter valueConverter, Location location)
 48  
     {
 49  0
         super(location);
 50  
 
 51  0
         _evaluator = evaluator;
 52  0
         _valueConverter = valueConverter;
 53  0
         _scriptResource = location.getResource();
 54  0
     }
 55  
 
 56  
     public Resource getScriptResource()
 57  
     {
 58  0
         return _scriptResource;
 59  
     }
 60  
 
 61  
     /**
 62  
      * Creates the {@link ScriptSessionImpl}and invokes
 63  
      * {@link org.apache.tapestry.script.AbstractToken#writeChildren(java.lang.StringBuffer, org.apache.tapestry.script.ScriptSession)}.
 64  
      */
 65  
     public void execute(IRequestCycle cycle, IScriptProcessor processor, Map symbols)
 66  
     {
 67  0
         ScriptSession session = new ScriptSessionImpl(_scriptResource, cycle,
 68  
                 processor, _evaluator, _valueConverter, symbols);
 69  
 
 70  0
         writeChildren(null, session);
 71  0
     }
 72  
     
 73  
     /**
 74  
      * {@inheritDoc}
 75  
      */
 76  
     public void execute(IComponent target, IRequestCycle cycle, IScriptProcessor processor,
 77  
             Map symbols)
 78  
     {
 79  0
         ScriptSession session = new ScriptSessionImpl(_scriptResource, target, cycle,
 80  
                 processor, _evaluator, _valueConverter, symbols);
 81  
 
 82  0
         writeChildren(null, session);
 83  0
     }
 84  
     
 85  
     /**
 86  
      * Does nothing; never invoked.
 87  
      */
 88  
     public void write(StringBuffer buffer, ScriptSession session)
 89  
     {
 90  
 
 91  0
     }
 92  
 
 93  
 }