Coverage Report - org.apache.tiles.velocity.template.GetAsStringDirective
 
Classes in this File Line Coverage Branch Coverage Complexity
GetAsStringDirective
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> Render the value of the specified template attribute to the current
 18  
  * Writer</strong>
 19  
  * </p>
 20  
  * 
 21  
  * <p>
 22  
  * Retrieve the value of the specified template attribute property, and render
 23  
  * it to the current Writer as a String. The usual toString() conversions is
 24  
  * applied on found value.
 25  
  * </p>
 26  
  */
 27  0
 public class GetAsStringDirective extends Directive {
 28  
 
 29  
     /**
 30  
      * The template model.
 31  
      */
 32  0
     private org.apache.tiles.template.GetAsStringModel model = new org.apache.tiles.template.GetAsStringModel();
 33  
 
 34  
     /** {@inheritDoc} */
 35  
     @Override
 36  
     public String getName() {
 37  0
         return "tiles_getAsString";
 38  
     }
 39  
 
 40  
     /** {@inheritDoc} */
 41  
     @Override
 42  
     public int getType() {
 43  0
         return BLOCK;
 44  
     }
 45  
 
 46  
     /** {@inheritDoc} */
 47  
     @Override
 48  
     public boolean render(InternalContextAdapter context, Writer writer, Node node)
 49  
             throws IOException {
 50  0
         AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.velocity.autotag.VelocityAutotagRuntime();
 51  0
         if (runtime instanceof Directive) {
 52  0
             ((Directive) runtime).render(context, writer, node);
 53  
         }
 54  0
         org.apache.tiles.request.Request request = runtime.createRequest();
 55  0
         ModelBody modelBody = runtime.createModelBody();
 56  0
         model.execute(
 57  
             runtime.getParameter("ignore", java.lang.Boolean.class, false),
 58  
             runtime.getParameter("preparer", java.lang.String.class, null),
 59  
             runtime.getParameter("role", java.lang.String.class, null),
 60  
             runtime.getParameter("defaultValue", java.lang.Object.class, null),
 61  
             runtime.getParameter("defaultValueRole", java.lang.String.class, null),
 62  
             runtime.getParameter("defaultValueType", java.lang.String.class, null),
 63  
             runtime.getParameter("name", java.lang.String.class, null),
 64  
             runtime.getParameter("value", org.apache.tiles.Attribute.class, null),
 65  
             request, modelBody
 66  
         );
 67  0
         return true;
 68  
     }
 69  
 }