|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.plugins.PluginInformation
public class PluginInformation
Encapsulate general information about a plugin. This information is available without the need of loading any class from the plugin jar file.
Field Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
attr
|
java.lang.String |
author
|
java.lang.String |
className
|
java.lang.String |
description
|
java.lang.String |
downloadlink
|
boolean |
early
|
private static javax.swing.ImageIcon |
emptyIcon
|
java.io.File |
file
|
javax.swing.ImageIcon |
icon
|
java.lang.String |
iconPath
|
java.util.List<java.net.URL> |
libraries
|
java.lang.String |
link
|
int |
localmainversion
|
java.lang.String |
localversion
|
int |
mainversion
|
java.lang.String |
name
|
boolean |
oldmode
|
java.lang.String |
requires
|
int |
stage
|
java.lang.String |
version
|
Constructor Summary | |
---|---|
PluginInformation(java.io.File file)
Creates a plugin information object by reading the plugin information from the manifest in the plugin jar. |
|
PluginInformation(java.io.File file,
java.lang.String name)
Creates a plugin information object for the plugin with name name . |
|
PluginInformation(java.io.InputStream manifestStream,
java.lang.String name,
java.lang.String url)
Creates a plugin information object by reading plugin information in Manifest format from the input stream manifestStream . |
Method Summary | |
---|---|
static java.net.URL |
fileToURL(java.io.File f)
|
static PluginInformation |
findPlugin(java.lang.String pluginName)
Try to find a plugin after some criterias. |
java.lang.String |
getDescriptionAsHtml()
Replies the description as HTML document, including a link to a web page with more information, provided such a link is available. |
java.lang.String |
getName()
Replies the name of the plugin |
static java.util.Collection<java.lang.String> |
getPluginLocations()
|
javax.swing.ImageIcon |
getScaledIcon()
|
boolean |
isUpdateRequired()
Replies true if this this plugin should be updated/downloaded because either it is not available locally (its local version is null) or its local version is older than the available version on the server. |
boolean |
isUpdateRequired(java.lang.String referenceVersion)
Replies true if the plugin with the given information is most likely outdated with respect to the referenceVersion. |
PluginProxy |
load(java.lang.Class<?> klass)
Load and instantiate the plugin |
java.lang.Class<?> |
loadClass(java.lang.ClassLoader classLoader)
Load the class of the plugin |
boolean |
matches(java.lang.String filter)
Replies true if either the name, the description, or the version match (case insensitive) one of the words in filter. |
protected boolean |
matches(java.lang.String filter,
java.lang.String value)
|
private void |
scanManifest(java.util.jar.Manifest manifest,
boolean oldcheck)
|
void |
setName(java.lang.String name)
Sets the name |
void |
updateFromPluginSite(PluginInformation other)
Updates the plugin information of this plugin information object with the plugin information in a plugin information object retrieved from a plugin update site. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.io.File file
public java.lang.String name
public int mainversion
public int localmainversion
public java.lang.String className
public boolean oldmode
public java.lang.String requires
public java.lang.String link
public java.lang.String description
public boolean early
public java.lang.String author
public int stage
public java.lang.String version
public java.lang.String localversion
public java.lang.String downloadlink
public java.lang.String iconPath
public javax.swing.ImageIcon icon
public java.util.List<java.net.URL> libraries
public final java.util.Map<java.lang.String,java.lang.String> attr
private static final javax.swing.ImageIcon emptyIcon
Constructor Detail |
---|
public PluginInformation(java.io.File file) throws PluginException
file
- the plugin jar file
PluginException
- if reading the manifest failspublic PluginInformation(java.io.File file, java.lang.String name) throws PluginException
name
.
Information about the plugin is extracted from the maifest file in the plugin jar
file
.
file
- the plugin jarname
- the plugin name
PluginException
- thrown if reading the manifest file failspublic PluginInformation(java.io.InputStream manifestStream, java.lang.String name, java.lang.String url) throws PluginException
manifestStream
.
manifestStream
- the stream to read the manifest fromname
- the plugin nameurl
- the download URL for the plugin
PluginException
- thrown if the plugin information can't be read from the input streamMethod Detail |
---|
public void updateFromPluginSite(PluginInformation other)
other
- the plugin information object retrieved from the update
siteprivate void scanManifest(java.util.jar.Manifest manifest, boolean oldcheck)
public java.lang.String getDescriptionAsHtml()
public PluginProxy load(java.lang.Class<?> klass) throws PluginException
the
- plugin class
PluginException
public java.lang.Class<?> loadClass(java.lang.ClassLoader classLoader) throws PluginException
classLoader
- the class loader to use
PluginException
public static java.net.URL fileToURL(java.io.File f)
public static PluginInformation findPlugin(java.lang.String pluginName) throws PluginException
pluginName
- The name of the plugin (in all lowercase). E.g. "lang-de"
null
, if the plugin
was nowhere to be found.
PluginException
- In case of broken plugins.public static java.util.Collection<java.lang.String> getPluginLocations()
public boolean isUpdateRequired(java.lang.String referenceVersion)
referenceVersion
- the reference version. Can be null if we don't know a
reference version
public boolean isUpdateRequired()
protected boolean matches(java.lang.String filter, java.lang.String value)
public boolean matches(java.lang.String filter)
filter
- the filter expression
public java.lang.String getName()
public void setName(java.lang.String name)
name
- public javax.swing.ImageIcon getScaledIcon()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |