EAF 7.6 Util

org.enhydra.xml
Class AttrImpl

java.lang.Object
  extended by org.enhydra.xml.NodeImpl
      extended by org.enhydra.xml.AttrImpl
All Implemented Interfaces:
org.w3c.dom.Attr, org.w3c.dom.Node, org.w3c.dom.NodeList

public class AttrImpl
extends NodeImpl
implements org.w3c.dom.Attr

Version:
1.0
Author:
Tweety A class representing a node in a meta-data tree, which implements the

Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.


Field Summary
 
Fields inherited from class org.enhydra.xml.NodeImpl
firstChild, lastChild, nextSibling, nodeName, nodeValue, numChildren, ownerDocument, parent, previousSibling, type
 
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
 
Constructor Summary
AttrImpl(org.w3c.dom.Attr attr)
          Constructs a AttrImpl from the given node.
AttrImpl(org.w3c.dom.Element owner, java.lang.String name, java.lang.String value)
          Constructs an empty AttrImpl.
 
Method Summary
 short compareDocumentPosition(org.w3c.dom.Node arg0)
           
 java.lang.String getBaseURI()
           
 java.lang.Object getFeature(java.lang.String arg0, java.lang.String arg1)
           
 java.lang.String getName()
          Returns the attribute name associated with this node.
 java.lang.String getNamespaceURI()
           
 java.lang.String getNodeName()
          Returns the name associated with this node.
 short getNodeType()
          Returns the node type.
 java.lang.String getNodeValue()
          Returns the value associated with this node.
 org.w3c.dom.Element getOwnerElement()
          Returns the owner of this attribute.
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
           
 boolean getSpecified()
          If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false.
 java.lang.String getTextContent()
           
 java.lang.Object getUserData(java.lang.String arg0)
           
 java.lang.String getValue()
          Returns the value associated with this attributes.
 boolean isDefaultNamespace(java.lang.String arg0)
           
 boolean isEqualNode(org.w3c.dom.Node arg0)
           
 boolean isId()
           
 boolean isSameNode(org.w3c.dom.Node arg0)
           
 java.lang.String lookupNamespaceURI(java.lang.String arg0)
           
 java.lang.String lookupPrefix(java.lang.String arg0)
           
 void setNodeValue(java.lang.String value)
          Sets the value of this node to the given one.
 void setTextContent(java.lang.String arg0)
           
 java.lang.Object setUserData(java.lang.String arg0, java.lang.Object arg1, org.w3c.dom.UserDataHandler arg2)
           
 void setValue(java.lang.String value)
          Sets the value of this attribute to the given one.
 
Methods inherited from class org.enhydra.xml.NodeImpl
appendChild, beginToString, cloneNode, endToString, getAttributes, getChildNodes, getFirstChild, getLastChild, getLength, getLocalName, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, initNodeImplChildren, insertBefore, isSupported, item, newCommentInstance, newDefaultInstance, newElementInstance, newTextInstance, normalize, removeChild, replaceChild, setPrefix, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix
 

Constructor Detail

AttrImpl

public AttrImpl(org.w3c.dom.Element owner,
                java.lang.String name,
                java.lang.String value)
Constructs an empty AttrImpl.

Parameters:
owner - document owner.
name - node name.
value - node value.

AttrImpl

public AttrImpl(org.w3c.dom.Attr attr)
Constructs a AttrImpl from the given node.

Parameters:
node, - as a AttrImpl.
Method Detail

getName

public java.lang.String getName()
Returns the attribute name associated with this node.

Specified by:
getName in interface org.w3c.dom.Attr
Returns:
the attribute name, as a String.

getNodeName

public java.lang.String getNodeName()
Returns the name associated with this node.

Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class NodeImpl
Returns:
the name, as a String.

getNodeType

public short getNodeType()
Returns the node type.

Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class NodeImpl
Returns:
the ATTRIBUTE_NODE node type.

getSpecified

public boolean getSpecified()
If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false. Note that the implementation is in charge of this attribute, not the user. If the user changes the value of the attribute (even if it ends up having the same value as the default value) then the specified flag is automatically flipped to true. To re-specify the attribute as the default value from the DTD, the user must delete the attribute. The implementation will then make a new attribute available with specified set to false and the default value (if one exists).
In summary: If the attribute has an assigned value in the document then specified is true, and the value is the assigned value.If the attribute has no assigned value in the document and has a default value in the DTD, then specified is false, and the value is the default value in the DTD.If the attribute has no assigned value in the document and has a value of #IMPLIED in the DTD, then the attribute does not appear in the structure model of the document.If the ownerElement attribute is null (i.e. because it was just created or was set to null by the various removal and cloning operations) specified is true. Retuns always true.

Specified by:
getSpecified in interface org.w3c.dom.Attr

getValue

public java.lang.String getValue()
Returns the value associated with this attributes.

Specified by:
getValue in interface org.w3c.dom.Attr
Returns:
the node attributes, as a String.

getNodeValue

public java.lang.String getNodeValue()
Returns the value associated with this node.

Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class NodeImpl
Returns:
the node value, as a String.

setValue

public void setValue(java.lang.String value)
Sets the value of this attribute to the given one.

Specified by:
setValue in interface org.w3c.dom.Attr
Parameters:
value - the new attribute value, as a String.

setNodeValue

public void setNodeValue(java.lang.String value)
Sets the value of this node to the given one.

Specified by:
setNodeValue in interface org.w3c.dom.Node
Overrides:
setNodeValue in class NodeImpl
Parameters:
value - new node value, as a String.

getOwnerElement

public org.w3c.dom.Element getOwnerElement()
Returns the owner of this attribute.

Specified by:
getOwnerElement in interface org.w3c.dom.Attr
Returns:
the attribute owner node.

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()
Specified by:
getSchemaTypeInfo in interface org.w3c.dom.Attr

isId

public boolean isId()
Specified by:
isId in interface org.w3c.dom.Attr

getNamespaceURI

public java.lang.String getNamespaceURI()
Specified by:
getNamespaceURI in interface org.w3c.dom.Node
Overrides:
getNamespaceURI in class NodeImpl

getBaseURI

public java.lang.String getBaseURI()
Specified by:
getBaseURI in interface org.w3c.dom.Node
Overrides:
getBaseURI in class NodeImpl

compareDocumentPosition

public short compareDocumentPosition(org.w3c.dom.Node arg0)
                              throws org.w3c.dom.DOMException
Specified by:
compareDocumentPosition in interface org.w3c.dom.Node
Overrides:
compareDocumentPosition in class NodeImpl
Throws:
org.w3c.dom.DOMException

getTextContent

public java.lang.String getTextContent()
                                throws org.w3c.dom.DOMException
Specified by:
getTextContent in interface org.w3c.dom.Node
Overrides:
getTextContent in class NodeImpl
Throws:
org.w3c.dom.DOMException

setTextContent

public void setTextContent(java.lang.String arg0)
                    throws org.w3c.dom.DOMException
Specified by:
setTextContent in interface org.w3c.dom.Node
Overrides:
setTextContent in class NodeImpl
Throws:
org.w3c.dom.DOMException

isSameNode

public boolean isSameNode(org.w3c.dom.Node arg0)
Specified by:
isSameNode in interface org.w3c.dom.Node
Overrides:
isSameNode in class NodeImpl

lookupPrefix

public java.lang.String lookupPrefix(java.lang.String arg0)
Specified by:
lookupPrefix in interface org.w3c.dom.Node
Overrides:
lookupPrefix in class NodeImpl

isDefaultNamespace

public boolean isDefaultNamespace(java.lang.String arg0)
Specified by:
isDefaultNamespace in interface org.w3c.dom.Node
Overrides:
isDefaultNamespace in class NodeImpl

lookupNamespaceURI

public java.lang.String lookupNamespaceURI(java.lang.String arg0)
Specified by:
lookupNamespaceURI in interface org.w3c.dom.Node
Overrides:
lookupNamespaceURI in class NodeImpl

isEqualNode

public boolean isEqualNode(org.w3c.dom.Node arg0)
Specified by:
isEqualNode in interface org.w3c.dom.Node
Overrides:
isEqualNode in class NodeImpl

getFeature

public java.lang.Object getFeature(java.lang.String arg0,
                                   java.lang.String arg1)
Specified by:
getFeature in interface org.w3c.dom.Node
Overrides:
getFeature in class NodeImpl

setUserData

public java.lang.Object setUserData(java.lang.String arg0,
                                    java.lang.Object arg1,
                                    org.w3c.dom.UserDataHandler arg2)
Specified by:
setUserData in interface org.w3c.dom.Node
Overrides:
setUserData in class NodeImpl

getUserData

public java.lang.Object getUserData(java.lang.String arg0)
Specified by:
getUserData in interface org.w3c.dom.Node
Overrides:
getUserData in class NodeImpl

EAF 7.6 Util