1 38 39 package com.sun.xml.fastinfoset.util; 40 41 import javax.xml.stream.Location; 42 43 44 public class EventLocation implements Location{ 45 String _systemId = null; 46 String _publicId = null; 47 int _column = -1; 48 int _line = -1; 49 int _charOffset = -1; 50 51 EventLocation() { 52 } 53 54 public static Location getNilLocation() { 56 return new EventLocation(); 57 } 58 63 public int getLineNumber(){ 64 return _line; 65 } 66 71 public int getColumnNumber() { 72 return _column; 73 } 74 75 83 public int getCharacterOffset(){ 84 return _charOffset; 85 } 86 87 91 public String getPublicId(){ 92 return _publicId; 93 } 94 95 99 public String getSystemId(){ 100 return _systemId; 101 } 102 103 public void setLineNumber(int line) { 104 _line = line; 105 } 106 public void setColumnNumber(int col) { 107 _column = col; 108 } 109 public void setCharacterOffset(int offset) { 110 _charOffset = offset; 111 } 112 public void setPublicId(String id) { 113 _publicId = id; 114 } 115 public void setSystemId(String id) { 116 _systemId = id; 117 } 118 119 public String toString(){ 120 StringBuffer sbuffer = new StringBuffer () ; 121 sbuffer.append("Line number = " + _line); 122 sbuffer.append("\n") ; 123 sbuffer.append("Column number = " + _column); 124 sbuffer.append("\n") ; 125 sbuffer.append("System Id = " + _systemId); 126 sbuffer.append("\n") ; 127 sbuffer.append("Public Id = " + _publicId); 128 sbuffer.append("\n") ; 129 sbuffer.append("CharacterOffset = " + _charOffset); 130 sbuffer.append("\n") ; 131 return sbuffer.toString(); 132 } 133 134 } 135 136 | Popular Tags |