Class Resources

java.lang.Object
com.atlassian.plugin.Resources
All Implemented Interfaces:
Resourced

public class Resources extends Object implements Resourced
An aggregate of all resource descriptors within the given plugin module or plugin.

See resources in com.atlassian.plugin.impl.AbstractPlugin See resources in com.atlassian.plugin.descriptors.AbstractModuleDescriptor

  • Field Details

    • EMPTY_RESOURCES

      public static final Resources EMPTY_RESOURCES
  • Method Details

    • fromXml

      public static Resources fromXml(Element element)
      Parses the resource descriptors from the provided plugin XML element and creates a Resources object containing them.

      If the module or plugin contains no resource elements, an empty Resources object will be returned. This method will not return null.

      Parameters:
      element - the plugin or plugin module XML fragment which should not be null
      Returns:
      a Resources object representing the resources in the plugin or plugin module
      Throws:
      PluginParseException - if there are two resources with the same name and type in this element, or another parse error occurs
      IllegalArgumentException - if the provided element is null
    • getResourceDescriptors

      public List<ResourceDescriptor> getResourceDescriptors()
      Description copied from interface: Resourced
      Get a List of all the descriptors .

      Note: since 2.2 this list must be immutable, previously modifying this list could modify the underlying list.

      Specified by:
      getResourceDescriptors in interface Resourced
      Returns:
      all resource descriptors this object supports.
    • getResourceLocation

      public ResourceLocation getResourceLocation(String type, String name)
      Description copied from interface: Resourced
      Get a ResourceLocation of a particular type and name.
      Specified by:
      getResourceLocation in interface Resourced
      Returns:
      the specified resource location if found, null otherwise.
    • getResourceDescriptor

      public ResourceDescriptor getResourceDescriptor(String type, String name)
      Description copied from interface: Resourced
      Get a ResourceDescriptor of a particular type and name.
      Specified by:
      getResourceDescriptor in interface Resourced
      Returns:
      the specified resource descriptor if found, null otherwise.