Class XmlElement


  • public class XmlElement
    extends java.lang.Object
    An xml element within an xml tree. In this case an xml element can have a text content OR a multiple amount of children. The xml element itself has a name.
    Author:
    Tim Roes
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlElement​(java.lang.String name)
      Create a new xml element with the given name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChildren​(XmlElement element)
      Add a child to this xml element.
      void setContent​(java.lang.String content)
      Set the content of this xml tag.
      java.lang.String toString()
      Return a string representation of this xml element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XmlElement

        public XmlElement​(java.lang.String name)
        Create a new xml element with the given name.
        Parameters:
        name - The name of the xml element.
    • Method Detail

      • addChildren

        public void addChildren​(XmlElement element)
        Add a child to this xml element.
        Parameters:
        element - The child to add.
      • setContent

        public void setContent​(java.lang.String content)
        Set the content of this xml tag. If the content is set the children won't be used in a string representation.
        Parameters:
        content - Content of the xml element.
      • toString

        public java.lang.String toString()
        Return a string representation of this xml element.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of xml element.