1 31 36 37 package com.hp.hpl.jena.rdf.arp; 38 import org.xml.sax.Locator ; 39 40 45 class Location implements Locator { 46 final String inputName; 47 final String publicId; 48 final int endLine; 49 final int endColumn; 50 Location(Locator locator) { 51 if (locator==null){ 52 inputName = "unknown-source"; 53 publicId = "unknown-source"; 54 endLine = -1; 55 endColumn = -1; 56 }else { 57 inputName = locator.getSystemId(); 58 endLine = locator.getLineNumber(); 59 endColumn = locator.getColumnNumber(); 60 publicId = locator.getPublicId(); 61 } 62 } 63 Location(String sysId,int line,int col) { 64 inputName = sysId; 65 endLine = line; 66 endColumn = col; 67 publicId = null; 68 } 69 public String toString() { 70 return "line " + endLine + " in '" 72 + inputName + "'"; 73 } 74 public String getSystemId() { 75 return inputName; 76 } 77 public int getLineNumber() { 78 return endLine; 79 } 80 public int getColumnNumber() { 81 return endColumn; 82 } 83 public String getPublicId() { 84 return publicId; 85 } 86 87 } 88 | Popular Tags |