public class

Resources

extends Object
implements Resourced
java.lang.Object
   ↳ com.atlassian.plugin.Resources

Class Overview

An aggregate of all resource descriptors within the given plugin module or plugin.

See Also
  • com.atlassian.plugin.impl.AbstractPlugin#resources
  • resources

Summary

Nested Classes
class Resources.TypeFilter  
Fields
public static final Resources EMPTY_RESOURCES
Public Constructors
Resources(Iterable<ResourceDescriptor> resourceDescriptors)
Create a resource object with the given resource descriptors.
Public Methods
static Resources fromXml(Element element)
Parses the resource descriptors from the provided plugin XML element and creates a Resources object containing them.
ResourceDescriptor getResourceDescriptor(String type, String name)
Get a ResourceDescriptor of a particular type and name.
@Deprecated List<ResourceDescriptor> getResourceDescriptors(String type)
* @deprecated since 2.5.0 use getResourceDescriptors() and filter as required
List<ResourceDescriptor> getResourceDescriptors()
Get a List of all the descriptors .
ResourceLocation getResourceLocation(String type, String name)
Get a ResourceLocation of a particular type and name.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.Resourced

Fields

public static final Resources EMPTY_RESOURCES

Public Constructors

public Resources (Iterable<ResourceDescriptor> resourceDescriptors)

Create a resource object with the given resource descriptors. The provided list must not be null.

Parameters
resourceDescriptors the descriptors which are part of this resources object
Throws
IllegalArgumentException if the resourceDescriptors list is null

Public Methods

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

public ResourceDescriptor getResourceDescriptor (String type, String name)

Get a ResourceDescriptor of a particular type and name.

Returns
  • the specified resource descriptor if found, null otherwise.

@Deprecated public List<ResourceDescriptor> getResourceDescriptors (String type)

* @deprecated since 2.5.0 use getResourceDescriptors() and filter as required

Returns
  • all resource descriptors this object supports.

public List<ResourceDescriptor> getResourceDescriptors ()

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.

Returns
  • all resource descriptors this object supports.

public ResourceLocation getResourceLocation (String type, String name)

Get a ResourceLocation of a particular type and name.

Returns
  • the specified resource location if found, null otherwise.