public class

WebResourceModuleDescriptor

extends AbstractModuleDescriptor<T>
implements ConditionalDescriptor
java.lang.Object
   ↳ com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
     ↳ com.atlassian.plugin.webresource.WebResourceModuleDescriptor

Class Overview

A way of linking to web 'resources', such as javascript or css. This allows us to include resources once on any given page, as well as ensuring that plugins can declare resources, even if they are included at the bottom of a page.

Summary

[Expand]
Inherited Fields
From class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
Public Constructors
WebResourceModuleDescriptor(HostContainer hostContainer)
Public Methods
void disabled()
Disables the module descriptor.
void enabled()
Enables the descriptor by loading the module class.
Condition getCondition()
Set<String> getContexts()
Returns the web resource contexts this resource is associated with.
List<String> getDependencies()
Returns a list of dependencies on other web resources.
Void getModule()
As this descriptor just handles resources, you should never call this
List<WebResourceTransformation> getTransformations()
void init(Plugin plugin, Element element)
Initialise a module given it's parent plugin and the XML element representing the module.
boolean isDisableMinification()
boolean shouldDisplay()
[Expand]
Inherited Methods
From class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
From class java.lang.Object
From interface com.atlassian.plugin.ModuleDescriptor
From interface com.atlassian.plugin.Resourced
From interface com.atlassian.plugin.StateAware
From interface com.atlassian.plugin.web.descriptors.ConditionalDescriptor

Public Constructors

public WebResourceModuleDescriptor (HostContainer hostContainer)

Public Methods

public void disabled ()

Disables the module descriptor. Classes overriding this method MUST call super.disabled() after their own disabling code.

public void enabled ()

Enables the descriptor by loading the module class. Classes overriding this method MUST call super.enabled() before their own enabling code.

public Condition getCondition ()

Returns
  • The condition to determine if it should be displayed or not

public Set<String> getContexts ()

Returns the web resource contexts this resource is associated with.

Returns
  • the web resource contexts this resource is associated with.

public List<String> getDependencies ()

Returns a list of dependencies on other web resources.

Returns
  • a list of module complete keys

public Void getModule ()

As this descriptor just handles resources, you should never call this

Returns
  • The module object created by this plugin.

public List<WebResourceTransformation> getTransformations ()

public void init (Plugin plugin, Element element)

Initialise a module given it's parent plugin and the XML element representing the module.

Since atlassian-plugins v2.2, you can no longer load classes from the plugin in this method, because the OSGi bundle that they will live in is not built yet. Load classes in the enabled() method instead.

Parameters
plugin The plugin that the module belongs to. Must not be null.
element XML element representing the module. Must not be null.

public boolean isDisableMinification ()

Returns
  • true if resource minification should be skipped, false otherwise.

public boolean shouldDisplay ()

Returns
  • True if this web resource should be displayed based on the optional condition