Coverage Report - org.apache.tiles.freemarker.template.SetCurrentContainerFMModel
 
Classes in this File Line Coverage Branch Coverage Complexity
SetCurrentContainerFMModel
33%
3/9
0%
0/2
1.5
 
 1  
 /*
 2  
  * This file was automatically generated by Apache Tiles Autotag.
 3  
  */
 4  
 package org.apache.tiles.freemarker.template;
 5  
 
 6  
 import java.io.IOException;
 7  
 import java.util.Map;
 8  
 
 9  
 import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
 10  
 
 11  
 import freemarker.core.Environment;
 12  
 import freemarker.template.TemplateDirectiveBody;
 13  
 import freemarker.template.TemplateDirectiveModel;
 14  
 import freemarker.template.TemplateException;
 15  
 import freemarker.template.TemplateModel;
 16  
 
 17  
 /**
 18  
  * Selects a container to be used as the "current" container.
 19  
  */
 20  
 public class SetCurrentContainerFMModel implements TemplateDirectiveModel {
 21  
 
 22  
     /**
 23  
      * The template model.
 24  
      */
 25  
     private org.apache.tiles.template.SetCurrentContainerModel model;
 26  
 
 27  
     /**
 28  
      * Constructor.
 29  
      *
 30  
      * @param model
 31  
      *            The template model.
 32  
      */
 33  1
     public SetCurrentContainerFMModel(org.apache.tiles.template.SetCurrentContainerModel model) {
 34  1
         this.model = model;
 35  1
     }
 36  
 
 37  
     /** {@inheritDoc} */
 38  
     @SuppressWarnings("unchecked")
 39  
     @Override
 40  
     public void execute(Environment env, @SuppressWarnings("rawtypes") Map params, TemplateModel[] loopVars,
 41  
             TemplateDirectiveBody body) throws TemplateException, IOException {
 42  0
         AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime();
 43  0
         if (runtime instanceof TemplateDirectiveModel) {
 44  0
             ((TemplateDirectiveModel) runtime).execute(env, params, loopVars, body);
 45  
         }
 46  0
         org.apache.tiles.request.Request request = runtime.createRequest();
 47  0
         model.execute(
 48  
             runtime.getParameter("containerKey", java.lang.String.class, null),
 49  
                 request
 50  
         );
 51  0
     }
 52  
 }