org.apache.axis2.om.impl.dom
Class AttrImpl

java.lang.Object
  extended byorg.apache.axis2.om.impl.dom.NodeImpl
      extended byorg.apache.axis2.om.impl.dom.AttrImpl
All Implemented Interfaces:
org.w3c.dom.Attr, org.w3c.dom.Node, org.w3c.dom.NodeList, OMAttribute, OMNode, OMNodeEx

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

Implementation of org.w3c.dom.Attr and org.apache.axis2.om.OMAttribute

Author:
Ruchith Fernando (ruchith.fernando@gmail.com)

Field Summary
protected  ParentNode parent
          Owner of this attribute
 
Fields inherited from class org.apache.axis2.om.impl.dom.NodeImpl
builder, done, FIRSTCHILD, flags, nodeType, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axis2.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Constructor Summary
protected AttrImpl(DocumentImpl ownerDocument)
           
  AttrImpl(DocumentImpl ownerDocument, java.lang.String name)
           
  AttrImpl(DocumentImpl ownerDocument, java.lang.String localName, OMNamespace namespace)
           
  AttrImpl(DocumentImpl ownerDocument, java.lang.String localName, OMNamespace ns, java.lang.String value)
           
  AttrImpl(DocumentImpl ownerDocument, java.lang.String name, java.lang.String value)
           
  AttrImpl(java.lang.String localName, OMNamespace ns, java.lang.String value)
           
  AttrImpl(java.lang.String name, java.lang.String value)
           
 
Method Summary
 org.w3c.dom.Node cloneNode(boolean deep)
           
 OMNode detach()
          Not supported: Cannot detach attributes Use the operations available in the owner node
 void discard()
          Not supported: Cannot discard attributes Use the operations available in the owner node
 java.lang.String getAttributeValue()
          Returns the attribute value
 java.lang.String getLocalName()
          Returns the attribute name
 java.lang.String getName()
           
 OMNamespace getNamespace()
          Returns the namespace of the attribute as an OMNamespace
 java.lang.String getNamespaceURI()
          Retuns the namespace URI of this attr node
 java.lang.String getNodeName()
          Returns the name of this attribute
 short getNodeType()
          Returns the node type
 java.lang.String getNodeValue()
          returns the value of this attribute
 org.w3c.dom.Element getOwnerElement()
          Returns the owner element
 OMContainer getParent()
          Returns the parent node of this attribute
 java.lang.String getPrefix()
          Returns the namespace prefix of this attr node
 javax.xml.namespace.QName getQName()
          Returns a qname representing the attribute
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
           
 boolean getSpecified()
           
 int getType()
          Returns the type of this Attr node
 java.lang.String getValue()
          returns the value of this attribute
 boolean isId()
           
protected  boolean isUsed()
           
 void serialize(OMOutputImpl omOutput)
          This is not supported since attributes serialization is handled by the serialization of the owner nodes
 void serializeAndConsume(OMOutputImpl omOutput)
          This is not supported since attributes serialization is handled by the serialization of the owner nodes
 void setAttributeValue(java.lang.String value)
          Sets the attribute value
 void setLocalName(java.lang.String localName)
          Sets the attribute name
 void setOMNamespace(OMNamespace omNamespace)
          Sets the namespace of this attribute node
 void setParent(OMContainer element)
          Sets the parent element to the given OMContainer
 void setType(int nodeType)
          Sets the type NOT IMPLEMENTED: Unnecessary
protected  void setUsed(boolean used)
           
 void setValue(java.lang.String value)
          Sets the value of the attribute
 
Methods inherited from class org.apache.axis2.om.impl.dom.NodeImpl
appendChild, build, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLength, getNextOMSibling, getNextSibling, getOwnerDocument, getParentNode, getPreviousOMSibling, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, insertSiblingAfter, insertSiblingBefore, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeWithCache, setComplete, setNextOMSibling, setNodeValue, setOwnerDocument, setPrefix, setPreviousOMSibling, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

parent

protected ParentNode parent
Owner of this attribute

Constructor Detail

AttrImpl

protected AttrImpl(DocumentImpl ownerDocument)

AttrImpl

public AttrImpl(DocumentImpl ownerDocument,
                java.lang.String localName,
                OMNamespace ns,
                java.lang.String value)

AttrImpl

public AttrImpl(DocumentImpl ownerDocument,
                java.lang.String name,
                java.lang.String value)

AttrImpl

public AttrImpl(DocumentImpl ownerDocument,
                java.lang.String name)

AttrImpl

public AttrImpl(DocumentImpl ownerDocument,
                java.lang.String localName,
                OMNamespace namespace)

AttrImpl

public AttrImpl(java.lang.String localName,
                OMNamespace ns,
                java.lang.String value)

AttrImpl

public AttrImpl(java.lang.String name,
                java.lang.String value)
Method Detail

getNodeName

public java.lang.String getNodeName()
Returns the name of this attribute

Specified by:
getNodeName in interface org.w3c.dom.Node

getNodeType

public short getNodeType()
Returns the node type

Specified by:
getNodeType in interface org.w3c.dom.Node
See Also:
Node.getNodeType()

getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
returns the value of this attribute

Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class NodeImpl
Throws:
org.w3c.dom.DOMException
See Also:
Node.getNodeValue()

getValue

public java.lang.String getValue()
returns the value of this attribute

Specified by:
getValue in interface org.w3c.dom.Attr
See Also:
Attr.getValue()

getName

public java.lang.String getName()
Specified by:
getName in interface org.w3c.dom.Attr

getOwnerElement

public org.w3c.dom.Element getOwnerElement()
Returns the owner element

Specified by:
getOwnerElement in interface org.w3c.dom.Attr
See Also:
Attr.getOwnerElement()

getSpecified

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

detach

public OMNode detach()
              throws OMException
Not supported: Cannot detach attributes Use the operations available in the owner node

Specified by:
detach in interface OMNode
Overrides:
detach in class NodeImpl
Throws:
OMException
See Also:
OMNode.detach()

discard

public void discard()
             throws OMException
Not supported: Cannot discard attributes Use the operations available in the owner node

Specified by:
discard in interface OMNode
Throws:
OMException
See Also:
OMNode.discard()

getType

public int getType()
Returns the type of this Attr node

Specified by:
getType in interface OMNode
Returns:
One of OMNode.ELEMENT_NODE, OMNode.TEXT_NODE, OMNode.CDATA_SECTION_NODE, OMNode.COMMENT_NODE, OMNode.DTD_NODE, OMNode.PI_NODE, OMNode.ENTITY_REFERENCE_NODE, OMNode.SPACE_NODE, or OMNode.TEXT_NODE.
See Also:
OMNode.getType()

serialize

public void serialize(OMOutputImpl omOutput)
               throws javax.xml.stream.XMLStreamException
This is not supported since attributes serialization is handled by the serialization of the owner nodes

Specified by:
serialize in interface OMNodeEx
Parameters:
omOutput -
Throws:
javax.xml.stream.XMLStreamException
See Also:
org.apache.axis2.om.OMNode#serialize(org.apache.axis2.om.impl.OMOutputImpl)

serializeAndConsume

public void serializeAndConsume(OMOutputImpl omOutput)
                         throws javax.xml.stream.XMLStreamException
This is not supported since attributes serialization is handled by the serialization of the owner nodes

Specified by:
serializeAndConsume in interface OMNodeEx
Parameters:
omOutput -
Throws:
javax.xml.stream.XMLStreamException
See Also:
org.apache.axis2.om.OMNode#serializeAndConsume(org.apache.axis2.om.impl.OMOutputImpl)

getNamespace

public OMNamespace getNamespace()
Returns the namespace of the attribute as an OMNamespace

Specified by:
getNamespace in interface OMAttribute
Returns:
OMNamespace
See Also:
OMAttribute.getNamespace()

getQName

public javax.xml.namespace.QName getQName()
Returns a qname representing the attribute

Specified by:
getQName in interface OMAttribute
Returns:
javax.xml.namespace.QName
See Also:
OMAttribute.getQName()

getAttributeValue

public java.lang.String getAttributeValue()
Returns the attribute value

Specified by:
getAttributeValue in interface OMAttribute
Returns:
See Also:
OMAttribute.getAttributeValue()

setLocalName

public void setLocalName(java.lang.String localName)
Sets the attribute name

Specified by:
setLocalName in interface OMAttribute
Parameters:
localName -
See Also:
OMAttribute.setLocalName(java.lang.String)

setOMNamespace

public void setOMNamespace(OMNamespace omNamespace)
Sets the namespace of this attribute node

Specified by:
setOMNamespace in interface OMAttribute
Parameters:
omNamespace -
See Also:
OMAttribute.setOMNamespace(org.apache.axis2.om.OMNamespace)

setAttributeValue

public void setAttributeValue(java.lang.String value)
Sets the attribute value

Specified by:
setAttributeValue in interface OMAttribute
Parameters:
value -
See Also:
OMAttribute.setAttributeValue(java.lang.String)

setParent

public void setParent(OMContainer element)
Sets the parent element to the given OMContainer

Specified by:
setParent in interface OMNodeEx
See Also:
OMNodeEx.setParent(org.apache.axis2.om.OMContainer)

setType

public void setType(int nodeType)
             throws OMException
Sets the type NOT IMPLEMENTED: Unnecessary

Specified by:
setType in interface OMNodeEx
Throws:
OMException
See Also:
OMNodeEx.setType(int)

isUsed

protected boolean isUsed()
Returns:
Returns the used.

setUsed

protected void setUsed(boolean used)
Parameters:
used - The used to set.

setValue

public void setValue(java.lang.String value)
              throws org.w3c.dom.DOMException
Sets the value of the attribute

Specified by:
setValue in interface org.w3c.dom.Attr
Throws:
org.w3c.dom.DOMException
See Also:
Attr.setValue(java.lang.String)

getParent

public OMContainer getParent()
Returns the parent node of this attribute

Specified by:
getParent in interface OMNode
Overrides:
getParent in class NodeImpl
See Also:
OMNode.getParent()

getLocalName

public java.lang.String getLocalName()
Returns the attribute name

Specified by:
getLocalName in interface OMAttribute
Overrides:
getLocalName in class NodeImpl
See Also:
Node.getLocalName()

getNamespaceURI

public java.lang.String getNamespaceURI()
Retuns the namespace URI of this attr node

Specified by:
getNamespaceURI in interface org.w3c.dom.Node
Overrides:
getNamespaceURI in class NodeImpl
See Also:
Node.getNamespaceURI()

getPrefix

public java.lang.String getPrefix()
Returns the namespace prefix of this attr node

Specified by:
getPrefix in interface org.w3c.dom.Node
Overrides:
getPrefix in class NodeImpl
See Also:
Node.getPrefix()

cloneNode

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

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()

isId

public boolean isId()