1 16 17 package org.apache.xerces.dom; 18 19 import org.w3c.dom.Entity ; 20 import org.w3c.dom.Node ; 21 22 58 public class EntityImpl 59 extends ParentNode 60 implements Entity { 61 62 66 67 static final long serialVersionUID = -3575760943444303423L; 68 69 73 74 protected String name; 75 76 77 protected String publicId; 78 79 80 protected String systemId; 81 82 83 protected String encoding; 84 85 86 87 protected String inputEncoding; 88 89 90 protected String version; 91 92 93 94 protected String notationName; 95 96 97 protected String baseURI; 98 99 103 104 public EntityImpl(CoreDocumentImpl ownerDoc, String name) { 105 super(ownerDoc); 106 this.name = name; 107 isReadOnly(true); 108 } 109 110 114 118 public short getNodeType() { 119 return Node.ENTITY_NODE; 120 } 121 122 125 public String getNodeName() { 126 if (needsSyncData()) { 127 synchronizeData(); 128 } 129 return name; 130 } 131 132 133 public Node cloneNode(boolean deep) { 134 EntityImpl newentity = (EntityImpl)super.cloneNode(deep); 135 newentity.setReadOnly(true, deep); 136 return newentity; 137 } 138 139 143 147 public String getPublicId() { 148 149 if (needsSyncData()) { 150 synchronizeData(); 151 } 152 return publicId; 153 154 } 156 160 public String getSystemId() { 161 162 if (needsSyncData()) { 163 synchronizeData(); 164 } 165 return systemId; 166 167 } 169 173 public String getXmlVersion() { 174 175 if (needsSyncData()) { 176 synchronizeData(); 177 } 178 return version; 179 180 } 182 183 187 public String getXmlEncoding() { 188 189 if (needsSyncData()) { 190 synchronizeData(); 191 } 192 193 return encoding; 194 195 } 197 198 199 200 201 207 public String getNotationName() { 208 209 if (needsSyncData()) { 210 synchronizeData(); 211 } 212 return notationName; 213 214 } 216 220 223 public void setPublicId(String id) { 224 225 if (needsSyncData()) { 226 synchronizeData(); 227 } 228 publicId = id; 229 230 } 232 239 public void setXmlEncoding(String value) { 240 if (needsSyncData()) { 241 synchronizeData(); 242 } 243 encoding = value; 244 } 246 247 254 public String getInputEncoding(){ 255 if (needsSyncData()) { 256 synchronizeData(); 257 } 258 return inputEncoding; 259 } 260 261 264 public void setInputEncoding(String inputEncoding){ 265 if (needsSyncData()) { 266 synchronizeData(); 267 } 268 this.inputEncoding = inputEncoding; 269 } 270 271 277 public void setXmlVersion(String value) { 278 if (needsSyncData()) { 279 synchronizeData(); 280 } 281 version = value; 282 } 284 285 289 public void setSystemId(String id) { 290 if (needsSyncData()) { 291 synchronizeData(); 292 } 293 systemId = id; 294 295 } 297 303 public void setNotationName(String name) { 304 if (needsSyncData()) { 305 synchronizeData(); 306 } 307 notationName = name; 308 309 } 311 312 313 321 public String getBaseURI() { 322 323 if (needsSyncData()) { 324 synchronizeData(); 325 } 326 return (baseURI!=null)?baseURI:((CoreDocumentImpl)getOwnerDocument()).getBaseURI(); 327 } 328 329 330 public void setBaseURI(String uri){ 331 if (needsSyncData()) { 332 synchronizeData(); 333 } 334 baseURI = uri; 335 } 336 337 338 339 } | Popular Tags |