java.lang.Class.getClassLoaderImpl()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(127)

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

Class.getClassLoaderImpl介绍

[英]This must be provided by the VM vendor, as it is used by other provided class implementations in this package. Outside of this class, it is used by SecurityManager.classLoaderDepth(), currentClassLoader() and currentLoadedClass(). Return the ClassLoader for this Class without doing any security checks. The bootstrap ClassLoader is returned, unlike getClassLoader() which returns null in place of the bootstrap ClassLoader.
[中]这必须由VM供应商提供,因为此包中提供的其他类实现也使用它。在该类之外,它由SecurityManager使用。classLoaderDepth()、currentClassLoader()和currentLoadedClass()。返回该类的类加载器,而不进行任何安全检查。引导类加载器是返回的,与getClassLoader()不同,getClassLoader()返回null以代替引导类加载器。

代码示例

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

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

/**
 * Returns the class loader which was used to load the class represented by
 * this {@code Class}. Implementations are free to return {@code null} for
 * classes that were loaded by the bootstrap class loader. The Android
 * reference implementation, though, always returns a reference to an actual
 * class loader.
 */
public ClassLoader getClassLoader() {
  if (this.isPrimitive()) {
    return null;
  }
  ClassLoader loader = getClassLoaderImpl();
  if (loader == null) {
    loader = BootClassLoader.getInstance();
  }
  return loader;
}

相关文章

微信公众号

最新文章

更多

Class类方法