1 package org.apache.velocity.runtime.directive; 2 3 18 19 import java.io.Writer ; 20 import java.io.IOException ; 21 22 import org.apache.velocity.runtime.RuntimeServices; 23 24 import org.apache.velocity.context.InternalContextAdapter; 25 import org.apache.velocity.runtime.parser.node.Node; 26 27 import org.apache.velocity.exception.MethodInvocationException; 28 import org.apache.velocity.exception.ParseErrorException; 29 import org.apache.velocity.exception.ResourceNotFoundException; 30 31 32 38 public abstract class Directive implements DirectiveConstants, Cloneable 39 { 40 private int line = 0; 41 private int column = 0; 42 43 protected RuntimeServices rsvc = null; 44 45 46 public abstract String getName(); 47 48 49 public abstract int getType(); 50 51 52 public void setLocation( int line, int column ) 53 { 54 this.line = line; 55 this.column = column; 56 } 57 58 59 public int getLine() 60 { 61 return line; 62 } 63 64 65 public int getColumn() 66 { 67 return column; 68 } 69 70 73 public void init( RuntimeServices rs, InternalContextAdapter context, 74 Node node) 75 throws Exception 76 { 77 rsvc = rs; 78 79 81 } 84 85 88 public abstract boolean render( InternalContextAdapter context, 89 Writer writer, Node node ) 90 throws IOException , ResourceNotFoundException, ParseErrorException, 91 MethodInvocationException; 92 } 93 | Popular Tags |