本文整理了Java中com.atlassian.plugin.Plugin.isEnabledByDefault()
方法的一些代码示例,展示了Plugin.isEnabledByDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.isEnabledByDefault()
方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:isEnabledByDefault
暂无
代码示例来源:origin: com.atlassian.healthcheck/atlassian-healthcheck
private static boolean pluginIsSupposedToBeDisabled(Plugin plugin) {
// This plugin type is a placeholder produced by the plugin system that indicate that the plugin failed to install or enable.
// We need to check for them explicitly, since they'll return false from isEnabledByDefault which we'd otherwise let through
if (plugin instanceof UnloadablePlugin) {
// The plugin failed to load at all (e.g. invalid plugin xml)
return false;
} else {
// Ignore plugins whose plugin xml has hardcoded 'state="disabled"' (we find these via static code analysis, not healthchecks)
return !plugin.isEnabledByDefault();
}
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core
public boolean isEnabled(final Plugin plugin) {
final PluginEnabledState state = map.get(plugin.getKey());
return (state == null) ? plugin.isEnabledByDefault() : state.isEnabled();
}
代码示例来源:origin: com.atlassian.healthcheck/atlassian-healthcheck
/**
* Run the healthcheck: get keys of disabled-by-default plugins that are actually enabled
*/
@Override
List<String> getItemsFailingCheck() {
return pluginAccessor.getPlugins((Predicate<Plugin>) plugin ->
!plugin.isEnabledByDefault()
&& pluginAccessor.isPluginEnabled(plugin.getKey()))
.stream()
.map(Plugin::getKey)
.sorted()
.collect(toList());
}
}
内容来源于网络,如有侵权,请联系作者删除!