Class DOM2DTMdefaultNamespaceDeclarationNode

java.lang.Object
org.loboevolution.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode
All Implemented Interfaces:
EventTarget, Attr, Node, TypeInfo

public class DOM2DTMdefaultNamespaceDeclarationNode extends Object implements Attr, TypeInfo
This is a kluge to let us shove a declaration for xml: into the DOM2DTM model. Basically, it creates a proxy node in DOM space to carry the additional information. This is _NOT_ a full DOM implementation, and shouldn't be one since it sits alongside the DOM rather than becoming part of the DOM model.

(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.

  • Method Details

    • getNodeName

      public String getNodeName()
      Returns a string appropriate for the type of node.
      Specified by:
      getNodeName in interface Node
      Returns:
      a String object.
    • getName

      public String getName()

      getName.

      Specified by:
      getName in interface Attr
      Returns:
      a String object.
    • getNamespaceURI

      public String getNamespaceURI()

      getNamespaceURI.

      Specified by:
      getNamespaceURI in interface Attr
      Specified by:
      getNamespaceURI in interface Node
      Returns:
      a String object.
    • getPrefix

      public String getPrefix()

      getPrefix.

      Specified by:
      getPrefix in interface Attr
      Specified by:
      getPrefix in interface Node
      Returns:
      a String object.
    • getLocalName

      public String getLocalName()

      getLocalName.

      Specified by:
      getLocalName in interface Attr
      Specified by:
      getLocalName in interface Node
      Returns:
      a String object.
    • getNodeValue

      public String getNodeValue()

      getNodeValue.

      Specified by:
      getNodeValue in interface Node
      Returns:
      a String object.
    • getValue

      public String getValue()

      getValue.

      Specified by:
      getValue in interface Attr
      Returns:
      a String object.
    • getOwnerElement

      public Element getOwnerElement()

      getOwnerElement.

      Specified by:
      getOwnerElement in interface Attr
      Returns:
      a Node object.
    • isSupported

      public boolean isSupported(String feature, String version)
      Specified by:
      isSupported in interface Node
    • hasChildNodes

      public boolean hasChildNodes()
      Returns whether node has children.
      Specified by:
      hasChildNodes in interface Node
      Returns:
      a boolean.
    • hasAttributes

      public boolean hasAttributes()
      Returns true if element has attributes, and false otherwise.
      Specified by:
      hasAttributes in interface Node
      Returns:
      a boolean.
    • getFeature

      public Node getFeature(String name, String version)
      Specified by:
      getFeature in interface Node
    • getParentNode

      public Node getParentNode()
      Returns the parent.
      Specified by:
      getParentNode in interface Node
      Returns:
      a Node object.
    • getFirstChild

      public Node getFirstChild()
      Returns the first child.
      Specified by:
      getFirstChild in interface Node
      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 interface Node
      Returns:
      a boolean.
    • getLastChild

      public Node getLastChild()
      Returns the last child.
      Specified by:
      getLastChild in interface Node
      Returns:
      a Node object.
    • getPreviousSibling

      public Node getPreviousSibling()
      Returns the previous sibling.
      Specified by:
      getPreviousSibling in interface Node
      Returns:
      a Node object.
    • getRootNode

      public Node getRootNode()
      Description copied from interface: Node
      Returns node's root.
      Specified by:
      getRootNode in interface Node
      Returns:
      a Node object.
    • getNextSibling

      public Node getNextSibling()
      Returns the next sibling.
      Specified by:
      getNextSibling in interface Node
      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.
      Specified by:
      normalize in interface Node
    • getChildNodes

      public NodeList getChildNodes()
      Returns the children.
      Specified by:
      getChildNodes in interface Node
      Returns:
      a NodeList object.
    • getAttributes

      public NamedNodeMap getAttributes()

      getAttributes.

      Specified by:
      getAttributes in interface Node
      Returns:
      a NamedNodeMap object.
    • getNodeType

      public int getNodeType()
      Returns the type of node.
      Specified by:
      getNodeType in interface Node
      Returns:
      a Integer object.
    • setNodeValue

      public void setNodeValue(String value)

      setNodeValue.

      Specified by:
      setNodeValue in interface Node
      Parameters:
      value - a String object.
    • setValue

      public void setValue(String value)

      setValue.

      Specified by:
      setValue in interface Attr
      Parameters:
      value - a String object.
    • setOwnerElement

      public void setOwnerElement(Node element)
      Description copied from interface: Attr

      setOwnerElement.

      Specified by:
      setOwnerElement in interface Attr
      Parameters:
      element - a Node object.
    • setPrefix

      public void setPrefix(String value)

      setPrefix.

      Specified by:
      setPrefix in interface Node
      Parameters:
      value - a String object.
    • insertBefore

      public Node insertBefore(Node a, Node b)

      insertBefore.

      Specified by:
      insertBefore in interface Node
      Parameters:
      a - a Node object.
      b - a Node object.
      Returns:
      a Node object.
    • replaceChild

      public Node replaceChild(Node a, Node b)

      replaceChild.

      Specified by:
      replaceChild in interface Node
      Parameters:
      a - a Node object.
      b - a Node object.
      Returns:
      a Node object.
    • appendChild

      public Node appendChild(Node a)

      appendChild.

      Specified by:
      appendChild in interface Node
      Parameters:
      a - a Node object.
      Returns:
      a Node object.
    • prependChild

      public Node prependChild(Node newChild)
      Description copied from interface: Node

      prependChild.

      Specified by:
      prependChild in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • prepend

      public Node prepend(Node newChild)
      Description copied from interface: Node

      prepend.

      Specified by:
      prepend in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • removeChild

      public Node removeChild(Node a)

      removeChild.

      Specified by:
      removeChild in interface Node
      Parameters:
      a - a Node object.
      Returns:
      a Node object.
    • getOwnerDocument

      public Document getOwnerDocument()
      Returns the node document. Returns null for documents.
      Specified by:
      getOwnerDocument in interface Node
      Returns:
      a Document object.
    • getParentElement

      public HTMLElement getParentElement()
      Description copied from interface: Node
      Returns the parent element.
      Specified by:
      getParentElement in interface Node
      Returns:
      a HTMLElement object.
    • cloneNode

      public Node cloneNode(boolean deep)
      Returns a copy of node. If deep is true, the copy also includes the node's descendants.
      Specified by:
      cloneNode in interface Node
      Parameters:
      deep - a boolean.
      Returns:
      a Node object.
    • cloneNode

      public Node cloneNode()
      Description copied from interface: Node

      cloneNode.

      Specified by:
      cloneNode in interface Node
      Returns:
      a Node object.
    • setOwnerDocument

      public void setOwnerDocument(Document document)
      Description copied from interface: Node

      setOwnerDocument.

      Specified by:
      setOwnerDocument in interface Node
      Parameters:
      document - a Document object.
    • getTypeName

      public String getTypeName()

      getTypeName.

      Specified by:
      getTypeName in interface TypeInfo
      Returns:
      a String object.
    • getTypeNamespace

      public String getTypeNamespace()

      getTypeNamespace.

      Specified by:
      getTypeNamespace in interface TypeInfo
      Returns:
      a String object.
    • isDerivedFrom

      public boolean isDerivedFrom(String ns, String localName, int derivationMethod)

      isDerivedFrom.

      Specified by:
      isDerivedFrom in interface TypeInfo
      Returns:
      a Boolean object.
    • getSchemaTypeInfo

      public TypeInfo getSchemaTypeInfo()

      getCurrentNode.

      Specified by:
      getSchemaTypeInfo in interface Attr
      Returns:
      a TypeInfo object.
    • isSpecified

      public boolean isSpecified()
      Description copied from interface: Attr

      isSpecified.

      Specified by:
      isSpecified in interface Attr
      Returns:
      a boolean.
    • isId

      public boolean isId()

      isId.

      Specified by:
      isId in interface Attr
      Returns:
      a boolean.
    • setUserData

      public Object setUserData(String key, Object data, UserDataHandler handler)

      setUserData.

      Specified by:
      setUserData in interface Node
      Parameters:
      key - a String object.
      data - a Object object.
      handler - a UserDataHandler object.
      Returns:
      a Object object.
    • contains

      public boolean contains(Node other)
      Description copied from interface: Node
      Returns true if other is an inclusive descendant of node, and false otherwise.
      Specified by:
      contains in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • getUserData

      public Object getUserData(String key)

      getUserData.

      Specified by:
      getUserData in interface Node
      Parameters:
      key - a String object.
      Returns:
      a Object object.
    • isEqualNode

      public boolean isEqualNode(Node arg)
      Returns whether node and otherNode have the same properties.
      Specified by:
      isEqualNode in interface Node
      Parameters:
      arg - a Node object.
      Returns:
      a boolean.
    • lookupNamespaceURI

      public String lookupNamespaceURI(String specifiedPrefix)

      lookupNamespaceURI.

      Specified by:
      lookupNamespaceURI in interface Node
      Parameters:
      specifiedPrefix - a String object.
      Returns:
      a String object.
    • isDefaultNamespace

      public boolean isDefaultNamespace(String namespaceURI)

      isDefaultNamespace.

      Specified by:
      isDefaultNamespace in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a boolean.
    • lookupPrefix

      public String lookupPrefix(String namespaceURI)

      lookupPrefix.

      Specified by:
      lookupPrefix in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a String object.
    • isSameNode

      public boolean isSameNode(Node other)

      isSameNode.

      Specified by:
      isSameNode in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • setTextContent

      public void setTextContent(String textContent) throws DOMException

      setTextContent.

      Specified by:
      setTextContent in interface Node
      Parameters:
      textContent - a String object.
      Throws:
      DOMException
    • getTextContent

      public String getTextContent() throws DOMException

      getTextContent.

      Specified by:
      getTextContent in interface Node
      Returns:
      a String object.
      Throws:
      DOMException
    • compareDocumentPosition

      public short compareDocumentPosition(Node other) throws DOMException

      compareDocumentPosition.

      Specified by:
      compareDocumentPosition in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a short.
      Throws:
      DOMException
    • getBaseURI

      public String getBaseURI()
      Returns node's node document's document base URL.
      Specified by:
      getBaseURI in interface Node
      Returns:
      a String object.
    • addEventListener

      public void addEventListener(String type, Function listener)
      Description copied from interface: EventTarget

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • addEventListener

      public void addEventListener(String type, Function listener, boolean useCapture)
      Description copied from interface: EventTarget

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • removeEventListener

      public void removeEventListener(String type, Function listener)
      Description copied from interface: EventTarget

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • removeEventListener

      public void removeEventListener(String type, Function listener, boolean useCapture)
      Description copied from interface: EventTarget

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Node element, Event evt)
      Description copied from interface: EventTarget

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      element - a Node object.
      evt - a Event object.
      Returns:
      a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Event evt) throws EventException
      Description copied from interface: EventTarget

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      evt - a Event object.
      Returns:
      a boolean.
      Throws:
      EventException - if any.