1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon;
21
22 import org.apache.commons.jelly.LocationAware;
23 import org.apache.commons.jelly.TagSupport;
24
25 /***
26 * An abstract tag that is location aware.
27 * In other words, it is a tag that is capable of recording where in a Jelly script a tag
28 * is used which can aid debugging and tracing.</p>
29 */
30 public abstract class LocationAwareTagSupport extends TagSupport implements LocationAware {
31
32 protected int lineNumber = -1;
33 protected int columnNumber = -1;
34 protected String scriptFileName;
35 protected String elementTagName;
36
37 /***
38 * @return the line number of the tag
39 */
40 public int getLineNumber(){
41 return lineNumber;
42 }
43
44 /***
45 * Sets the line number of the tag
46 */
47 public void setLineNumber(int lineNumber){
48 this.lineNumber = lineNumber;
49 }
50
51 /***
52 * @return the column number of the tag
53 */
54 public int getColumnNumber(){
55 return columnNumber;
56 }
57
58 /***
59 * Sets the column number of the tag
60 */
61 public void setColumnNumber(int columnNumber){
62 this.columnNumber = columnNumber;
63 }
64
65 /***
66 * @return the Jelly file which caused the problem
67 */
68 public String getFileName(){
69 return scriptFileName;
70 }
71
72 /***
73 * Sets the Jelly file which caused the problem
74 */
75 public void setFileName(String fileName){
76 this.scriptFileName = fileName;
77 }
78
79 /***
80 * @return the element name which caused the problem
81 */
82 public String getElementName(){
83 return elementTagName;
84 }
85
86 /***
87 * Sets the element name which caused the problem
88 */
89 public void setElementName(String elementName){
90 this.elementTagName = elementName;
91 }
92 }