View Javadoc

1   /*
2       Jameleon - An automation testing tool..
3       Copyright (C) 2005 Christian W. Hargraves (engrean@hotmail.com)
4       
5       This library is free software; you can redistribute it and/or
6       modify it under the terms of the GNU Lesser General Public
7       License as published by the Free Software Foundation; either
8       version 2.1 of the License, or (at your option) any later version.
9   
10      This library is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13      Lesser General Public License for more details.
14  
15      You should have received a copy of the GNU Lesser General Public
16      License along with this library; if not, write to the Free Software
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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  }