1 57 58 package org.xquark.xpath.datamodel.xerces.dom; 59 60 import org.w3c.dom.DocumentType ; 61 import org.w3c.dom.NamedNodeMap ; 62 import org.w3c.dom.Node ; 63 64 87 public class DocumentTypeImpl 88 extends ParentNode 89 implements DocumentType { 90 91 95 96 static final long serialVersionUID = 7751299192316526485L; 97 98 102 103 protected String name; 104 105 106 protected NamedNodeMapImpl entities; 107 108 109 protected NamedNodeMapImpl notations; 110 111 113 114 protected NamedNodeMapImpl elements; 115 116 protected String publicID; 118 119 protected String systemID; 121 122 protected String internalSubset; 124 125 129 130 public DocumentTypeImpl(DocumentImpl ownerDocument, String name) { 131 super(ownerDocument); 132 133 this.name = name; 134 entities = new NamedNodeMapImpl(this); 136 notations = new NamedNodeMapImpl(this); 137 138 elements = new NamedNodeMapImpl(this); 140 141 } 143 144 public DocumentTypeImpl(DocumentImpl ownerDocument, String qualifiedName, 145 String publicID, String systemID) { 146 this(ownerDocument, qualifiedName); 147 this.publicID = publicID; 148 this.systemID = systemID; 149 150 } 152 156 162 public String getPublicId() { 163 if (needsSyncData()) { 164 synchronizeData(); 165 } 166 return publicID; 167 } 168 174 public String getSystemId() { 175 if (needsSyncData()) { 176 synchronizeData(); 177 } 178 return systemID; 179 } 180 181 186 public void setInternalSubset(String internalSubset) { 187 if (needsSyncData()) { 188 synchronizeData(); 189 } 190 this.internalSubset = internalSubset; 191 } 192 193 199 public String getInternalSubset() { 200 if (needsSyncData()) { 201 synchronizeData(); 202 } 203 return internalSubset; 204 } 205 206 210 214 public short getNodeType() { 215 return Node.DOCUMENT_TYPE_NODE; 216 } 217 218 221 public String getNodeName() { 222 if (needsSyncData()) { 223 synchronizeData(); 224 } 225 return name; 226 } 227 228 229 public Node cloneNode(boolean deep) { 230 231 DocumentTypeImpl newnode = (DocumentTypeImpl)super.cloneNode(deep); 232 newnode.entities = entities.cloneMap(newnode); 234 newnode.notations = notations.cloneMap(newnode); 235 newnode.elements = elements.cloneMap(newnode); 236 237 return newnode; 238 239 } 241 245 void setOwnerDocument(DocumentImpl doc) { 246 super.setOwnerDocument(doc); 247 entities.setOwnerDocument(doc); 248 notations.setOwnerDocument(doc); 249 elements.setOwnerDocument(doc); 250 } 251 252 256 260 public String getName() { 261 262 if (needsSyncData()) { 263 synchronizeData(); 264 } 265 return name; 266 267 } 269 291 public NamedNodeMap getEntities() { 292 if (needsSyncChildren()) { 293 synchronizeChildren(); 294 } 295 return entities; 296 } 297 298 303 public NamedNodeMap getNotations() { 304 if (needsSyncChildren()) { 305 synchronizeChildren(); 306 } 307 return notations; 308 } 309 310 314 319 public void setReadOnly(boolean readOnly, boolean deep) { 320 321 if (needsSyncChildren()) { 322 synchronizeChildren(); 323 } 324 super.setReadOnly(readOnly, deep); 325 326 elements.setReadOnly(readOnly, true); 328 entities.setReadOnly(readOnly, true); 329 notations.setReadOnly(readOnly, true); 330 331 } 333 337 public NamedNodeMap getElements() { 338 if (needsSyncChildren()) { 339 synchronizeChildren(); 340 } 341 return elements; 342 } 343 344 } | Popular Tags |