org.inria.ns.reflex.xml.dom
Class DOMProcessingInstruction

java.lang.Object
  extended by org.inria.ns.reflex.xml.dom.DOMProcessingInstruction
All Implemented Interfaces:
Renamable, Unwrappable, Node, ProcessingInstruction

public class DOMProcessingInstruction
extends Object
implements Node, ProcessingInstruction, Renamable, Unwrappable

A wrapper for a DOM ProcessingInstruction that can be renamed. Usefull to prevent losing the handler of a processing instruction after renaming it.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.structures.Unwrappable
Unwrappable.Unwrapper
 
Field Summary
 
Fields 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
 
Fields inherited from interface org.inria.ns.reflex.structures.Unwrappable
UNWRAPPER
 
Constructor Summary
DOMProcessingInstruction(ProcessingInstruction pi)
          Wrap a processing instruction : changes to this processing instruction are reflected on the wrapped processing instruction.
 
Method Summary
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
           
 short compareDocumentPosition(Node other)
           
 boolean equals(Object obj)
           
 NamedNodeMap getAttributes()
           
 String getBaseURI()
           
 NodeList getChildNodes()
           
 String getData()
           
 Object getFeature(String feature, String version)
           
 Node getFirstChild()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 String getTarget()
           
 String getTextContent()
           
 Object getUserData(String key)
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 int hashCode()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isDefaultNamespace(String namespaceURI)
           
 boolean isEqualNode(Node arg)
           
 boolean isSameNode(Node other)
           
 boolean isSupported(String feature, String version)
           
 String lookupNamespaceURI(String prefix)
           
 String lookupPrefix(String namespaceURI)
           
 void normalize()
           
 Node removeChild(Node oldChild)
           
 void rename(QName newName)
          Rename this node.
 Node replaceChild(Node newChild, Node oldChild)
           
 void setData(String data)
           
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 void setTextContent(String textContent)
           
 Object setUserData(String key, Object data, UserDataHandler handler)
           
 String toString()
           
 Object unwrap()
          Return the wapped processing instruction.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMProcessingInstruction

public DOMProcessingInstruction(ProcessingInstruction pi)
Wrap a processing instruction : changes to this processing instruction are reflected on the wrapped processing instruction.

Parameters:
pi - The processing instruction to wrap.
Method Detail

rename

public void rename(QName newName)
Rename this node.

Specified by:
rename in interface Renamable
Parameters:
newName - The new name of this node.
See Also:
Renamable.rename(org.inria.ns.reflex.xml.QName)

unwrap

public Object unwrap()
Return the wapped processing instruction.

Specified by:
unwrap in interface Unwrappable
Returns:
The wrapped processing instruction.
See Also:
ProcessingInstruction, Unwrappable.unwrap()

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Parameters:
newChild -
Returns:
Throws:
DOMException

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
Parameters:
deep -
Returns:

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node
Returns:

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node
Returns:

getData

public String getData()
Specified by:
getData in interface ProcessingInstruction
Returns:

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node
Returns:

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node
Returns:

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface Node
Returns:

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface Node
Returns:

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node
Returns:

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node
Returns:

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node
Returns:

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Returns:
Throws:
DOMException

getOwnerDocument

public Document getOwnerDocument()
Specified by:
getOwnerDocument in interface Node
Returns:

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node
Returns:

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface Node
Returns:

getPreviousSibling

public Node getPreviousSibling()
Specified by:
getPreviousSibling in interface Node
Returns:

getTarget

public String getTarget()
Specified by:
getTarget in interface ProcessingInstruction
Returns:

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface Node
Returns:

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Specified by:
insertBefore in interface Node
Parameters:
newChild -
refChild -
Returns:
Throws:
DOMException

isSupported

public boolean isSupported(String feature,
                           String version)
Specified by:
isSupported in interface Node
Parameters:
feature -
version -
Returns:

normalize

public void normalize()
Specified by:
normalize in interface Node

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Parameters:
oldChild -
Returns:
Throws:
DOMException

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Parameters:
newChild -
oldChild -
Returns:
Throws:
DOMException

setData

public void setData(String data)
             throws DOMException
Specified by:
setData in interface ProcessingInstruction
Parameters:
data -
Throws:
DOMException

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Parameters:
nodeValue -
Throws:
DOMException

setPrefix

public void setPrefix(String prefix)
               throws DOMException
Specified by:
setPrefix in interface Node
Parameters:
prefix -
Throws:
DOMException

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Specified by:
compareDocumentPosition in interface Node
Parameters:
other -
Returns:
Throws:
DOMException
See Also:
Node.compareDocumentPosition(org.w3c.dom.Node)

getBaseURI

public String getBaseURI()
Specified by:
getBaseURI in interface Node
Returns:
See Also:
Node.getBaseURI()

getFeature

public Object getFeature(String feature,
                         String version)
Specified by:
getFeature in interface Node
Parameters:
feature -
version -
Returns:
See Also:
Node.getFeature(java.lang.String, java.lang.String)

getTextContent

public String getTextContent()
                      throws DOMException
Specified by:
getTextContent in interface Node
Returns:
Throws:
DOMException
See Also:
Node.getTextContent()

getUserData

public Object getUserData(String key)
Specified by:
getUserData in interface Node
Parameters:
key -
Returns:
See Also:
Node.getUserData(java.lang.String)

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Specified by:
isDefaultNamespace in interface Node
Parameters:
namespaceURI -
Returns:
See Also:
Node.isDefaultNamespace(java.lang.String)

isEqualNode

public boolean isEqualNode(Node arg)
Specified by:
isEqualNode in interface Node
Parameters:
arg -
Returns:
See Also:
Node.isEqualNode(org.w3c.dom.Node)

isSameNode

public boolean isSameNode(Node other)
Specified by:
isSameNode in interface Node
Parameters:
other -
Returns:
See Also:
Node.isSameNode(org.w3c.dom.Node)

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Specified by:
lookupNamespaceURI in interface Node
Parameters:
prefix -
Returns:
See Also:
Node.lookupNamespaceURI(java.lang.String)

lookupPrefix

public String lookupPrefix(String namespaceURI)
Specified by:
lookupPrefix in interface Node
Parameters:
namespaceURI -
Returns:
See Also:
Node.lookupPrefix(java.lang.String)

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Specified by:
setTextContent in interface Node
Parameters:
textContent -
Throws:
DOMException
See Also:
Node.setTextContent(java.lang.String)

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)
Specified by:
setUserData in interface Node
Parameters:
key -
data -
handler -
Returns:
See Also:
Node.setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler)