Class DOM2DTMdefaultNamespaceDeclarationNode
- All Implemented Interfaces:
EventTarget,Attr,ModelNode,Node,TypeInfo
(This used to be an internal class within DOM2DTM. Moved out because I need to perform an instanceof operation on it to support a temporary workaround in DTMManagerDefault.)
%REVIEW% What if the DOM2DTM was built around a DocumentFragment and there isn't a single root element? I think this fails that case...
%REVIEW% An alternative solution would be to create the node _only_ in DTM space, but given how DOM2DTM is currently written I think this is simplest.
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(String type, Function listener) addEventListener.voidaddEventListener(String type, Function listener, boolean useCapture) addEventListener.appendChild(Node a) appendChild.voidappendChildrenToCollectionImpl(NodeFilter filter, Collection<Node> collection) cloneNode.cloneNode(boolean deep) Returns a copy of node.shortcompareDocumentPosition(Node other) compareDocumentPosition.booleanReturns true if other is an inclusive descendant of node, and false otherwise.booleandispatchEvent(Event evt) dispatchEvent.booleandispatchEvent(Node element, Event evt) dispatchEvent.voidextractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Extracts all descendents that match the filter, except those descendents of nodes that match the filter.Tries to get a UINode associated with the current node.voidgetAttributes.Returns node's node document's document base URL.Returns the children.getDocumentItem(String name) getDocumentItem.getFeature(String name, String version) Returns the first child.getFullURL(String spec) getFullURL.Returns the last child.getLocalName.getName()getName.getNamespaceURI.Returns the next sibling.Returns a string appropriate for the type of node.intReturns the type of node.getNodeValue.Returns the node document.getOwnerElement.Returns the parent element.getParentModelNode.Returns the parent.getPrefix.Returns the previous sibling.getPreviousTo(Node node) getRenderState.Returns node's root.getCurrentNode.getTextContent.getTypeName.getTypeNamespace.getUserData(String key) getUserData.getValue()getValue.booleanReturns true if element has attributes, and false otherwise.booleanReturns whether node has children.insertBefore(Node a, Node b) insertBefore.booleanisDefaultNamespace(String namespaceURI) isDefaultNamespace.booleanisDerivedFrom(String ns, String localName, int derivationMethod) isDerivedFrom.booleanisEqualNode(Node arg) Returns whether node and otherNode have the same properties.booleanisEqualOrDescendentOf(ModelNode otherNode) isEqualOrDescendentOf.booleanisId()isId.booleanReturns true if node is connected and false otherwise.booleanisSameNode(Node other) isSameNode.booleanisSpecified.booleanisSupported(String feature, String version) lookupNamespaceURI(String specifiedPrefix) lookupNamespaceURI.lookupPrefix(String namespaceURI) lookupPrefix.voidRemoves empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.prepend.prependChild(Node newChild) prependChild.removeChild(Node a) removeChild.voidremoveEventListener(String type, Function listener) removeEventListener.voidremoveEventListener(String type, Function listener, boolean useCapture) removeEventListener.replaceChild(Node a, Node b) replaceChild.voidsetDocumentItem(String name, Object value) Sets a document item.voidsetNamespaceURI(String namespaceURI) voidsetNodeValue(String value) setNodeValue.voidsetOwnerDocument(Document document) setOwnerDocument.voidsetOwnerDocument(Document value, boolean deep) setOwnerDocument.voidsetOwnerElement(Node element) setOwnerElement.voidsetParentImpl(Node parent) setParentImpl.voidsetPrefix.voidsetTextContent(String textContent) setTextContent.setUserData(String key, Object data, UserDataHandler handler) setUserData.voidsetValue.voidvisit(NodeVisitor visitor) visit.voidwarn.
-
Method Details
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeNamein interfaceNode- Returns:
- a
Stringobject.
-
getName
getName.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURIin interfaceAttr- Specified by:
getNamespaceURIin interfaceNode- Returns:
- a
Stringobject.
-
getPrefix
getPrefix.
-
getLocalName
getLocalName.
- Specified by:
getLocalNamein interfaceAttr- Specified by:
getLocalNamein interfaceNode- Returns:
- a
Stringobject.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValuein interfaceNode- Returns:
- a
Stringobject.
-
getValue
getValue.
-
getOwnerElement
getOwnerElement.
- Specified by:
getOwnerElementin interfaceAttr- Returns:
- a
Nodeobject.
-
isSupported
- Specified by:
isSupportedin interfaceNode
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodesin interfaceNode- Returns:
- a boolean.
-
hasAttributes
public boolean hasAttributes()Returns true if element has attributes, and false otherwise.- Specified by:
hasAttributesin interfaceNode- Returns:
- a boolean.
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
getDocumentNode
- Specified by:
getDocumentNodein interfaceNode
-
getParentNode
Returns the parent.- Specified by:
getParentNodein interfaceNode- Returns:
- a
Nodeobject.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChildin interfaceNode- Returns:
- a
Nodeobject.
-
isIsConnected
public boolean isIsConnected()Description copied from interface:NodeReturns true if node is connected and false otherwise.- Specified by:
isIsConnectedin interfaceNode- Returns:
- a boolean.
-
getLastChild
Returns the last child.- Specified by:
getLastChildin interfaceNode- Returns:
- a
Nodeobject.
-
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
getRootNode
Description copied from interface:NodeReturns node's root.- Specified by:
getRootNodein interfaceNode- Returns:
- a
Nodeobject.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
normalize
public void normalize()Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -
getChildNodes
Returns the children.- Specified by:
getChildNodesin interfaceNode- Returns:
- a
NodeListobject.
-
getAttributes
getAttributes.
- Specified by:
getAttributesin interfaceNode- Returns:
- a
NamedNodeMapobject.
-
getNodeType
public int getNodeType()Returns the type of node.- Specified by:
getNodeTypein interfaceNode- Returns:
- a
Integerobject.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValuein interfaceNode- Parameters:
value- aStringobject.
-
setValue
setValue.
-
setOwnerElement
Description copied from interface:AttrsetOwnerElement.
- Specified by:
setOwnerElementin interfaceAttr- Parameters:
element- aNodeobject.
-
setPrefix
setPrefix.
-
insertBefore
insertBefore.
- Specified by:
insertBeforein interfaceNode- Parameters:
a- aNodeobject.b- aNodeobject.- Returns:
- a
Nodeobject.
-
replaceChild
replaceChild.
- Specified by:
replaceChildin interfaceNode- Parameters:
a- aNodeobject.b- aNodeobject.- Returns:
- a
Nodeobject.
-
appendChild
appendChild.
- Specified by:
appendChildin interfaceNode- Parameters:
a- aNodeobject.- Returns:
- a
Nodeobject.
-
prependChild
Description copied from interface:NodeprependChild.
- Specified by:
prependChildin interfaceNode- Parameters:
newChild- aNodeobject.- Returns:
- a
Nodeobject.
-
prepend
Description copied from interface:Nodeprepend.
-
removeChild
removeChild.
- Specified by:
removeChildin interfaceNode- Parameters:
a- aNodeobject.- Returns:
- a
Nodeobject.
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocumentin interfaceNode- Returns:
- a
Documentobject.
-
getParentElement
Description copied from interface:NodeReturns the parent element.- Specified by:
getParentElementin interfaceNode- Returns:
- a
HTMLElementobject.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
cloneNode
Description copied from interface:NodecloneNode.
-
setOwnerDocument
Description copied from interface:NodesetOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
document- aDocumentobject.
-
setOwnerDocument
Description copied from interface:NodesetOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
value- aDocumentobject.deep- a boolean.
-
getTypeName
getTypeName.
- Specified by:
getTypeNamein interfaceTypeInfo- Returns:
- a
Stringobject.
-
getTypeNamespace
getTypeNamespace.
- Specified by:
getTypeNamespacein interfaceTypeInfo- Returns:
- a
Stringobject.
-
isDerivedFrom
isDerivedFrom.
- Specified by:
isDerivedFromin interfaceTypeInfo- Returns:
- a
Booleanobject.
-
getSchemaTypeInfo
getCurrentNode.
- Specified by:
getSchemaTypeInfoin interfaceAttr- Returns:
- a
TypeInfoobject.
-
isSpecified
public boolean isSpecified()Description copied from interface:AttrisSpecified.
- Specified by:
isSpecifiedin interfaceAttr- Returns:
- a boolean.
-
isId
public boolean isId()isId.
-
setUserData
setUserData.
- Specified by:
setUserDatain interfaceNode- Parameters:
key- aStringobject.data- aObjectobject.handler- aUserDataHandlerobject.- Returns:
- a
Objectobject.
-
setParentImpl
Description copied from interface:NodesetParentImpl.
- Specified by:
setParentImplin interfaceNode- Parameters:
parent- aNodeobject.
-
setNamespaceURI
- Specified by:
setNamespaceURIin interfaceNode
-
contains
Description copied from interface:NodeReturns true if other is an inclusive descendant of node, and false otherwise. -
getUserData
getUserData.
- Specified by:
getUserDatain interfaceNode- Parameters:
key- aStringobject.- Returns:
- a
Objectobject.
-
getPreviousTo
- Specified by:
getPreviousToin interfaceNode
-
getNextTo
-
forgetRenderState
public void forgetRenderState()- Specified by:
forgetRenderStatein interfaceNode
-
appendChildrenToCollectionImpl
- Specified by:
appendChildrenToCollectionImplin interfaceNode
-
extractDescendentsArrayImpl
public void extractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Description copied from interface:NodeExtracts all descendents that match the filter, except those descendents of nodes that match the filter.- Specified by:
extractDescendentsArrayImplin interfaceNode- Parameters:
filter- aNodeFilterobject.al- aArrayListobject.
-
findUINode
Description copied from interface:NodeTries to get a UINode associated with the current node. Failing that, it tries ancestors recursively. This method will return the closest block-level renderer node, if any.- Specified by:
findUINodein interfaceNode- Returns:
- a
UINodeobject.
-
visit
Description copied from interface:Nodevisit.
- Specified by:
visitin interfaceNode- Parameters:
visitor- aNodeVisitorobject.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNodein interfaceNode- Parameters:
arg- aNodeobject.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURIin interfaceNode- Parameters:
specifiedPrefix- aStringobject.- Returns:
- a
Stringobject.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespacein interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a boolean.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefixin interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a
Stringobject.
-
isSameNode
isSameNode.
- Specified by:
isSameNodein interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a boolean.
-
setTextContent
setTextContent.
- Specified by:
setTextContentin interfaceNode- Parameters:
textContent- aStringobject.- Throws:
DOMException
-
getTextContent
getTextContent.
- Specified by:
getTextContentin interfaceNode- Returns:
- a
Stringobject. - Throws:
DOMException
-
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPositionin interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a short.
- Throws:
DOMException
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURIin interfaceNode- Returns:
- a
Stringobject.
-
addEventListener
Description copied from interface:EventTargetaddEventListener.
- Specified by:
addEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.
-
addEventListener
Description copied from interface:EventTargetaddEventListener.
- Specified by:
addEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.useCapture- a boolean.
-
removeEventListener
Description copied from interface:EventTargetremoveEventListener.
- Specified by:
removeEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.
-
removeEventListener
Description copied from interface:EventTargetremoveEventListener.
- Specified by:
removeEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.useCapture- a boolean.
-
dispatchEvent
Description copied from interface:EventTargetdispatchEvent.
- Specified by:
dispatchEventin interfaceEventTarget- Parameters:
element- aNodeobject.evt- aEventobject.- Returns:
- a boolean.
-
dispatchEvent
Description copied from interface:EventTargetdispatchEvent.
- Specified by:
dispatchEventin interfaceEventTarget- Parameters:
evt- aEventobject.- Returns:
- a boolean.
- Throws:
EventException- if any.
-
getDocumentItem
Description copied from interface:ModelNodegetDocumentItem.
- Specified by:
getDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.- Returns:
- a
Objectobject.
-
getFullURL
Description copied from interface:ModelNodegetFullURL.
- Specified by:
getFullURLin interfaceModelNode- Parameters:
spec- aStringobject.- Returns:
- a
URLobject. - Throws:
Exception- if any.
-
getParentModelNode
Description copied from interface:ModelNodegetParentModelNode.
- Specified by:
getParentModelNodein interfaceModelNode- Returns:
- a
ModelNodeobject.
-
isEqualOrDescendentOf
Description copied from interface:ModelNodeisEqualOrDescendentOf.
- Specified by:
isEqualOrDescendentOfin interfaceModelNode- Parameters:
otherNode- aModelNodeobject.- Returns:
- a boolean.
-
getRenderState
Description copied from interface:ModelNodegetRenderState.
- Specified by:
getRenderStatein interfaceModelNode
-
setDocumentItem
Description copied from interface:ModelNodeSets a document item. A radio button, for example, can use this to set button group state.- Specified by:
setDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.value- aObjectobject.
-
warn
Description copied from interface:ModelNodewarn.
-