com.atlassian.plugin.Plugin.getResourceDescriptors()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中com.atlassian.plugin.Plugin.getResourceDescriptors()方法的一些代码示例,展示了Plugin.getResourceDescriptors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getResourceDescriptors()方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getResourceDescriptors

Plugin.getResourceDescriptors介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.jira/jira-core

private Stream<Pair<ResourceDescriptor, Plugin>> getFeatureResources(final Plugin plugin)
  {
    return plugin.getResourceDescriptors()
        .stream().filter(FEATURE_TYPE_FILTER::apply)
        .map(resource -> new Pair<>(resource, plugin));
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public static Predicate<Plugin> isPluginWithResourceType(@Nonnull final String pluginResourceType)
{
  return (Plugin plugin) -> {
    final Stream<ResourceDescriptor> resourceDescriptors = Stream.concat(plugin.getResourceDescriptors().stream(),
        plugin.getModuleDescriptors().stream().flatMap(module -> module.getResourceDescriptors().stream()));
    return resourceDescriptors.map(ResourceDescriptor::getType).anyMatch(pluginResourceType::equals);
  };
}}

代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin

private void addPluginResourceBundles(Plugin plugin) {
  List<String> bundleNames = plugin.getResourceDescriptors().stream()
      .filter(descriptor -> "i18n".equals(descriptor.getType()))
      .map(ResourceDescriptor::getLocation)
      .collect(Collectors.toList());
  addPluginResourceBundles(plugin, bundleNames);
}

代码示例来源:origin: com.atlassian.fisheye/sal-fisheye-plugin

private void addPluginResourceBundles(Plugin plugin)
{
  List<String> bundleNames = new LinkedList<String>();
  Iterable<ResourceDescriptor> descriptors = plugin.getResourceDescriptors("i18n");
  for (ResourceDescriptor descriptor : descriptors)
  {
    bundleNames.add(descriptor.getLocation());
  }
  addPluginResourceBundles(plugin, bundleNames);
}

代码示例来源:origin: com.atlassian.support/stp

private void resolveResources(Collection<Plugin> plugins)
{
  for (Plugin plugin : plugins)
  {
    Collection<ResourceDescriptor> descriptors =
        Collections2.filter(plugin.getResourceDescriptors(), new Resources.TypeFilter(SUPPORT_INFO_XML));
    if (!descriptors.isEmpty())
    {
      Set<String> locations = ImmutableSet.copyOf(Collections2.transform(descriptors,
          new Function<ResourceDescriptor, String>()
          {
            public String apply(ResourceDescriptor descriptor)
            {
              return descriptor.getLocation();
            }
          }));
      xmlNamesResources.put(plugin, locations);
    }
  }
}

代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin

protected List getI18nLocations(Plugin plugin)
{
  List locations = new ArrayList();
  if(!isPluginUnloadable(plugin))
  {
    for(Object o : plugin.getResourceDescriptors("i18n"))
    {
      ResourceDescriptor resourceDescriptor = (ResourceDescriptor) o;
      locations.add(resourceDescriptor.getLocation());
    }
  }
  return locations;
}

代码示例来源:origin: com.atlassian.sal/sal-refimpl-message-plugin

private void addPluginResourceBundles(Plugin plugin)
{
  List<String> bundleNames = new LinkedList<String>();
  Iterable<ResourceDescriptor> descriptors = plugin.getResourceDescriptors("i18n");
  for (ResourceDescriptor descriptor : descriptors)
  {
    bundleNames.add(descriptor.getLocation());
  }
  addPluginResourceBundles(plugin, bundleNames);
}

代码示例来源:origin: com.atlassian.sal/sal-fisheye-plugin

private void addPluginResourceBundles(Plugin plugin)
{
  List<ResourceBundle> bundles = new LinkedList<ResourceBundle>();
  Iterable<ResourceDescriptor> descriptors = plugin.getResourceDescriptors("i18n");
  for (ResourceDescriptor descriptor : descriptors)
  {
    try
    {
      bundles.add(ResourceBundle.getBundle(descriptor.getLocation(), Locale.getDefault(), plugin.getClassLoader()));
    }
    catch (MissingResourceException e)
    {
      // ignore, move on to next one
    }
  }
  pluginResourceBundles.put(plugin.getKey(), bundles);
}

代码示例来源:origin: com.atlassian.jira/jira-core

private Collection<ResourceDescriptor> getResourceBundleLocations(final Plugin plugin)
{
  final List<ResourceDescriptor> locations = Lists.newArrayList();
  Iterables.addAll(locations, Iterables.filter(plugin.getResourceDescriptors(), filter));
  for (final ModuleDescriptor<?> moduleDescriptor : plugin.getModuleDescriptors())
  {
    try
    {
      Iterables.addAll(locations, Iterables.filter(moduleDescriptor.getResourceDescriptors(), filter));
    }
    catch (final RuntimeException re)
    {
      if (log.isDebugEnabled())
      {
        log.debug(format("FAILED plugin module resource descriptors: pluginKey: %s; moduleKey: %s; mode: %s",
            plugin.getKey(), moduleDescriptor.getCompleteKey(), getModeString()), re);
      }
    }
  }
  return locations;
}

代码示例来源:origin: com.atlassian.sal/sal-legacyjira-plugin

for (Iterator j = plugin.getResourceDescriptors("i18n").iterator(); j.hasNext();)

代码示例来源:origin: com.atlassian.studio/studio-aal-jira-plugin

for (Iterator j = plugin.getResourceDescriptors("i18n").iterator(); j.hasNext();)

代码示例来源:origin: com.atlassian.jira/jira-core

descriptor.getPlugin().getResourceDescriptors(), filter);

相关文章