net.beandocument
Class BeanAttribute

java.lang.Object
  extended bynet.beandocument.BeanBaseNode
      extended bynet.beandocument.BeanAttribute
All Implemented Interfaces:
org.w3c.dom.Attr, org.w3c.dom.Node

public class BeanAttribute
extends BeanBaseNode
implements org.w3c.dom.Attr

Implementation for attributes in bean context

Author:
Jens Scheffler

Field Summary
 
Fields inherited from class net.beandocument.BeanBaseNode
owner, parent
 
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
 
Constructor Summary
protected BeanAttribute(BeanDocument owner, BeanBaseNode parent, java.lang.String name, java.lang.String value)
          Constructs a new Attribute based on the given object
 
Method Summary
 org.w3c.dom.NamedNodeMap getAttributes()
          Retrieves the attributes of the node.
 org.w3c.dom.NodeList getChildNodes()
          Retrieves the list of child nodes, which is an empty list in this case.
 org.w3c.dom.Node getFirstChild()
          Retrieves the first child, which is (of course) not existing here.
 org.w3c.dom.Node getLastChild()
          Retrieves the last child, which is (of course) not existing here.
 java.lang.String getLocalName()
          Retrieves the local attribute name which corresponds with the attribute name itself
 java.lang.String getName()
          Retrieves attribute name
 java.lang.String getNodeName()
          Retrieves the name of the node, which corresponds with the attribute name
 short getNodeType()
          Retrieves the node type of the attribute, will always return a constant value
 java.lang.String getNodeValue()
          Retrieves the node value which corresponds with the attribute value
 org.w3c.dom.Element getOwnerElement()
          Gets the parent element where this attribute belongs to
 boolean getSpecified()
          Returns flag if this attribute was specified or generate implicit
 java.lang.String getValue()
          Retrieves the value of the attribute
 boolean hasAttributes()
          Returns always false
 boolean hasChildNodes()
          Returns always false
 void setValue(java.lang.String value)
          NOTE: This function is not implemented and therefore will just throw an exception!
 
Methods inherited from class net.beandocument.BeanBaseNode
appendChild, cloneNode, getElementFactory, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, insertBefore, isSupported, normalize, removeChild, replaceChild, setNextSibling, setNodeValue, setPrefix, setPreviousSibling
 
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, cloneNode, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

BeanAttribute

protected BeanAttribute(BeanDocument owner,
                        BeanBaseNode parent,
                        java.lang.String name,
                        java.lang.String value)
Constructs a new Attribute based on the given object

Parameters:
owner - Owner document of this element
parent - Parent element of the new element
name - tag name of the new element
value - Value bean to use for tag content
Method Detail

getSpecified

public boolean getSpecified()
Returns flag if this attribute was specified or generate implicit

Specified by:
getSpecified in interface org.w3c.dom.Attr
Returns:
always true in this implementation
See Also:
Attr.getSpecified()

getName

public java.lang.String getName()
Retrieves attribute name

Specified by:
getName in interface org.w3c.dom.Attr
Returns:
Name of the Attribute
See Also:
Attr.getName()

getValue

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

Specified by:
getValue in interface org.w3c.dom.Attr
Returns:
Value of the attribute
See Also:
Attr.getValue()

setValue

public void setValue(java.lang.String value)
              throws org.w3c.dom.DOMException
NOTE: This function is not implemented and therefore will just throw an exception!

Specified by:
setValue in interface org.w3c.dom.Attr
Parameters:
value - New value to set - ignored by this implementation
Throws:
org.w3c.dom.DOMException - If method is called
See Also:
Attr.setValue(java.lang.String)

getOwnerElement

public org.w3c.dom.Element getOwnerElement()
Gets the parent element where this attribute belongs to

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

getNodeType

public short getNodeType()
Retrieves the node type of the attribute, will always return a constant value

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

hasAttributes

public boolean hasAttributes()
Returns always false

Specified by:
hasAttributes in interface org.w3c.dom.Node
Returns:
false value
See Also:
Node.hasAttributes()

hasChildNodes

public boolean hasChildNodes()
Returns always false

Specified by:
hasChildNodes in interface org.w3c.dom.Node
Returns:
false value
See Also:
Node.hasChildNodes()

getLocalName

public java.lang.String getLocalName()
Retrieves the local attribute name which corresponds with the attribute name itself

Specified by:
getLocalName in interface org.w3c.dom.Node
Returns:
attribute local name
See Also:
Node.getLocalName()

getNodeName

public java.lang.String getNodeName()
Retrieves the name of the node, which corresponds with the attribute name

Specified by:
getNodeName in interface org.w3c.dom.Node
Returns:
attribute name
See Also:
Node.getNodeName()

getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
Retrieves the node value which corresponds with the attribute value

Specified by:
getNodeValue in interface org.w3c.dom.Node
Returns:
Attribute value
Throws:
org.w3c.dom.DOMException - (never throws this exception)
See Also:
Node.getNodeValue()

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()
Retrieves the attributes of the node. Since the attribute node itself has no attributes, returns null.

Specified by:
getAttributes in interface org.w3c.dom.Node
Returns:
null value
See Also:
Node.getAttributes()

getFirstChild

public org.w3c.dom.Node getFirstChild()
Retrieves the first child, which is (of course) not existing here.

Specified by:
getFirstChild in interface org.w3c.dom.Node
Returns:
null value
See Also:
Node.getFirstChild()

getLastChild

public org.w3c.dom.Node getLastChild()
Retrieves the last child, which is (of course) not existing here.

Specified by:
getLastChild in interface org.w3c.dom.Node
Returns:
null value
See Also:
Node.getLastChild()

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Retrieves the list of child nodes, which is an empty list in this case.

Specified by:
getChildNodes in interface org.w3c.dom.Node
Returns:
empty list of nodes
See Also:
Node.getChildNodes()