KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > steadystate > css > parser > LocatorImpl


1 /*
2  * LocatorImpl.java
3  *
4  * Steady State CSS2 Parser
5  *
6  * Copyright (C) 1999, 2002 Steady State Software Ltd. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  * To contact the authors of the library, write to Steady State Software Ltd.,
23  * 49 Littleworth, Wing, Buckinghamshire, LU7 0JX, England
24  *
25  * http://www.steadystate.com/css/
26  * mailto:css@steadystate.co.uk
27  *
28  * $Id: LocatorImpl.java,v 1.1.1.1 2003/12/28 21:23:08 davidsch Exp $
29  */

30
31 package com.steadystate.css.parser;
32
33 import org.w3c.css.sac.Locator;
34
35 /**
36  *
37  * @author David Schweinsberg
38  * @version $Release$
39  */

40 public class LocatorImpl implements Locator {
41
42     private String JavaDoc _uri;
43     private int _line;
44     private int _column;
45
46     /** Creates new LocatorImpl */
47     public LocatorImpl() {
48     }
49
50     /**
51      * Return the line number where the current document event ends.
52      * Note that this is the line position of the first character
53      * after the text associated with the document event.
54      * @return The line number, or -1 if none is available.
55      * @see #getColumnNumber
56      */

57     public int getLineNumber() {
58         return _line;
59     }
60     
61     /**
62      * Return the URI for the current document event.
63      *
64      * <p>The parser must resolve the URI fully before passing it to the
65      * application.</p>
66      *
67      * @return A string containing the URI, or null
68      * if none is available.
69      */

70     public String JavaDoc getURI() {
71         return _uri;
72     }
73     
74     /**
75      * Return the column number where the current document event ends.
76      * Note that this is the column number of the first
77      * character after the text associated with the document
78      * event. The first column in a line is position 1.
79      * @return The column number, or -1 if none is available.
80      * @see #getLineNumber
81      */

82     public int getColumnNumber() {
83         return _column;
84     }
85     
86 }
87
Popular Tags