Class DOM2DTMdefaultNamespaceDeclarationNode
- All Implemented Interfaces:
EventTarget
,Attr
,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 TypeMethodDescriptionvoid
addEventListener
(String type, Function listener) addEventListener.void
addEventListener
(String type, Function listener, boolean useCapture) addEventListener.appendChild
(Node a) appendChild.cloneNode.cloneNode
(boolean deep) Returns a copy of node.short
compareDocumentPosition
(Node other) compareDocumentPosition.boolean
Returns true if other is an inclusive descendant of node, and false otherwise.boolean
dispatchEvent
(Event evt) dispatchEvent.boolean
dispatchEvent
(Node element, Event evt) dispatchEvent.getAttributes.Returns node's node document's document base URL.Returns the children.getFeature
(String name, String version) Returns the first child.Returns the last child.getLocalName.getName()
getName.getNamespaceURI.Returns the next sibling.Returns a string appropriate for the type of node.int
Returns the type of node.getNodeValue.Returns the node document.getOwnerElement.Returns the parent element.Returns the parent.getPrefix.Returns the previous sibling.Returns node's root.getCurrentNode.getTextContent.getTypeName.getTypeNamespace.getUserData
(String key) getUserData.getValue()
getValue.boolean
Returns true if element has attributes, and false otherwise.boolean
Returns whether node has children.insertBefore
(Node a, Node b) insertBefore.boolean
isDefaultNamespace
(String namespaceURI) isDefaultNamespace.boolean
isDerivedFrom
(String ns, String localName, int derivationMethod) isDerivedFrom.boolean
isEqualNode
(Node arg) Returns whether node and otherNode have the same properties.boolean
isId()
isId.boolean
Returns true if node is connected and false otherwise.boolean
isSameNode
(Node other) isSameNode.boolean
isSpecified.boolean
isSupported
(String feature, String version) lookupNamespaceURI
(String specifiedPrefix) lookupNamespaceURI.lookupPrefix
(String namespaceURI) lookupPrefix.void
Removes 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.void
removeEventListener
(String type, Function listener) removeEventListener.void
removeEventListener
(String type, Function listener, boolean useCapture) removeEventListener.replaceChild
(Node a, Node b) replaceChild.void
setNodeValue
(String value) setNodeValue.void
setOwnerDocument
(Document document) setOwnerDocument.void
setOwnerElement
(Node element) setOwnerElement.void
setPrefix.void
setTextContent
(String textContent) setTextContent.setUserData
(String key, Object data, UserDataHandler handler) setUserData.void
setValue.
-
Method Details
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeName
in interfaceNode
- Returns:
- a
String
object.
-
getName
getName.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURI
in interfaceAttr
- Specified by:
getNamespaceURI
in interfaceNode
- Returns:
- a
String
object.
-
getPrefix
getPrefix.
-
getLocalName
getLocalName.
- Specified by:
getLocalName
in interfaceAttr
- Specified by:
getLocalName
in interfaceNode
- Returns:
- a
String
object.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValue
in interfaceNode
- Returns:
- a
String
object.
-
getValue
getValue.
-
getOwnerElement
getOwnerElement.
- Specified by:
getOwnerElement
in interfaceAttr
- Returns:
- a
Node
object.
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodes
in interfaceNode
- Returns:
- a boolean.
-
hasAttributes
public boolean hasAttributes()Returns true if element has attributes, and false otherwise.- Specified by:
hasAttributes
in interfaceNode
- Returns:
- a boolean.
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
getParentNode
Returns the parent.- Specified by:
getParentNode
in interfaceNode
- Returns:
- a
Node
object.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChild
in interfaceNode
- Returns:
- a
Node
object.
-
isIsConnected
public boolean isIsConnected()Description copied from interface:Node
Returns true if node is connected and false otherwise.- Specified by:
isIsConnected
in interfaceNode
- Returns:
- a boolean.
-
getLastChild
Returns the last child.- Specified by:
getLastChild
in interfaceNode
- Returns:
- a
Node
object.
-
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getRootNode
Description copied from interface:Node
Returns node's root.- Specified by:
getRootNode
in interfaceNode
- Returns:
- a
Node
object.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSibling
in interfaceNode
- Returns:
- a
Node
object.
-
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:
getChildNodes
in interfaceNode
- Returns:
- a
NodeList
object.
-
getAttributes
getAttributes.
- Specified by:
getAttributes
in interfaceNode
- Returns:
- a
NamedNodeMap
object.
-
getNodeType
public int getNodeType()Returns the type of node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- a
Integer
object.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValue
in interfaceNode
- Parameters:
value
- aString
object.
-
setValue
setValue.
-
setOwnerElement
Description copied from interface:Attr
setOwnerElement.
- Specified by:
setOwnerElement
in interfaceAttr
- Parameters:
element
- aNode
object.
-
setPrefix
setPrefix.
-
insertBefore
insertBefore.
- Specified by:
insertBefore
in interfaceNode
- Parameters:
a
- aNode
object.b
- aNode
object.- Returns:
- a
Node
object.
-
replaceChild
replaceChild.
- Specified by:
replaceChild
in interfaceNode
- Parameters:
a
- aNode
object.b
- aNode
object.- Returns:
- a
Node
object.
-
appendChild
appendChild.
- Specified by:
appendChild
in interfaceNode
- Parameters:
a
- aNode
object.- Returns:
- a
Node
object.
-
prependChild
Description copied from interface:Node
prependChild.
- Specified by:
prependChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prepend
Description copied from interface:Node
prepend.
-
removeChild
removeChild.
- Specified by:
removeChild
in interfaceNode
- Parameters:
a
- aNode
object.- Returns:
- a
Node
object.
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
- a
Document
object.
-
getParentElement
Description copied from interface:Node
Returns the parent element.- Specified by:
getParentElement
in interfaceNode
- Returns:
- a
HTMLElement
object.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
cloneNode
Description copied from interface:Node
cloneNode.
-
setOwnerDocument
Description copied from interface:Node
setOwnerDocument.
- Specified by:
setOwnerDocument
in interfaceNode
- Parameters:
document
- aDocument
object.
-
getTypeName
getTypeName.
- Specified by:
getTypeName
in interfaceTypeInfo
- Returns:
- a
String
object.
-
getTypeNamespace
getTypeNamespace.
- Specified by:
getTypeNamespace
in interfaceTypeInfo
- Returns:
- a
String
object.
-
isDerivedFrom
isDerivedFrom.
- Specified by:
isDerivedFrom
in interfaceTypeInfo
- Returns:
- a
Boolean
object.
-
getSchemaTypeInfo
getCurrentNode.
- Specified by:
getSchemaTypeInfo
in interfaceAttr
- Returns:
- a
TypeInfo
object.
-
isSpecified
public boolean isSpecified()Description copied from interface:Attr
isSpecified.
- Specified by:
isSpecified
in interfaceAttr
- Returns:
- a boolean.
-
isId
public boolean isId()isId.
-
setUserData
setUserData.
- Specified by:
setUserData
in interfaceNode
- Parameters:
key
- aString
object.data
- aObject
object.handler
- aUserDataHandler
object.- Returns:
- a
Object
object.
-
contains
Description copied from interface:Node
Returns true if other is an inclusive descendant of node, and false otherwise. -
getUserData
getUserData.
- Specified by:
getUserData
in interfaceNode
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNode
in interfaceNode
- Parameters:
arg
- aNode
object.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURI
in interfaceNode
- Parameters:
specifiedPrefix
- aString
object.- Returns:
- a
String
object.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespace
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a boolean.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefix
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a
String
object.
-
isSameNode
isSameNode.
- Specified by:
isSameNode
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a boolean.
-
setTextContent
setTextContent.
- Specified by:
setTextContent
in interfaceNode
- Parameters:
textContent
- aString
object.- Throws:
DOMException
-
getTextContent
getTextContent.
- Specified by:
getTextContent
in interfaceNode
- Returns:
- a
String
object. - Throws:
DOMException
-
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPosition
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a short.
- Throws:
DOMException
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURI
in interfaceNode
- Returns:
- a
String
object.
-
addEventListener
Description copied from interface:EventTarget
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
addEventListener
Description copied from interface:EventTarget
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
removeEventListener
Description copied from interface:EventTarget
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
removeEventListener
Description copied from interface:EventTarget
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
dispatchEvent
Description copied from interface:EventTarget
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
element
- aNode
object.evt
- aEvent
object.- Returns:
- a boolean.
-
dispatchEvent
Description copied from interface:EventTarget
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
evt
- aEvent
object.- Returns:
- a boolean.
- Throws:
EventException
- if any.
-