Clover coverage report - Code Coverage for tapestry release 4.0-beta-2
Coverage timestamp: Sat Jul 9 2005 22:02:17 EDT
file stats: LOC: 95   Methods: 5
NCLOC: 39   Classes: 1
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
ComponentTemplateLoaderImpl.java - 100% 100% 100%
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.services.impl;
 16   
 17    import org.apache.commons.logging.Log;
 18    import org.apache.tapestry.IRender;
 19    import org.apache.tapestry.IRequestCycle;
 20    import org.apache.tapestry.ITemplateComponent;
 21    import org.apache.tapestry.binding.BindingSource;
 22    import org.apache.tapestry.engine.IPageLoader;
 23    import org.apache.tapestry.parse.ComponentTemplate;
 24    import org.apache.tapestry.services.ComponentTemplateLoader;
 25    import org.apache.tapestry.services.TemplateSource;
 26   
 27    /**
 28    * Utility service, <code>tapestry.page.ComponentTemplateLoader</code>, which will process the
 29    * component's {@link org.apache.tapestry.parse.ComponentTemplate template}, which involves working
 30    * through the nested structure of the template and hooking the various static template blocks and
 31    * components together using {@link org.apache.tapestry.IComponent#addBody(IRender)}and
 32    * {@link org.apache.tapestry.ITemplateComponent#addOuter(IRender)}.
 33    * <p>
 34    * Because this service must be reentrant, it acts as a factory for a
 35    * {@link org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic}that is created (and
 36    * discarded) for each component whose template is loaded.
 37    *
 38    * @author Howard Lewis Ship
 39    * @since 3.0
 40    */
 41   
 42    public class ComponentTemplateLoaderImpl implements ComponentTemplateLoader
 43    {
 44    private Log _log;
 45   
 46    private IPageLoader _pageLoader;
 47   
 48    private TemplateSource _templateSource;
 49   
 50    /** @since 4.0 */
 51   
 52    private BindingSource _bindingSource;
 53   
 54  213 public void loadTemplate(IRequestCycle requestCycle, ITemplateComponent loadComponent)
 55    {
 56  213 ComponentTemplate template = _templateSource.getTemplate(requestCycle, loadComponent);
 57   
 58  213 ComponentTemplateLoaderLogic logic = new ComponentTemplateLoaderLogic(_log, _pageLoader,
 59    _bindingSource);
 60   
 61  213 logic.loadTemplate(requestCycle, loadComponent, template);
 62    }
 63   
 64    /** @since 4.0 */
 65   
 66  41 public void setPageLoader(IPageLoader pageLoader)
 67    {
 68  41 _pageLoader = pageLoader;
 69    }
 70   
 71    /** @since 4.0 */
 72   
 73  41 public void setLog(Log log)
 74    {
 75  41 _log = log;
 76    }
 77   
 78    /**
 79    * @since 4.0
 80    */
 81   
 82  41 public void setTemplateSource(TemplateSource templateSource)
 83    {
 84  41 _templateSource = templateSource;
 85    }
 86   
 87    /**
 88    * @since 4.0
 89    */
 90   
 91  41 public void setBindingSource(BindingSource bindingSource)
 92    {
 93  41 _bindingSource = bindingSource;
 94    }
 95    }