1 57 58 package com.sun.org.apache.xerces.internal.dom; 59 60 import org.w3c.dom.DOMException ; 61 import org.w3c.dom.Node ; 62 import org.w3c.dom.Notation ; 63 64 85 public class NotationImpl 86 extends NodeImpl 87 implements Notation { 88 89 93 94 static final long serialVersionUID = -764632195890658402L; 95 96 100 101 protected String name; 102 103 104 protected String publicId; 105 106 107 protected String systemId; 108 109 110 protected String baseURI; 111 112 116 117 public NotationImpl(CoreDocumentImpl ownerDoc, String name) { 118 super(ownerDoc); 119 this.name = name; 120 } 121 122 126 130 public short getNodeType() { 131 return Node.NOTATION_NODE; 132 } 133 134 137 public String getNodeName() { 138 if (needsSyncData()) { 139 synchronizeData(); 140 } 141 return name; 142 } 143 144 148 152 public String getPublicId() { 153 154 if (needsSyncData()) { 155 synchronizeData(); 156 } 157 return publicId; 158 159 } 161 165 public String getSystemId() { 166 167 if (needsSyncData()) { 168 synchronizeData(); 169 } 170 return systemId; 171 172 } 174 178 182 public void setPublicId(String id) { 183 184 if (isReadOnly()) { 185 throw new DOMException ( 186 DOMException.NO_MODIFICATION_ALLOWED_ERR, 187 DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); 188 } 189 if (needsSyncData()) { 190 synchronizeData(); 191 } 192 publicId = id; 193 194 } 196 200 public void setSystemId(String id) { 201 202 if(isReadOnly()) { 203 throw new DOMException ( 204 DOMException.NO_MODIFICATION_ALLOWED_ERR, 205 DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); 206 } 207 if (needsSyncData()) { 208 synchronizeData(); 209 } 210 systemId = id; 211 212 } 214 215 219 public String getBaseURI() { 220 if (needsSyncData()) { 221 synchronizeData(); 222 } 223 return baseURI; 224 } 225 226 227 public void setBaseURI(String uri){ 228 if (needsSyncData()) { 229 synchronizeData(); 230 } 231 baseURI = uri; 232 } 233 234 } | Popular Tags |