Methods Summary |
---|
public org.w3c.dom.Node | cloneNode(boolean deep)Clones the node.
DocumentTypeImpl newnode = (DocumentTypeImpl)super.cloneNode(deep);
// NamedNodeMaps must be cloned explicitly, to avoid sharing them.
newnode.entities = entities.cloneMap(newnode);
newnode.notations = notations.cloneMap(newnode);
newnode.elements = elements.cloneMap(newnode);
return newnode;
|
public org.w3c.dom.NamedNodeMap | getElements()NON-DOM: Access the collection of ElementDefinitions.
if (needsSyncChildren()) {
synchronizeChildren();
}
return elements;
|
public org.w3c.dom.NamedNodeMap | getEntities()Access the collection of general Entities, both external and
internal, defined in the DTD. For example, in:
<!doctype example SYSTEM "ex.dtd" [
<!ENTITY foo "foo">
<!ENTITY bar "bar">
<!ENTITY % baz "baz">
]>
The Entities map includes foo and bar, but not baz. It is promised that
only Nodes which are Entities will exist in this NamedNodeMap.
For HTML, this will always be null.
Note that "built in" entities such as & and < should be
converted to their actual characters before being placed in the DOM's
contained text, and should be converted back when the DOM is rendered
as XML or HTML, and hence DO NOT appear here.
if (needsSyncChildren()) {
synchronizeChildren();
}
return entities;
|
public java.lang.String | getInternalSubset()Introduced in DOM Level 2.
Return the internalSubset given as a string.
if (needsSyncData()) {
synchronizeData();
}
return internalSubset;
|
public java.lang.String | getName()Name of this document type. If we loaded from a DTD, this should
be the name immediately following the DOCTYPE keyword.
if (needsSyncData()) {
synchronizeData();
}
return name;
|
public java.lang.String | getNodeName()Returns the document type name
if (needsSyncData()) {
synchronizeData();
}
return name;
|
protected int | getNodeNumber()NON-DOM
Get the number associated with this doctype.
// If the doctype has a document owner, get the node number
// relative to the owner doc
if (getOwnerDocument()!=null)
return super.getNodeNumber();
// The doctype is disconnected and not associated with any document.
// Assign the doctype a number relative to the implementation.
if (doctypeNumber==0) {
CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl)CoreDOMImplementationImpl.getDOMImplementation();
doctypeNumber = cd.assignDocTypeNumber();
}
return doctypeNumber;
|
public short | getNodeType()A short integer indicating what type of node this is. The named
constants for this value are defined in the org.w3c.dom.Node interface.
return Node.DOCUMENT_TYPE_NODE;
|
public org.w3c.dom.NamedNodeMap | getNotations()Access the collection of Notations defined in the DTD. A
notation declares, by name, the format of an XML unparsed entity
or is used to formally declare a Processing Instruction target.
if (needsSyncChildren()) {
synchronizeChildren();
}
return notations;
|
public java.lang.String | getPublicId()Introduced in DOM Level 2.
Return the public identifier of this Document type.
if (needsSyncData()) {
synchronizeData();
}
return publicID;
|
public java.lang.String | getSystemId()Introduced in DOM Level 2.
Return the system identifier of this Document type.
if (needsSyncData()) {
synchronizeData();
}
return systemID;
|
public java.lang.String | getTextContent()
return null;
|
public java.lang.Object | getUserData(java.lang.String key)
if (userData == null) {
return null;
}
Object o = userData.get(key);
if (o != null) {
UserDataRecord r = (UserDataRecord) o;
return r.fData;
}
return null;
|
protected java.util.Hashtable | getUserDataRecord()
return userData;
|
public boolean | isEqualNode(org.w3c.dom.Node arg)DOM Level 3 WD- Experimental.
Override inherited behavior from ParentNodeImpl to support deep equal.
if (!super.isEqualNode(arg)) {
return false;
}
if (needsSyncData()) {
synchronizeData();
}
DocumentTypeImpl argDocType = (DocumentTypeImpl) arg;
//test if the following string attributes are equal: publicId,
//systemId, internalSubset.
if ((getPublicId() == null && argDocType.getPublicId() != null)
|| (getPublicId() != null && argDocType.getPublicId() == null)
|| (getSystemId() == null && argDocType.getSystemId() != null)
|| (getSystemId() != null && argDocType.getSystemId() == null)
|| (getInternalSubset() == null
&& argDocType.getInternalSubset() != null)
|| (getInternalSubset() != null
&& argDocType.getInternalSubset() == null)) {
return false;
}
if (getPublicId() != null) {
if (!getPublicId().equals(argDocType.getPublicId())) {
return false;
}
}
if (getSystemId() != null) {
if (!getSystemId().equals(argDocType.getSystemId())) {
return false;
}
}
if (getInternalSubset() != null) {
if (!getInternalSubset().equals(argDocType.getInternalSubset())) {
return false;
}
}
//test if NamedNodeMaps entities and notations are equal
NamedNodeMapImpl argEntities = argDocType.entities;
if ((entities == null && argEntities != null)
|| (entities != null && argEntities == null))
return false;
if (entities != null && argEntities != null) {
if (entities.getLength() != argEntities.getLength())
return false;
for (int index = 0; entities.item(index) != null; index++) {
Node entNode1 = entities.item(index);
Node entNode2 =
argEntities.getNamedItem(entNode1.getNodeName());
if (!((NodeImpl) entNode1).isEqualNode((NodeImpl) entNode2))
return false;
}
}
NamedNodeMapImpl argNotations = argDocType.notations;
if ((notations == null && argNotations != null)
|| (notations != null && argNotations == null))
return false;
if (notations != null && argNotations != null) {
if (notations.getLength() != argNotations.getLength())
return false;
for (int index = 0; notations.item(index) != null; index++) {
Node noteNode1 = notations.item(index);
Node noteNode2 =
argNotations.getNamedItem(noteNode1.getNodeName());
if (!((NodeImpl) noteNode1).isEqualNode((NodeImpl) noteNode2))
return false;
}
}
return true;
|
public void | setInternalSubset(java.lang.String internalSubset)NON-DOM.
Set the internalSubset given as a string.
if (needsSyncData()) {
synchronizeData();
}
this.internalSubset = internalSubset;
|
void | setOwnerDocument(com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl doc)NON-DOM
set the ownerDocument of this node and its children
super.setOwnerDocument(doc);
entities.setOwnerDocument(doc);
notations.setOwnerDocument(doc);
elements.setOwnerDocument(doc);
|
public void | setReadOnly(boolean readOnly, boolean deep)NON-DOM: Subclassed to flip the entities' and notations' readonly switch
as well.
if (needsSyncChildren()) {
synchronizeChildren();
}
super.setReadOnly(readOnly, deep);
// set read-only property
elements.setReadOnly(readOnly, true);
entities.setReadOnly(readOnly, true);
notations.setReadOnly(readOnly, true);
|
public void | setTextContent(java.lang.String textContent)
// no-op
|
public java.lang.Object | setUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)
if(userData == null)
userData = new Hashtable();
if (data == null) {
if (userData != null) {
Object o = userData.remove(key);
if (o != null) {
UserDataRecord r = (UserDataRecord) o;
return r.fData;
}
}
return null;
}
else {
Object o = userData.put(key, new UserDataRecord(data, handler));
if (o != null) {
UserDataRecord r = (UserDataRecord) o;
return r.fData;
}
}
return null;
|