|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.apache.xerces.dom.NodeImpl | +--org.enhydra.apache.xerces.dom.ChildNode | +--org.enhydra.apache.xerces.dom.ParentNode | +--org.enhydra.apache.xerces.dom.DocumentTypeImpl
This class represents a Document Type declaraction in the document itself, not a Document Type Definition (DTD). An XML document may (or may not) have such a reference.
DocumentType is an Extended DOM feature, used in XML documents but not in HTML.
Note that Entities and Notations are no longer children of the DocumentType, but are parentless nodes hung only in their appropriate NamedNodeMaps.
This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001 Most notably, absolutely no provision was made for storing and using Element and Attribute information. Nor was the linkage between Entities and Entity References nailed down solidly.
Field Summary | |
protected NamedNodeMapImpl |
elements
Elements. |
protected NamedNodeMapImpl |
entities
Entities. |
protected String |
internalSubset
|
protected String |
name
Document type name. |
protected NamedNodeMapImpl |
notations
Notations. |
protected String |
publicID
|
(package private) static long |
serialVersionUID
Serialization version. |
protected String |
systemID
|
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode |
fCachedChild, fCachedChildIndex, fCachedLength, firstChild, ownerDocument |
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode |
nextSibling, previousSibling |
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl |
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, UNNORMALIZED |
Constructor Summary | |
DocumentTypeImpl(CoreDocumentImpl ownerDocument,
String name)
Factory method for creating a document type node. |
|
DocumentTypeImpl(CoreDocumentImpl ownerDocument,
String qualifiedName,
String publicID,
String systemID)
Factory method for creating a document type node. |
Method Summary | |
Node |
cloneNode(boolean deep)
Clones the node. |
NamedNodeMap |
getElements()
NON-DOM: Access the collection of ElementDefinitions. |
NamedNodeMap |
getEntities()
Access the collection of general Entities, both external and internal, defined in the DTD. |
String |
getInternalSubset()
Introduced in DOM Level 2. |
String |
getName()
Name of this document type. |
String |
getNodeName()
Returns the document type name |
short |
getNodeType()
A short integer indicating what type of node this is. |
NamedNodeMap |
getNotations()
Access the collection of Notations defined in the DTD. |
String |
getPublicId()
Introduced in DOM Level 2. |
String |
getSystemId()
Introduced in DOM Level 2. |
void |
setInternalSubset(String internalSubset)
NON-DOM. |
protected void |
setOwnerDocument(CoreDocumentImpl doc)
NON-DOM set the ownerDocument of this node and its children |
void |
setReadOnly(boolean readOnly,
boolean deep)
NON-DOM: Subclassed to flip the entities' and notations' readonly switch as well. |
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode |
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, insertBefore, internalInsertBefore, internalRemoveChild, item, lastChild, lastChild, normalize, ownerDocument, removeChild, replaceChild, synchronizeChildren |
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode |
getNextSibling, getParentNode, getPreviousSibling, parentNode, previousSibling |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface org.w3c.dom.Node |
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Field Detail |
static final long serialVersionUID
protected String name
protected NamedNodeMapImpl entities
protected NamedNodeMapImpl notations
protected NamedNodeMapImpl elements
protected String publicID
protected String systemID
protected String internalSubset
Constructor Detail |
public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String name)
public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String qualifiedName, String publicID, String systemID)
Method Detail |
public String getPublicId()
Return the public identifier of this Document type.
getPublicId
in interface DocumentType
public String getSystemId()
Return the system identifier of this Document type.
getSystemId
in interface DocumentType
public void setInternalSubset(String internalSubset)
Set the internalSubset given as a string.
public String getInternalSubset()
Return the internalSubset given as a string.
getInternalSubset
in interface DocumentType
public short getNodeType()
getNodeType
in interface Node
getNodeType
in class NodeImpl
public String getNodeName()
getNodeName
in interface Node
getNodeName
in class NodeImpl
public Node cloneNode(boolean deep)
cloneNode
in interface Node
cloneNode
in class ParentNode
org.enhydra.apache.xerces.dom.ChildNode
Example: Cloning a Text node will copy both the node and the text it
contains.
Example: Cloning something that has children -- Element or Attr, for
example -- will _not_ clone those children unless a "deep clone"
has been requested. A shallow clone of an Attr node will yield an
empty Attr of the same name.
NOTE: Clones will always be read/write, even if the node being cloned
is read-only, to permit applications using only the DOM API to obtain
editable copies of locked portions of the tree.
protected void setOwnerDocument(CoreDocumentImpl doc)
setOwnerDocument
in class ParentNode
public String getName()
getName
in interface DocumentType
public NamedNodeMap getEntities()
<!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.
getEntities
in interface DocumentType
public NamedNodeMap getNotations()
getNotations
in interface DocumentType
public void setReadOnly(boolean readOnly, boolean deep)
setReadOnly
in class ParentNode
NodeImpl.setReadOnly(boolean, boolean)
public NamedNodeMap getElements()
ElementDefinitionImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |