Class Dom4jDelegatingElement

java.lang.Object
com.atlassian.plugin.internal.module.Dom4jDelegatingElement
All Implemented Interfaces:
Element

public class Dom4jDelegatingElement extends Object implements Element
This class is provided as a migration path and should not be depended upon directly as will not be provided in the public API as of atlassian plugins 8.0.0.
  • Constructor Details

    • Dom4jDelegatingElement

      public Dom4jDelegatingElement(org.dom4j.Element dom4jElement)
      Not for external use, we cannot guarantee the version of dom4j that will be provided. External Plugin developers should not have a dependency on this Constructor. Using this can lead to unintended breaking changes for external plugin developers.
  • Method Details

    • attributeValue

      public String attributeValue(String key)
      Description copied from interface: Element
      Returns the value for an attribute based on the provided key.
      Specified by:
      attributeValue in interface Element
      Parameters:
      key - that maps to the value to be returned.
      Returns:
      the value associated to the provided key.
    • attributeValue

      public String attributeValue(String key, String defaultValue)
      Description copied from interface: Element
      Returns the value for an attribute based on the provided key. If the value that would be returned is null, then returns the default value instead.
      Specified by:
      attributeValue in interface Element
      Parameters:
      key - that maps to the value to be returned.
      defaultValue - to be returned if the value mapped to the provided key is null.
      Returns:
      the attribute mapped to the provided key or the defualtValue provided.
    • element

      public Element element(String element)
      Description copied from interface: Element
      Returns the first element which matches the given name
      Specified by:
      element in interface Element
      Parameters:
      element - as specified in atlassian-plugins.xml for a given element.
      Returns:
      the first element with a matching name (case-sensitive), or null.
    • elements

      public List<Element> elements(String name)
      Description copied from interface: Element
      Returns all elements which matches the given name
      Specified by:
      elements in interface Element
      Parameters:
      name - as specified in atlassian-plugins.xml for a given element.
      Returns:
      the all elements with a matching name (case-sensitive), or an empty list.
    • getTextTrim

      public String getTextTrim()
      Specified by:
      getTextTrim in interface Element
      Returns:
      the text for the current element where whitespace is trimmed and normalised into single spaces. This method does not return null if the text is unknown, but instead an empty String.
    • elementTextTrim

      public String elementTextTrim(String name)
      Specified by:
      elementTextTrim in interface Element
      Parameters:
      name - of the element in which the text trim will be provided from.
      Returns:
      the text for the element whose name matches the provided name. Where whitespace is trimmed and normalised into single spaces. This method returns null if the text is unknown.
    • getText

      public String getText()
      Specified by:
      getText in interface Element
      Returns:
      the text for the current element. This method does not return null if the text is unknown, but instead an empty String.
    • getName

      public String getName()
      Specified by:
      getName in interface Element
      Returns:
      the name for this element. This is the local name of the element.
    • elements

      public List<Element> elements()
      Specified by:
      elements in interface Element
      Returns:
      all elements contained within this element, if no elements contained within this element will this return an empty list.
    • attributeNames

      public List<String> attributeNames()
      Specified by:
      attributeNames in interface Element
      Returns:
      all attribute names contained by this element as a list. If no attributes are in the contained element then this will return an empty list.
    • getDelegate

      public org.dom4j.Element getDelegate()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object