geirm 01/02/14 14:23:28
Modified: src/java/org/apache/velocity/runtime/directive
Directive.java
Log:
Added three new methods and two ints to allow pluggable directives to know where
they are in the
template for more useful log messages.
Revision Changes Path
1.11 +22 -0
jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Directive.java
Index: Directive.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Directive.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Directive.java 2001/01/03 05:28:33 1.10
+++ Directive.java 2001/02/14 22:23:27 1.11
@@ -65,12 +65,34 @@
*/
public abstract class Directive implements DirectiveConstants,Cloneable
{
+ private int line = 0;
+ private int column = 0;
+
/** Return the name of this directive */
public abstract String getName();
/** Get the directive type BLOCK/LINE */
public abstract int getType();
+
+ /** Allows the template location to be set */
+ public void setLocation( int line, int column )
+ {
+ this.line = line;
+ this.column = column;
+ }
+
+ /** for log msg purposes */
+ public int getLine()
+ {
+ return line;
+ }
+ /** for log msg purposes */
+ public int getColumn()
+ {
+ return column;
+ }
+
/**
* How this directive is to be initialized.
*/