com.atlassian.plugin
Class Resources

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

public class Resources
extends java.lang.Object
implements Resourced

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

See Also:
AbstractPlugin.resources, AbstractModuleDescriptor.resources

Field Summary
static Resources EMPTY_RESOURCES
           
 
Constructor Summary
Resources(java.util.List resourceDescriptors)
          Create a resource object with the given resource descriptors.
 
Method Summary
static Resources fromXml(org.dom4j.Element element)
          Parses the resource descriptors from the provided plugin XML element and creates a Resources object containing them.
 ResourceDescriptor getResourceDescriptor(java.lang.String type, java.lang.String name)
          Deprecated.  
 java.util.List getResourceDescriptors()
           
 java.util.List getResourceDescriptors(java.lang.String type)
           
 ResourceLocation getResourceLocation(java.lang.String type, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_RESOURCES

public static final Resources EMPTY_RESOURCES
Constructor Detail

Resources

public Resources(java.util.List resourceDescriptors)
          throws java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException - if the resourceDescriptors list is null
Method Detail

fromXml

public static Resources fromXml(org.dom4j.Element element)
                         throws PluginParseException,
                                java.lang.IllegalArgumentException
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
java.lang.IllegalArgumentException - if the provided element is null

getResourceDescriptors

public java.util.List getResourceDescriptors()
Specified by:
getResourceDescriptors in interface Resourced

getResourceDescriptors

public java.util.List getResourceDescriptors(java.lang.String type)
Specified by:
getResourceDescriptors in interface Resourced

getResourceLocation

public ResourceLocation getResourceLocation(java.lang.String type,
                                            java.lang.String name)
Specified by:
getResourceLocation in interface Resourced

getResourceDescriptor

public ResourceDescriptor getResourceDescriptor(java.lang.String type,
                                                java.lang.String name)
Deprecated. 

Specified by:
getResourceDescriptor in interface Resourced


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.