1 package org.apache.velocity.runtime.directive; 2 3 18 19 import java.io.*; 20 21 import org.apache.velocity.context.InternalContextAdapter; 22 import org.apache.velocity.runtime.parser.node.Node; 23 24 import org.apache.velocity.runtime.RuntimeServices; 25 26 35 public class Literal extends Directive 36 { 37 String literalText; 38 39 42 public String getName() 43 { 44 return "literal"; 45 } 46 47 50 public int getType() 51 { 52 return BLOCK; 53 } 54 55 59 public void init(RuntimeServices rs, InternalContextAdapter context, 60 Node node) 61 throws Exception 62 { 63 super.init( rs, context, node ); 64 65 literalText = node.jjtGetChild(0).literal(); 66 } 67 68 72 public boolean render( InternalContextAdapter context, 73 Writer writer, Node node) 74 throws IOException 75 { 76 writer.write(literalText); 77 return true; 78 } 79 } 80 | Popular Tags |