KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > util > LocatorProxy


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.util;
18
19 import org.apache.xerces.xni.XMLLocator;
20 import org.xml.sax.Locator JavaDoc;
21 import org.xml.sax.ext.Locator2 JavaDoc;
22
23 /**
24  * Wraps {@link XMLLocator} and make it look like a SAX {@link Locator}.
25  *
26  * @author Arnaud Le Hors, IBM
27  * @author Andy Clark, IBM
28  *
29  * @version $Id: LocatorProxy.java,v 1.1 2005/06/20 18:29:00 mrglavas Exp $
30  */

31 public class LocatorProxy implements Locator2 JavaDoc {
32         
33     //
34
// Data
35
//
36

37     /** XML locator. */
38     private final XMLLocator fLocator;
39     
40     //
41
// Constructors
42
//
43

44     /** Constructs an XML locator proxy. */
45     public LocatorProxy(XMLLocator locator) {
46         fLocator = locator;
47     }
48     
49     //
50
// Locator methods
51
//
52

53     /** Public identifier. */
54     public String JavaDoc getPublicId() {
55         return fLocator.getPublicId();
56     }
57         
58     /** System identifier. */
59     public String JavaDoc getSystemId() {
60         return fLocator.getExpandedSystemId();
61     }
62     
63     /** Line number. */
64     public int getLineNumber() {
65         return fLocator.getLineNumber();
66     }
67         
68     /** Column number. */
69     public int getColumnNumber() {
70         return fLocator.getColumnNumber();
71     }
72     
73     //
74
// Locator2 methods
75
//
76

77     public String JavaDoc getXMLVersion() {
78         return fLocator.getXMLVersion();
79     }
80         
81     public String JavaDoc getEncoding() {
82         return fLocator.getEncoding();
83     }
84         
85 }
86
Popular Tags