01: /**
02: * Licensed under the Common Development and Distribution License,
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at
05: *
06: * http://www.sun.com/cddl/
07: *
08: * Unless required by applicable law or agreed to in writing, software
09: * 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: */package com.sun.facelets.tag;
14:
15: /**
16: * An object that represents the Location of a Tag or TagAttribute in a Facelet
17: * file.
18: *
19: * @see com.sun.facelets.tag.Tag
20: * @see com.sun.facelets.tag.TagAttribute
21: * @author Jacob Hookom
22: * @version $Id: Location.java,v 1.3 2005/08/24 04:38:47 jhook Exp $
23: */
24: public final class Location {
25:
26: private final String path;
27:
28: private final int line;
29:
30: private final int column;
31:
32: public Location(String path, int line, int column) {
33: this .path = path;
34: this .line = line;
35: this .column = column;
36: }
37:
38: /**
39: * Estimated character column
40: *
41: * @return character column
42: */
43: public int getColumn() {
44: return column;
45: }
46:
47: /**
48: * Line this is located at
49: *
50: * @return link this is located at
51: */
52: public int getLine() {
53: return line;
54: }
55:
56: /**
57: * File path to this location
58: *
59: * @return file path
60: */
61: public String getPath() {
62: return path;
63: }
64:
65: /*
66: * (non-Javadoc)
67: *
68: * @see java.lang.Object#toString()
69: */
70: public String toString() {
71: return path + " @" + this .line + "," + this.column;
72: }
73: }
|