KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > schema > loader > ContextLocatorImpl


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program 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 program 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 program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 /*
24  * ValidationContextProviderImpl.java
25  *
26  * Created on 12 décembre 2001, 15:23
27  */

28
29 package org.xquark.schema.loader;
30
31 import org.xquark.schema.validation.ValidationContextProvider;
32 import org.xquark.util.NamespaceContext;
33
34 public class ContextLocatorImpl implements ValidationContextProvider, org.xml.sax.Locator JavaDoc {
35 private static final String JavaDoc RCSRevision = "$Revision: 1.1 $";
36 private static final String JavaDoc RCSName = "$Name: $";
37     // ValidationContextProvider variables
38
private org.xquark.util.NamespaceContext context;
39   private String JavaDoc documentBase = null;
40   private java.util.HashMap JavaDoc notationDeclarations = null;
41   
42   // Locator variables
43
private String JavaDoc publicId = null;
44   private String JavaDoc systemId = null;
45   private int lineNumber = -1;
46   private int columnNumber = -1;
47
48   public ContextLocatorImpl(
49                         NamespaceContext context,
50                         String JavaDoc documentBase,
51                         org.xml.sax.Locator JavaDoc locator)
52   {
53     this.context = context;
54     this.documentBase = documentBase;
55     if (locator != null) {
56         this.publicId = locator.getPublicId();
57         this.systemId = locator.getSystemId();
58         this.lineNumber = locator.getLineNumber();
59         this.columnNumber = locator.getColumnNumber();
60     }
61   }
62
63   public String JavaDoc getNamespaceURI(String JavaDoc prefix) {
64     return context.getNamespaceURI(prefix);
65   }
66
67   public String JavaDoc getPrefix(String JavaDoc uri) {
68     return context.getPrefix(uri);
69   }
70
71   public String JavaDoc getDocumentBase() {
72     return documentBase;
73   }
74   
75   public java.util.Map JavaDoc getNotationDeclarations() {
76     return notationDeclarations;
77   }
78   
79   public void setNotationDeclarations(java.util.HashMap JavaDoc notations) {
80     notationDeclarations = notations;
81   }
82
83     
84   public java.lang.String JavaDoc getPublicId() {
85     return this.publicId;
86   }
87   
88   public java.lang.String JavaDoc getSystemId() {
89     return this.systemId;
90   }
91   
92   public int getLineNumber() {
93     return this.lineNumber;
94   }
95   
96   public int getColumnNumber() {
97     return this.columnNumber;
98   }
99   
100 }
101
102
Popular Tags