java.lang.ClassLoader.getPackages()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(142)

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

ClassLoader.getPackages介绍

[英]Returns all the packages known to this class loader.
[中]返回此类装入器已知的所有包。

代码示例

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

@Override
public Package[] getPackages() {
  return super.getPackages();
}

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

/**
 * Returns all the packages known to the caller's class loader.
 *
 * @return all the packages known to the caller's class loader.
 * @see ClassLoader#getPackages
 */
public static Package[] getPackages() {
  ClassLoader classloader = VMStack.getCallingClassLoader();
  if (classloader == null) {
    classloader = ClassLoader.getSystemClassLoader();
  }
  return classloader.getPackages();
}

代码示例来源:origin: mulesoft/mule

@Override
protected Package[] getPackages() {
 Package[] packagesList = super.getPackages();
 return stream(packagesList).filter(aPackage -> filter.exportsPackage(aPackage.getName())).toArray(Package[]::new);
}

代码示例来源:origin: io.hawt/hawtio-util

@Override
public Package[] getPackages() {
  return super.getPackages();
}

代码示例来源:origin: org.openrdf.elmo/elmo-codegen

@Override
  public Package[] getPackages() {
    return super.getPackages();
  }
}

代码示例来源:origin: org.glassfish.common/amx-core

public Package[] getPackages()
{
  return (super.getPackages());
}

代码示例来源:origin: org.glassfish.main.common/amx-core

@Override
public Package[] getPackages()
{
  return (super.getPackages());
}

代码示例来源:origin: org.nuxeo.ecm.webengine/nuxeo-webengine-core

@Override
protected Package[] getPackages() {
  return super.getPackages();
}

代码示例来源:origin: gncloud/fastcatsearch

public void init(Set<String> set) {
    Package[] packages = super.getPackages();
    for(Package pkg : packages) {
      String pkgName = pkg.getName();
      if(!set.contains(pkgName)) {
        set.add(pkgName);
      }
    }
  }
}.init(ret);

代码示例来源:origin: caskdata/cdap

@Override
protected Package[] getPackages() {
 List<Package> packages = Lists.newArrayList();
 for (Package pkg : super.getPackages()) {
  if (predicate.apply(pkg.getName())) {
   packages.add(pkg);
  }
 }
 return packages.toArray(new Package[packages.size()]);
}

代码示例来源:origin: co.cask.cdap/cdap-common

@Override
protected Package[] getPackages() {
 List<Package> packages = Lists.newArrayList();
 for (Package pkg : super.getPackages()) {
  if (predicate.apply(pkg.getName())) {
   packages.add(pkg);
  }
 }
 return packages.toArray(new Package[packages.size()]);
}

代码示例来源:origin: caskdata/cdap

@Override
protected Package[] getPackages() {
 List<Package> packages = Lists.newArrayList();
 for (Package pkg : super.getPackages()) {
  if (filter.acceptPackage(pkg.getName())) {
   packages.add(pkg);
  }
 }
 return packages.toArray(new Package[packages.size()]);
}

代码示例来源:origin: co.cask.cdap/cdap-common

@Override
protected Package[] getPackages() {
 List<Package> packages = Lists.newArrayList();
 for (Package pkg : super.getPackages()) {
  if (filter.acceptPackage(pkg.getName())) {
   packages.add(pkg);
  }
 }
 return packages.toArray(new Package[packages.size()]);
}

代码示例来源:origin: org.jboss.forge/jboss-modules

/**
 * Get all defined packages which are visible to this class loader.
 *
 * @return the packages
 */
protected Package[] getPackages() {
  ArrayList<Package> list = new ArrayList<Package>();
  list.addAll(packages.values());
  list.addAll(Arrays.asList(super.getPackages()));
  return list.toArray(new Package[list.size()]);
}

代码示例来源:origin: org.gradle/gradle-tooling-api

@Override
protected Package[] getPackages() {
  List<Package> packages = new ArrayList<Package>();
  for (Package p : super.getPackages()) {
    if (allowed(p)) {
      packages.add(p);
    }
  }
  return packages.toArray(new Package[0]);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns all the packages known to the caller's class loader.
 *
 * @return all the packages known to the caller's class loader.
 * @see ClassLoader#getPackages
 */
public static Package[] getPackages() {
  ClassLoader classloader = VMStack.getCallingClassLoader();
  if (classloader == null) {
    classloader = ClassLoader.getSystemClassLoader();
  }
  return classloader.getPackages();
}

代码示例来源:origin: org.gradle/gradle-base-services

@Override
protected Package[] getPackages() {
  List<Package> packages = new ArrayList<Package>();
  for (Package p : super.getPackages()) {
    if (allowed(p)) {
      packages.add(p);
    }
  }
  return packages.toArray(new Package[0]);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns all the packages known to the caller's class loader.
 *
 * @return all the packages known to the caller's class loader.
 * @see ClassLoader#getPackages
 */
public static Package[] getPackages() {
  ClassLoader classloader = VMStack.getCallingClassLoader();
  if (classloader == null) {
    classloader = ClassLoader.getSystemClassLoader();
  }
  return classloader.getPackages();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns all the packages known to the caller's class loader.
 *
 * @return all the packages known to the caller's class loader.
 * @see ClassLoader#getPackages
 */
public static Package[] getPackages() {
  ClassLoader classloader = VMStack.getCallingClassLoader();
  if (classloader == null) {
    classloader = ClassLoader.getSystemClassLoader();
  }
  return classloader.getPackages();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns all the packages known to the caller's class loader.
 *
 * @return all the packages known to the caller's class loader.
 * @see ClassLoader#getPackages
 */
public static Package[] getPackages() {
  ClassLoader classloader = VMStack.getCallingClassLoader();
  if (classloader == null) {
    classloader = ClassLoader.getSystemClassLoader();
  }
  return classloader.getPackages();
}

相关文章