com.google.common.reflect.ClassPath.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(168)

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

ClassPath.<init>介绍

暂无

代码示例

代码示例来源:origin: google/guava

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its ancestor class loaders.
 *
 * <p><b>Warning:</b> {@code ClassPath} can find classes and resources only from:
 *
 * <ul>
 *   <li>{@link URLClassLoader} instances' {@code file:} URLs
 *   <li>the {@linkplain ClassLoader#getSystemClassLoader() system class loader}. To search the
 *       system class loader even when it is not a {@link URLClassLoader} (as in Java 9), {@code
 *       ClassPath} searches the files from the {@code java.class.path} system property.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 DefaultScanner scanner = new DefaultScanner();
 scanner.scan(classloader);
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: google/j2objc

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its ancestor class loaders.
 *
 * <p><b>Warning:</b> {@code ClassPath} can find classes and resources only from:
 *
 * <ul>
 *   <li>{@link URLClassLoader} instances' {@code file:} URLs
 *   <li>the {@linkplain ClassLoader#getSystemClassLoader() system class loader}. To search the
 *       system class loader even when it is not a {@link URLClassLoader} (as in Java 9), {@code
 *       ClassPath} searches the files from the {@code java.class.path} system property.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 DefaultScanner scanner = new DefaultScanner();
 scanner.scan(classloader);
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: wildfly/wildfly

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its ancestor class loaders.
 *
 * <p><b>Warning:</b> {@code ClassPath} can find classes and resources only from:
 *
 * <ul>
 *   <li>{@link URLClassLoader} instances' {@code file:} URLs
 *   <li>the {@linkplain ClassLoader#getSystemClassLoader() system class loader}. To search the
 *       system class loader even when it is not a {@link URLClassLoader} (as in Java 9), {@code
 *       ClassPath} searches the files from the {@code java.class.path} system property.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 DefaultScanner scanner = new DefaultScanner();
 scanner.scan(classloader);
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: Nextdoor/bender

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 Scanner scanner = new Scanner();
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  scanner.scan(entry.getKey(), entry.getValue());
 }
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its parent class loaders.
 *
 * <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *         failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 ImmutableSortedSet.Builder<ResourceInfo> resources =
   new ImmutableSortedSet.Builder<ResourceInfo>(Ordering.usingToString());
 for (Map.Entry<URI, ClassLoader> entry : getClassPathEntries(classloader).entrySet()) {
  browse(entry.getKey(), entry.getValue(), resources);
 }
 return new ClassPath(resources.build());
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its ancestor class loaders.
 *
 * <p><b>Warning:</b> {@code ClassPath} can find classes and resources only from:
 *
 * <ul>
 *   <li>{@link URLClassLoader} instances' {@code file:} URLs
 *   <li>the {@linkplain ClassLoader#getSystemClassLoader() system class loader}. To search the
 *       system class loader even when it is not a {@link URLClassLoader} (as in Java 9), {@code
 *       ClassPath} searches the files from the {@code java.class.path} system property.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 DefaultScanner scanner = new DefaultScanner();
 scanner.scan(classloader);
 return new ClassPath(scanner.getResources());
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns a {@code ClassPath} representing all classes and resources loadable from {@code
 * classloader} and its ancestor class loaders.
 *
 * <p><b>Warning:</b> {@code ClassPath} can find classes and resources only from:
 *
 * <ul>
 *   <li>{@link URLClassLoader} instances' {@code file:} URLs
 *   <li>the {@linkplain ClassLoader#getSystemClassLoader() system class loader}. To search the
 *       system class loader even when it is not a {@link URLClassLoader} (as in Java 9), {@code
 *       ClassPath} searches the files from the {@code java.class.path} system property.
 * </ul>
 *
 * @throws IOException if the attempt to read class path resources (jar files or directories)
 *     failed.
 */
public static ClassPath from(ClassLoader classloader) throws IOException {
 DefaultScanner scanner = new DefaultScanner();
 scanner.scan(classloader);
 return new ClassPath(scanner.getResources());
}

相关文章