Coverage Report - org.apache.tiles.velocity.template.PutListAttributeDirective
 
Classes in this File Line Coverage Branch Coverage Complexity
PutListAttributeDirective
0%
0/11
0%
0/2
1.333
 
 1  
 /*
 2  
  * This file was automatically generated by Apache Tiles Autotag.
 3  
  */
 4  
 package org.apache.tiles.velocity.template;
 5  
 
 6  
 import java.io.IOException;
 7  
 import java.io.Writer;
 8  
 
 9  
 import org.apache.tiles.autotag.core.runtime.ModelBody;
 10  
 import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
 11  
 import org.apache.velocity.context.InternalContextAdapter;
 12  
 import org.apache.velocity.runtime.directive.Directive;
 13  
 import org.apache.velocity.runtime.parser.node.Node;
 14  
 
 15  
 /**
 16  
  * <p>
 17  
  * <strong>Declare a list that will be pass as attribute to tile. </strong>
 18  
  * </p>
 19  
  * <p>
 20  
  * Declare a list that will be pass as attribute to tile. List elements are
 21  
  * added using the tags 'addAttribute' or 'addListAttribute'. This tag can only
 22  
  * be used inside 'insertTemplate', 'insertDefinition', 'definition' tags.
 23  
  * </p>
 24  
  */
 25  0
 public class PutListAttributeDirective extends Directive {
 26  
 
 27  
     /**
 28  
      * The template model.
 29  
      */
 30  0
     private org.apache.tiles.template.PutListAttributeModel model = new org.apache.tiles.template.PutListAttributeModel();
 31  
 
 32  
     /** {@inheritDoc} */
 33  
     @Override
 34  
     public String getName() {
 35  0
         return "tiles_putListAttribute";
 36  
     }
 37  
 
 38  
     /** {@inheritDoc} */
 39  
     @Override
 40  
     public int getType() {
 41  0
         return BLOCK;
 42  
     }
 43  
 
 44  
     /** {@inheritDoc} */
 45  
     @Override
 46  
     public boolean render(InternalContextAdapter context, Writer writer, Node node)
 47  
             throws IOException {
 48  0
         AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.velocity.autotag.VelocityAutotagRuntime();
 49  0
         if (runtime instanceof Directive) {
 50  0
             ((Directive) runtime).render(context, writer, node);
 51  
         }
 52  0
         org.apache.tiles.request.Request request = runtime.createRequest();
 53  0
         ModelBody modelBody = runtime.createModelBody();
 54  0
         model.execute(
 55  
             runtime.getParameter("name", java.lang.String.class, null),
 56  
             runtime.getParameter("role", java.lang.String.class, null),
 57  
             runtime.getParameter("inherit", java.lang.Boolean.class, false),
 58  
             runtime.getParameter("cascade", java.lang.Boolean.class, false),
 59  
             request, modelBody
 60  
         );
 61  0
         return true;
 62  
     }
 63  
 }