com.sun.tools.xjc.Options.findServices()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(72)

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

Options.findServices介绍

[英]Looks for all "META-INF/services/[className]" files and create one instance for each class name found inside this file.
[中]查找所有“META-INF/services/[className]”文件,并为此文件中找到的每个类名创建一个实例。

代码示例

代码示例来源:origin: apache/servicemix-bundles

/**
 * Gets all the {@link Plugin}s discovered so far.
 * <p>
 * <p>
 * A plugins are enumerated when this method is called for the first time,
 * by taking {@link #classpaths} into account. That means
 * "-cp plugin.jar" has to come before you specify options to enable it.
 *
 * @return
 */
public List<Plugin> getAllPlugins() {
  if (allPlugins == null) {
    allPlugins = findServices(Plugin.class);
  }
  return allPlugins;
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

/**
 * Gets all the {@link Plugin}s discovered so far.
 * <p>
 * <p>
 * A plugins are enumerated when this method is called for the first time,
 * by taking {@link #classpaths} into account. That means
 * "-cp plugin.jar" has to come before you specify options to enable it.
 *
 * @return
 */
public List<Plugin> getAllPlugins() {
  if (allPlugins == null) {
    allPlugins = findServices(Plugin.class);
  }
  return allPlugins;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc

/**
 * Gets all the {@link Plugin}s discovered so far.
 * <p>
 * <p>
 * A plugins are enumerated when this method is called for the first time,
 * by taking {@link #classpaths} into account. That means
 * "-cp plugin.jar" has to come before you specify options to enable it.
 *
 * @return
 */
public List<Plugin> getAllPlugins() {
  if (allPlugins == null) {
    allPlugins = findServices(Plugin.class);
  }
  return allPlugins;
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

/**
 * Gets all the {@link Plugin}s discovered so far.
 *
 * <p>
 * A plugins are enumerated when this method is called for the first time,
 * by taking {@link #classpaths} into account. That means
 * "-cp plugin.jar" has to come before you specify options to enable it.
 */
public List<Plugin> getAllPlugins() {
  if(allPlugins==null) {
    allPlugins = new ArrayList<Plugin>();
    ClassLoader ucl = getUserClassLoader(getClass().getClassLoader());
    for( Plugin aug : findServices(Plugin.class,ucl) )
      allPlugins.add(aug);
  }
  return allPlugins;
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

/**
 * Gets all the {@link Plugin}s discovered so far.
 *
 * <p>
 * A plugins are enumerated when this method is called for the first time,
 * by taking {@link #classpaths} into account. That means
 * "-cp plugin.jar" has to come before you specify options to enable it.
 */
public List<Plugin> getAllPlugins() {
  if(allPlugins==null) {
    allPlugins = new ArrayList<Plugin>();
    ClassLoader ucl = getUserClassLoader(getClass().getClassLoader());
    for( Plugin aug : findServices(Plugin.class,ucl) )
      allPlugins.add(aug);
  }
  return allPlugins;
}

相关文章