FileDocCategorySizeDatePackage
AttributeNode.javaAPI DocExample4456Sat Sep 01 15:56:52 BST 2001javaxml2

AttributeNode

public class AttributeNode extends Object implements JDOMNode
Decorator for an Attribute. This class is a Strategy for a {@link JDOMNode} to implement with attributes.

Fields Summary
protected org.jdom.Attribute
decorated
The decorated attribute
Constructors Summary
public AttributeNode(org.jdom.Attribute attribute)

Constructor for the decorated attribute.

param
attribute Attribute to decorate

        this.decorated = attribute;
    
Methods Summary
public java.lang.ObjectgetNode()

This returns the decorated attribute.

return
Object - the decorated object.

        return decorated;
    
public java.lang.StringgetNodeName()

This returns the name of the node.

return
String - name of the node.

        if (decorated != null) {
            return decorated.getName();
        }
        return "";
    
public JDOMNodegetParentNode()

This returns the parent of the node, as a {@link JDOMNode}.

return
JDOMNode - this node's parent.

        if (decorated.getParent() != null) {
            return new ElementNode(decorated.getParent());
        }
        return null;
    
public java.lang.StringgetQName()

This returns the qualified name of this Node.

return
String - this node's qualified name

        if (decorated.getNamespacePrefix().equals("")) { 
            return decorated.getName();
        } else {
            return new StringBuffer(decorated.getNamespacePrefix())
                           .append(":")
                           .append(decorated.getName()).toString();
        }
    
public java.util.Iteratoriterator()

This always returns an empty Iterator.

return
Iterator - always empty

        return Collections.EMPTY_LIST.iterator();
    
public java.lang.StringtoString()

This is the base attribute's {@link Attribute#toString()} call.

return
String - description of attribute.

        return decorated.toString();