Class Element

    • Method Detail

      • asText

        public String asText()
        Return a text representation of the element, descending into its children.
      • getMessageMLTag

        public String getMessageMLTag()
        Return the element's MessageML tag.
      • getAttributes

        public Map<String,​String> getAttributes()
        Return a map of the element's attributes.
      • getAttribute

        public String getAttribute​(String attr)
        Return the value of the element's attribute "attr".
      • getChildren

        public List<Element> getChildren()
        Return a list of the element's children.
      • getChild

        public Element getChild​(int n)
        Return the nth child of the element.
      • addChild

        public void addChild​(Element child)
        Append a child to the element.
      • size

        public int size()
        Return the number of children of the element.
      • getParent

        public Element getParent()
        Return the parent of the element.
      • getFormat

        public FormatEnum getFormat()
        Return the format (MessageML or PresentationML) of the element.
      • findElements

        public List<Element> findElements​(Class<?> type)
        Search the MessageML tree (depth-first) for elements of a given type.
        Parameters:
        type - the class of elements to find
        Returns:
        found elements
      • findElements

        public List<Element> findElements​(String tag)
        Search the MessageML tree (depth-first) for elements with a given MessageML tag.
        Parameters:
        tag - the MessageML tag of elements to find
        Returns:
        found elements
      • findElements

        public List<Element> findElements​(String attribute,
                                          String value)
        Search the MessageML tree (depth-first) for elements with a given attribute-value pair.
        Parameters:
        attribute - the attribute name match
        value - the attribute value to match
        Returns:
        found elements