本文整理了Java中com.atlassian.plugin.Plugin.setName()
方法的一些代码示例,展示了Plugin.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.setName()
方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:setName
暂无
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-osgi
private static Plugin extractOsgiPlugin(
final PluginArtifact pluginArtifact,
final Manifest mf,
final OsgiContainerManager osgi,
final PluginEventManager pluginEventManager) {
final String pluginKey = getNonEmptyAttribute(mf, OsgiPlugin.ATLASSIAN_PLUGIN_KEY);
final String bundleName = getAttributeWithoutValidation(mf, Constants.BUNDLE_NAME);
final Plugin plugin = new OsgiPlugin(pluginKey, osgi, pluginArtifact, pluginArtifact, pluginEventManager);
plugin.setPluginsVersion(2);
plugin.setName(bundleName);
return plugin;
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core
public Plugin configurePlugin(final ModuleDescriptorFactory moduleDescriptorFactory, final Plugin plugin) throws PluginParseException {
plugin.setName(descriptorReader.getPluginName());
plugin.setKey(getKey());
plugin.setPluginsVersion(getPluginsVersion());
plugin.setSystemPlugin(isSystemPlugin());
plugin.setI18nNameKey(descriptorReader.getI18nPluginNameKey().orElseGet(plugin::getI18nNameKey));
if (plugin.getKey().indexOf(":") > 0) {
throw new PluginParseException("Plugin keys cannot contain ':'. Key is '" + plugin.getKey() + "'");
}
plugin.setEnabledByDefault(descriptorReader.isEnabledByDefault());
plugin.setResources(descriptorReader.getResources());
plugin.setPluginInformation(createPluginInformation());
for (Element module : descriptorReader.getModules(plugin.getInstallationMode())) {
final ModuleDescriptor<?> moduleDescriptor = createModuleDescriptor(plugin, module, moduleDescriptorFactory);
// If we're not loading the module descriptor, null is returned, so we skip it
if (moduleDescriptor == null) {
continue;
}
if (plugin.getModuleDescriptor(moduleDescriptor.getKey()) != null) {
throw new PluginParseException("Found duplicate key '" + moduleDescriptor.getKey() + "' within plugin '" + plugin.getKey() + "'");
}
plugin.addModuleDescriptor(moduleDescriptor);
// If we have any unloadable modules, also create an unloadable plugin, which will make it clear that there was a problem
if (moduleDescriptor instanceof UnloadableModuleDescriptor) {
log.error("There were errors loading the plugin '" + plugin.getName() + "'. The plugin has been disabled.");
return UnloadablePluginFactory.createUnloadablePlugin(plugin);
}
}
return plugin;
}
内容来源于网络,如有侵权,请联系作者删除!