public class MockPlugin extends Object implements com.atlassian.plugin.Plugin
Constructor and Description |
---|
MockPlugin() |
MockPlugin(String key) |
MockPlugin(String name,
String key,
com.atlassian.plugin.PluginInformation pluginInformation) |
MockPlugin(String name,
String key,
com.atlassian.plugin.PluginInformation pluginInformation,
com.atlassian.plugin.PluginState pluginState) |
Modifier and Type | Method and Description |
---|---|
void |
addModuleDescriptor(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor) |
void |
addResourceDescriptor(com.atlassian.plugin.elements.ResourceDescriptor resourceDescriptor) |
MockPlugin |
addResourceDescriptor(com.atlassian.plugin.elements.ResourceDescriptor resourceDescriptor,
String contents)
Add resource descriptor and corresponding contents that will be returned by
getResourceAsStream(String) . |
int |
compareTo(com.atlassian.plugin.Plugin o) |
boolean |
containsSystemModule() |
com.atlassian.plugin.elements.ResourceDescriptor |
createHelpResource(String name,
String location) |
com.atlassian.plugin.elements.ResourceDescriptor |
createI18nResource(String name,
String location) |
void |
disable() |
void |
enable() |
Set<String> |
getActivePermissions() |
ClassLoader |
getClassLoader() |
Date |
getDateEnabled() |
Date |
getDateEnabling() |
Date |
getDateInstalled() |
Date |
getDateLoaded() |
com.atlassian.plugin.PluginDependencies |
getDependencies() |
String |
getI18nNameKey() |
com.atlassian.plugin.InstallationMode |
getInstallationMode() |
String |
getKey() |
com.atlassian.plugin.ModuleDescriptor<?> |
getModuleDescriptor(String key) |
Collection<com.atlassian.plugin.ModuleDescriptor<?>> |
getModuleDescriptors() |
<M> List<com.atlassian.plugin.ModuleDescriptor<M>> |
getModuleDescriptorsByModuleClass(Class<M> moduleClass) |
String |
getName() |
com.atlassian.plugin.PluginArtifact |
getPluginArtifact() |
com.atlassian.plugin.PluginInformation |
getPluginInformation() |
com.atlassian.plugin.PluginState |
getPluginState() |
int |
getPluginsVersion() |
URL |
getResource(String path) |
InputStream |
getResourceAsStream(String name) |
com.atlassian.plugin.elements.ResourceDescriptor |
getResourceDescriptor(String type,
String name) |
List<com.atlassian.plugin.elements.ResourceDescriptor> |
getResourceDescriptors() |
com.atlassian.plugin.elements.ResourceLocation |
getResourceLocation(String type,
String name) |
boolean |
hasAllPermissions() |
void |
install() |
boolean |
isBundledPlugin() |
boolean |
isDeleteable() |
boolean |
isDynamicallyLoaded() |
boolean |
isEnabledByDefault() |
boolean |
isSystemPlugin() |
boolean |
isUninstallable() |
<T> Class<T> |
loadClass(String clazz,
Class<?> callingClass) |
void |
resolve() |
MockPlugin |
resource(String name,
String value) |
MockPlugin |
setClassLoader(ClassLoader loader) |
void |
setEnabledByDefault(boolean enabledByDefault) |
void |
setI18nNameKey(String i18nNameKey) |
void |
setKey(String key) |
void |
setName(String name) |
void |
setPluginInformation(com.atlassian.plugin.PluginInformation pluginInformation) |
void |
setPluginsVersion(int version) |
void |
setResources(com.atlassian.plugin.Resourced resources) |
void |
setSystemPlugin(boolean system) |
String |
toString() |
void |
uninstall() |
public MockPlugin()
public MockPlugin(String key)
public MockPlugin(String name, String key, com.atlassian.plugin.PluginInformation pluginInformation, com.atlassian.plugin.PluginState pluginState)
public int getPluginsVersion()
getPluginsVersion
in interface com.atlassian.plugin.Plugin
public void setPluginsVersion(int version)
setPluginsVersion
in interface com.atlassian.plugin.Plugin
public String getName()
getName
in interface com.atlassian.plugin.Plugin
public void setName(String name)
setName
in interface com.atlassian.plugin.Plugin
public String getI18nNameKey()
getI18nNameKey
in interface com.atlassian.plugin.Plugin
public void setI18nNameKey(String i18nNameKey)
setI18nNameKey
in interface com.atlassian.plugin.Plugin
public String getKey()
getKey
in interface com.atlassian.plugin.Plugin
public void setKey(String key)
setKey
in interface com.atlassian.plugin.Plugin
public void addModuleDescriptor(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor)
addModuleDescriptor
in interface com.atlassian.plugin.Plugin
public Collection<com.atlassian.plugin.ModuleDescriptor<?>> getModuleDescriptors()
getModuleDescriptors
in interface com.atlassian.plugin.Plugin
public com.atlassian.plugin.ModuleDescriptor<?> getModuleDescriptor(String key)
getModuleDescriptor
in interface com.atlassian.plugin.Plugin
public <M> List<com.atlassian.plugin.ModuleDescriptor<M>> getModuleDescriptorsByModuleClass(Class<M> moduleClass)
getModuleDescriptorsByModuleClass
in interface com.atlassian.plugin.Plugin
public com.atlassian.plugin.InstallationMode getInstallationMode()
getInstallationMode
in interface com.atlassian.plugin.Plugin
public boolean isEnabledByDefault()
isEnabledByDefault
in interface com.atlassian.plugin.Plugin
public void setEnabledByDefault(boolean enabledByDefault)
setEnabledByDefault
in interface com.atlassian.plugin.Plugin
public com.atlassian.plugin.PluginInformation getPluginInformation()
getPluginInformation
in interface com.atlassian.plugin.Plugin
public void setPluginInformation(com.atlassian.plugin.PluginInformation pluginInformation)
setPluginInformation
in interface com.atlassian.plugin.Plugin
public void setResources(com.atlassian.plugin.Resourced resources)
setResources
in interface com.atlassian.plugin.Plugin
public com.atlassian.plugin.PluginState getPluginState()
getPluginState
in interface com.atlassian.plugin.Plugin
public boolean isSystemPlugin()
isSystemPlugin
in interface com.atlassian.plugin.Plugin
public void setSystemPlugin(boolean system)
setSystemPlugin
in interface com.atlassian.plugin.Plugin
public boolean containsSystemModule()
containsSystemModule
in interface com.atlassian.plugin.Plugin
public boolean isBundledPlugin()
isBundledPlugin
in interface com.atlassian.plugin.Plugin
public Date getDateLoaded()
getDateLoaded
in interface com.atlassian.plugin.Plugin
public Date getDateInstalled()
getDateInstalled
in interface com.atlassian.plugin.Plugin
public boolean isUninstallable()
isUninstallable
in interface com.atlassian.plugin.Plugin
public boolean isDeleteable()
isDeleteable
in interface com.atlassian.plugin.Plugin
public boolean isDynamicallyLoaded()
isDynamicallyLoaded
in interface com.atlassian.plugin.Plugin
public <T> Class<T> loadClass(String clazz, Class<?> callingClass) throws ClassNotFoundException
loadClass
in interface com.atlassian.plugin.Plugin
ClassNotFoundException
public ClassLoader getClassLoader()
getClassLoader
in interface com.atlassian.plugin.Plugin
public MockPlugin setClassLoader(ClassLoader loader)
public URL getResource(String path)
getResource
in interface com.atlassian.plugin.Plugin
public InputStream getResourceAsStream(String name)
getResourceAsStream
in interface com.atlassian.plugin.Plugin
public void install()
install
in interface com.atlassian.plugin.Plugin
public void uninstall()
uninstall
in interface com.atlassian.plugin.Plugin
public void enable()
enable
in interface com.atlassian.plugin.Plugin
public void disable()
disable
in interface com.atlassian.plugin.Plugin
public Set<String> getActivePermissions()
getActivePermissions
in interface com.atlassian.plugin.Plugin
public boolean hasAllPermissions()
hasAllPermissions
in interface com.atlassian.plugin.Plugin
public void resolve()
resolve
in interface com.atlassian.plugin.Plugin
@Nullable public Date getDateEnabling()
getDateEnabling
in interface com.atlassian.plugin.Plugin
@Nullable public Date getDateEnabled()
getDateEnabled
in interface com.atlassian.plugin.Plugin
public int compareTo(com.atlassian.plugin.Plugin o)
compareTo
in interface Comparable<com.atlassian.plugin.Plugin>
public List<com.atlassian.plugin.elements.ResourceDescriptor> getResourceDescriptors()
getResourceDescriptors
in interface com.atlassian.plugin.Resourced
public com.atlassian.plugin.elements.ResourceDescriptor getResourceDescriptor(String type, String name)
getResourceDescriptor
in interface com.atlassian.plugin.Resourced
public com.atlassian.plugin.elements.ResourceLocation getResourceLocation(String type, String name)
getResourceLocation
in interface com.atlassian.plugin.Resourced
public com.atlassian.plugin.PluginArtifact getPluginArtifact()
getPluginArtifact
in interface com.atlassian.plugin.Plugin
public MockPlugin resource(String name, String value)
public com.atlassian.plugin.elements.ResourceDescriptor createI18nResource(String name, String location)
public com.atlassian.plugin.elements.ResourceDescriptor createHelpResource(String name, String location)
@Nonnull public com.atlassian.plugin.PluginDependencies getDependencies()
getDependencies
in interface com.atlassian.plugin.Plugin
public MockPlugin addResourceDescriptor(com.atlassian.plugin.elements.ResourceDescriptor resourceDescriptor, String contents)
getResourceAsStream(String)
.resourceDescriptor
- resource descriptor to addcontents
- corresponding contentspublic void addResourceDescriptor(com.atlassian.plugin.elements.ResourceDescriptor resourceDescriptor)
Copyright © 2002-2023 Atlassian. All Rights Reserved.