Package org.zkoss.idom
Class Document
java.lang.Object
org.zkoss.idom.impl.AbstractItem
org.zkoss.idom.impl.AbstractGroup
org.zkoss.idom.Document
Represents Document which is also W3C/DOM's document,
i.e., org.w3c.dom.Document.
- Author:
- tomyeh
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.zkoss.idom.impl.AbstractGroup
AbstractGroup.ElementMap -
Field Summary
Fields inherited from class org.zkoss.idom.impl.AbstractGroup
_childrenFields inherited from interface org.zkoss.idom.Item
FIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVEFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal AttrcreateAttribute(String lname) final AttrcreateAttributeNS(String nsURI, String tname) final CDATASectioncreateCDATASection(String data) final CommentcreateComment(String data) final DocumentFragmentfinal ElementcreateElement(String lname) final ElementcreateElementNS(String nsURI, String tname) final EntityReferencecreateEntityReference(String name) final ProcessingInstructioncreateProcessingInstruction(String target, String data) final TextcreateTextNode(String data) final DocumentTypefinal DocTypeGets the document type.final Elementfinal ElementgetElementById(String elementId) final NodeListgetElementsByTagName(String tname) Gets elements that matches the tag name.final NodeListgetElementsByTagNameNS(String nsURI, String lname) Gets elements that matches the tag name and namespace.final DOMImplementationfinal StringgetName()Gets the name of the item.final shortfinal ElementGets the root element.booleanbooleanfinal NodeimportNode(Node importedNode, boolean deep) Creates a list to hold child vertices.voidrenameNode(Node n, String namespaceURI, String qualifiedName) final voidsetDocType(DocType docType) Sets the document type.voidsetDocumentURI(String documentURI) final voidsetRootElement(Element root) Sets the root element.voidsetStrictErrorChecking(boolean strictErrorChecking) voidsetXmlStandalone(boolean xmlStandalone) voidsetXmlVersion(String xmlVersion) final StringtoString()Methods inherited from class org.zkoss.idom.impl.AbstractGroup
anyElement, appendChild, clone, coalesce, detachChildren, getChildNodes, getChildren, getElement, getElement, getElementIndex, getElementIndex, getElementNames, getElements, getElements, getElements, getElementValue, getElementValue, getFirstChild, getLastChild, hasChildNodes, insertBefore, removeChild, replaceChildMethods inherited from class org.zkoss.idom.impl.AbstractItem
cloneNode, compareDocumentPosition, detach, equals, getAttributes, getBaseURI, getDocument, getFeature, getLocalName, getLocator, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getText, getTextContent, getUserData, hasAttributes, hashCode, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, match, normalize, setLocator, setName, setNodeValue, setParent, setPrefix, setText, setTextContent, setUserDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.zkoss.idom.Item
detach, getDocument, getLocator, getParent, getText, setLocator, setName, setParent, setTextMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
Document
Constructor. -
Document
Constructor. -
Document
public Document()Constructor.
-
-
Method Details
-
getRootElement
Gets the root element. -
setRootElement
Sets the root element. -
getDocType
Gets the document type. -
setDocType
Sets the document type. -
newChildren
Description copied from class:AbstractGroupCreates a list to hold child vertices. Note: the list must be able to protect itself from adding unexpected child -- read-only, wrong type, undetached...The default implementation obeys the semantic of Element, i.e., it doesn't allow any child that cannot be a child of Element.
For performance issue, we introduced a map to improve the search speed for Element node associated with a tag name.
- Overrides:
newChildrenin classAbstractGroup
-
getName
Description copied from interface:ItemGets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as getTagName. -
getNodeType
public final short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElementin interfaceDocument
-
getImplementation
- Specified by:
getImplementationin interfaceDocument
-
createElement
- Specified by:
createElementin interfaceDocument
-
createElementNS
- Specified by:
createElementNSin interfaceDocument
-
createAttribute
- Specified by:
createAttributein interfaceDocument
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument
-
createProcessingInstruction
- Specified by:
createProcessingInstructionin interfaceDocument
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument
-
getElementsByTagName
Gets elements that matches the tag name.Unlike other implementations (Xerces or Crimson), the returned list is a snapshot of the current tree -- not a "live" representation.
- Specified by:
getElementsByTagNamein interfaceDocument
-
getElementsByTagNameNS
Gets elements that matches the tag name and namespace.Unlike other implementations (Xerces or Crimson), the returned list is a snapshot of the current tree -- not a "live" representation.
- Specified by:
getElementsByTagNameNSin interfaceDocument
-
getElementById
- Specified by:
getElementByIdin interfaceDocument
-
importNode
- Specified by:
importNodein interfaceDocument
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
adoptNode
- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
renameNode
- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-
toString
-