KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > tag > Location


1 /**
2  * Licensed under the Common Development and Distribution License,
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.sun.com/cddl/
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */

14
15 package com.sun.facelets.tag;
16
17 /**
18  * An object that represents the Location of a Tag or TagAttribute in a Facelet
19  * file.
20  *
21  * @see com.sun.facelets.tag.Tag
22  * @see com.sun.facelets.tag.TagAttribute
23  * @author Jacob Hookom
24  * @version $Id: Location.java,v 1.3 2005/08/24 04:38:47 jhook Exp $
25  */

26 public final class Location {
27
28     private final String JavaDoc path;
29
30     private final int line;
31
32     private final int column;
33
34     public Location(String JavaDoc path, int line, int column) {
35         this.path = path;
36         this.line = line;
37         this.column = column;
38     }
39
40     /**
41      * Estimated character column
42      *
43      * @return character column
44      */

45     public int getColumn() {
46         return column;
47     }
48
49     /**
50      * Line this is located at
51      *
52      * @return link this is located at
53      */

54     public int getLine() {
55         return line;
56     }
57
58     /**
59      * File path to this location
60      *
61      * @return file path
62      */

63     public String JavaDoc getPath() {
64         return path;
65     }
66
67     /*
68      * (non-Javadoc)
69      *
70      * @see java.lang.Object#toString()
71      */

72     public String JavaDoc toString() {
73         return path + " @" + this.line + "," + this.column;
74     }
75 }
76
Popular Tags