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

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

public class DOMAttr
extends Object
implements Node, Attr, Renamable, Unwrappable

A wrapper for a DOM Attr that can be renamed. Usefull to prevent losing the handler of an attribute 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
DOMAttr(Attr attr)
          Wrap an attribute : changes to this attribute are reflected on the wrapped attribute.
 
Method Summary
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
           
 short compareDocumentPosition(Node other)
           
 boolean equals(Object obj)
           
 NamedNodeMap getAttributes()
           
 String getBaseURI()
           
 NodeList getChildNodes()
           
 Object getFeature(String feature, String version)
           
 Node getFirstChild()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 Element getOwnerElement()
           
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 TypeInfo getSchemaTypeInfo()
           
 boolean getSpecified()
           
 String getTextContent()
           
 Object getUserData(String key)
           
 String getValue()
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 int hashCode()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isDefaultNamespace(String namespaceURI)
           
 boolean isEqualNode(Node arg)
           
 boolean isId()
           
 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 attribute.
 Node replaceChild(Node newChild, Node oldChild)
           
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 void setTextContent(String textContent)
           
 Object setUserData(String key, Object data, UserDataHandler handler)
           
 void setValue(String value)
           
 String toString()
           
 Object unwrap()
          Return the wapped attribute.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMAttr

public DOMAttr(Attr attr)
Wrap an attribute : changes to this attribute are reflected on the wrapped attribute.

Parameters:
attr - The attribute to wrap.
Method Detail

rename

public void rename(QName newName)
Rename this attribute.

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

Specified by:
unwrap in interface Unwrappable
Returns:
The wrapped attribute.
See Also:
Attr, 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:

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:

getName

public String getName()
Specified by:
getName in interface Attr
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:

getOwnerElement

public Element getOwnerElement()
Specified by:
getOwnerElement in interface Attr
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:

getSpecified

public boolean getSpecified()
Specified by:
getSpecified in interface Attr
Returns:

getValue

public String getValue()
Specified by:
getValue in interface Attr
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

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

setValue

public void setValue(String value)
              throws DOMException
Specified by:
setValue in interface Attr
Parameters:
value -
Throws:
DOMException

toString

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

getBaseURI

public String getBaseURI()
Specified by:
getBaseURI in interface Node

getFeature

public Object getFeature(String feature,
                         String version)
Specified by:
getFeature in interface Node

getTextContent

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

getUserData

public Object getUserData(String key)
Specified by:
getUserData in interface Node

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Specified by:
isDefaultNamespace in interface Node

isEqualNode

public boolean isEqualNode(Node arg)
Specified by:
isEqualNode in interface Node

isSameNode

public boolean isSameNode(Node other)
Specified by:
isSameNode in interface Node

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Specified by:
lookupNamespaceURI in interface Node

lookupPrefix

public String lookupPrefix(String namespaceURI)
Specified by:
lookupPrefix in interface Node

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Specified by:
setTextContent in interface Node
Throws:
DOMException

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)
Specified by:
setUserData in interface Node

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Specified by:
compareDocumentPosition in interface Node
Throws:
DOMException

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()
Specified by:
getSchemaTypeInfo in interface Attr

isId

public boolean isId()
Specified by:
isId in interface Attr