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

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

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

ClassLoader.findSystemClass介绍

[英]Finds the class with the specified name, loading it using the system class loader if necessary.
[中]查找具有指定名称的类,必要时使用系统类加载器加载该类。

代码示例

代码示例来源:origin: net.sf.jt400/jt400

protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
{
 return findSystemClass(name);
}

代码示例来源:origin: org.ghost4j/ghost4j

public Class loadClass(String name) throws ClassNotFoundException {
   try { return super.findSystemClass(name); }
   catch(ClassNotFoundException x) {
     try {
      String url = path + name.replace('.', '/') + ".class";
      InputStream is = new URL(url).openConnection().getInputStream();
      byte bytes[] = new byte[is.available()];
      is.read(bytes);
      is.close();
      Class result = defineClass(name, bytes, 0, bytes.length);
      resolveClass(result);
      return result;
     } catch(IOException y) { return null; }
   }
  }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-server

public synchronized Class loadClass(String name, boolean resolve)
 throws ClassNotFoundException
{
 // isn't this redundant?
 if (name.endsWith("$Proxy") && name.equals(compiler.getProxyClassName()))
 {
   return compiler.proxyType;
 }
 // delegate to the original class loader
 ClassLoader cl = getTargetClassLoader();
 if (cl == null)
 {
   return super.findSystemClass(name);
 }
 return cl.loadClass(name);
}

代码示例来源:origin: org.activecomponents.jadex/jadex-commons

ret = super.findSystemClass(classname);

相关文章