|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.plugins.PluginGadgetSpec
public final class PluginGadgetSpec
A gadget spec provided by a plugin.
There are two major categories of plugin gadgets: published gadgets and external gadgets. Published gadgets are gadget specs that are packaged as resources within the plugin. They are served by the Atlassian Gadgets Publisher plugin at a URL of the formhttp://<hostname>[:<port>]/[<context>/]<path/to/gadget/location.xml>
.
The location of published gadgets returned from getLocation()
is a relative path to the gadget spec file
within the plugin.
External gadgets are gadget specs that are hosted on an external web site. Declaring external gadgets within a
plugin makes the application aware of these gadgets, so they can be displayed in a directory of available gadgets,
for example. The location of external gadgets returned from getLocation()
is the absolute URL of the gadget
spec file, beginning with http
or https
. External gadgets served through protocols other than HTTP
are not supported.
Nested Class Summary | |
---|---|
static class |
PluginGadgetSpec.Key
An immutable representation of a unique identifier for plugin gadget specs, composed of a plugin key and resource location path name. |
Constructor Summary | |
---|---|
PluginGadgetSpec(com.atlassian.plugin.Plugin plugin,
String location)
Constructs a new PluginGadgetSpec from the specified plugin and location. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
InputStream |
getInputStream()
Returns the spec resource as an input stream, for processing |
PluginGadgetSpec.Key |
getKey()
Returns a unique identifier for this spec |
String |
getLocation()
If isHostedExternally() returns true, this method returns the absolute URL of the gadget spec file,
beginning with http or https. |
int |
hashCode()
|
boolean |
isHostedExternally()
Returns true if this spec is hosted externally (meaning it is not part of a plugin served by the Gadgets Publisher plugin), false otherwise |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PluginGadgetSpec(com.atlassian.plugin.Plugin plugin, String location)
PluginGadgetSpec
from the specified plugin and location.
plugin
- the plugin that contains this gadget spec. Must not be null
, or a NullPointerException
will be thrown.location
- the location of the plugin. Must not be null
, or a NullPointerException
will be
thrown.
NullPointerException
- if any argument is null
Method Detail |
---|
public PluginGadgetSpec.Key getKey()
public String getLocation()
isHostedExternally()
returns true, this method returns the absolute URL of the gadget spec file,
beginning with http or https. If isHostedExternally()
returns false, this method returns a relative
location -- the path of the spec file within its plugin.
public InputStream getInputStream()
public boolean isHostedExternally()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |