1 22 23 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 { 35 private static final String RCSRevision = "$Revision: 1.1 $"; 36 private static final String RCSName = "$Name: $"; 37 private org.xquark.util.NamespaceContext context; 39 private String documentBase = null; 40 private java.util.HashMap notationDeclarations = null; 41 42 private String publicId = null; 44 private String systemId = null; 45 private int lineNumber = -1; 46 private int columnNumber = -1; 47 48 public ContextLocatorImpl( 49 NamespaceContext context, 50 String documentBase, 51 org.xml.sax.Locator 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 getNamespaceURI(String prefix) { 64 return context.getNamespaceURI(prefix); 65 } 66 67 public String getPrefix(String uri) { 68 return context.getPrefix(uri); 69 } 70 71 public String getDocumentBase() { 72 return documentBase; 73 } 74 75 public java.util.Map getNotationDeclarations() { 76 return notationDeclarations; 77 } 78 79 public void setNotationDeclarations(java.util.HashMap notations) { 80 notationDeclarations = notations; 81 } 82 83 84 public java.lang.String getPublicId() { 85 return this.publicId; 86 } 87 88 public java.lang.String 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 |