Class XMLDocuNode

  • All Implemented Interfaces:
    java.lang.Iterable<XMLDocuNode>

    public class XMLDocuNode
    extends java.lang.Object
    implements java.lang.Iterable<XMLDocuNode>
    This class represents one node in the structured documentation.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLDocuNode​(java.lang.String name)
      Creates a new XMLDocuNode with the specified name.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addChildNode​(XMLDocuNode node)
      Adds a new child node.
      java.lang.String getAttribute​(java.lang.String attributeName)  
      java.util.Map<java.lang.String,​java.lang.String> getAttributes()
      Returns a Map of all attribute names and values which are defined for this element.
      int getChildCount()
      Returns the number of Child elements.
      java.lang.String getNodeName()
      Returns the name of this node.
      java.lang.String getValue()
      Returns the value of this node or an empty String if not set.
      boolean hasChildNodes()  
      java.util.Iterator<XMLDocuNode> iterator()
      Iterator which returns all child nodes.
      void removeAttribute​(java.lang.String name)
      Removes Attribute from node.
      void removeAttribute​(java.lang.String name, java.lang.String value)
      Deprecated.
      call the method without value because it is ignored
      void removeChildNodes()
      Removes all child nodes.
      void setAttribute​(java.lang.String name, java.lang.String value)
      Sets the value of an attribute.
      void setValue​(java.lang.String value)
      Sets the value of this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • XMLDocuNode

        public XMLDocuNode​(java.lang.String name)
        Creates a new XMLDocuNode with the specified name.
        Parameters:
        name - Name of the node in the tree
    • Method Detail

      • getAttribute

        public java.lang.String getAttribute​(java.lang.String attributeName)
        Parameters:
        attributeName - Name of the attribute
        Returns:
        Returns the value of the specified attribtue or an empty String if the attribute was not found
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Returns a Map of all attribute names and values which are defined for this element.
        Returns:
        Map of attributes
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.String value)
        Sets the value of an attribute.
        Parameters:
        name - Name
        value - Value
      • removeAttribute

        @Deprecated
        public void removeAttribute​(java.lang.String name,
                                    java.lang.String value)
        Deprecated.
        call the method without value because it is ignored
        Removes Attribute from node.
        Parameters:
        name - Attribute Name
        value - Attribute Value
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Removes Attribute from node.
        Parameters:
        name - Attribute Name
      • getChildCount

        public int getChildCount()
        Returns the number of Child elements.
        Returns:
        Count
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value of this node.
        Parameters:
        value - Node value
      • getNodeName

        public java.lang.String getNodeName()
        Returns the name of this node.
        Returns:
        Node Name
      • getValue

        public java.lang.String getValue()
        Returns the value of this node or an empty String if not set.
        Returns:
        Value
      • addChildNode

        public void addChildNode​(XMLDocuNode node)
        Adds a new child node.
        Parameters:
        node - Child Node
      • hasChildNodes

        public boolean hasChildNodes()
        Returns:
        true if this node has child nodes
      • removeChildNodes

        public void removeChildNodes()
        Removes all child nodes.
      • iterator

        public java.util.Iterator<XMLDocuNode> iterator()
        Iterator which returns all child nodes.
        Specified by:
        iterator in interface java.lang.Iterable<XMLDocuNode>
        Returns:
        Child nodes