Package com.atlassian.plugin.module
Interface Element
- All Known Implementing Classes:
Dom4jDelegatingElement
public interface Element
This represents a given element in the atlassian-plugin.xml. This interface replaces the
Element used
in ModuleDescriptor.-
Method Summary
Modifier and TypeMethodDescriptionattributeValue(String key) Returns the value for an attribute based on the provided key.attributeValue(String key, String defaultValue) Returns the value for an attribute based on the provided key.Returns the first element which matches the given nameelements()Returns all elements which matches the given nameelementTextTrim(String name) getName()getText()
-
Method Details
-
attributeValue
Returns the value for an attribute based on the provided key.- Parameters:
key- that maps to the value to be returned.- Returns:
- the value associated to the provided key.
-
attributeValue
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.- 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
Returns the first element which matches the given name- Parameters:
name- as specified in atlassian-plugins.xml for a given element.- Returns:
- the first element with a matching name (case-sensitive), or null.
-
elements
Returns all elements which matches the given name- 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
String getTextTrim()- 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
- 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
String getText()- Returns:
- the text for the current element. This method does not return null if the text is unknown, but instead an empty String.
-
getName
String getName()- Returns:
- the name for this element. This is the local name of the element.
-
elements
- Returns:
- all elements contained within this element, if no elements contained within this element will this return an empty list.
-
attributeNames
- 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.
-