Codota Logo
LoadingClassLoader
Code IndexAdd Codota to your IDE (free)

How to use
LoadingClassLoader
in
org.crsh.lang.impl.java

Best Java code snippets using org.crsh.lang.impl.java.LoadingClassLoader (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: crashub/crash

String simpleName = className.substring(className.lastIndexOf('.') + 1);
if (simpleName.equals(name)) {
 LoadingClassLoader loader = new LoadingClassLoader(this.loader, classFiles);
 try {
  Class<?> clazz = loader.loadClass(classFile.getClassName());
  final ClassShellCommand command;
  try {
origin: crashub/crash

public void testCompile() throws Exception {
 Compiler compiler = new Compiler();
 List<JavaClassFileObject> files = compiler.compile("A",
   "public class A implements java.util.concurrent.Callable<String> {\n" +
   "public String call() {\n" +
   "return \"hello\";\n" +
   "}\n" +
   "}");
 assertEquals(1, files.size());
 LoadingClassLoader loader = new LoadingClassLoader(Thread.currentThread().getContextClassLoader(), files);
 Class<?> A = loader.findClass("A");
 Callable<String> asCallable = (Callable<String>)A.newInstance();
 String ret = asCallable.call();
 assertEquals("hello", ret);
}
origin: org.crashub/crash.shell

String simpleName = className.substring(className.lastIndexOf('.') + 1);
if (simpleName.equals(name)) {
 LoadingClassLoader loader = new LoadingClassLoader(this.loader, classFiles);
 try {
  Class<?> clazz = loader.loadClass(classFile.getClassName());
  final ClassShellCommand command;
  try {
origin: crashub/crash

private void doTestImport(ClassLoaderFactory factory) throws Exception {
 Compiler compiler = new Compiler();
 List<JavaClassFileObject> files = compiler.compile("foo.A", "package foo;\n public class A {}");
 assertEquals(1, files.size());
 JavaClassFileObject aFile = files.get(0);
 JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "crash.jar");
 jar.add(new ByteArrayAsset(aFile.getBytes()), "foo/A.class");
 jar.setManifest(Thread.currentThread().getContextClassLoader().getResource("META-INF/MANIFEST.MF"));
 ClassLoader cl = factory.getClassLoader(jar);
 //
 compiler = new Compiler(cl);
 files = compiler.compile("B",
   "import foo.A;\n" +
     "public class B implements java.util.concurrent.Callable<A> {\n" +
     "public A call() {\n" +
     "return new A();\n" +
     "}\n" +
     "}");
 assertEquals(1, files.size());
 LoadingClassLoader loader = new LoadingClassLoader(cl, files);
 Class<?> B = loader.findClass("B");
 Callable<?> asCallable = (Callable<?>)B.newInstance();
 Object ret = asCallable.call();
 assertNotNull(ret);
 Class<?> A = ret.getClass();
 assertEquals("foo.A", A.getName());
 assertEquals(cl, A.getClassLoader());
}
origin: com.github.corda.crash/crash.shell

String simpleName = className.substring(className.lastIndexOf('.') + 1);
if (simpleName.equals(name)) {
 LoadingClassLoader loader = new LoadingClassLoader(this.loader, classFiles);
 try {
  Class<?> clazz = loader.loadClass(classFile.getClassName());
  final ClassShellCommand command;
  try {
org.crsh.lang.impl.javaLoadingClassLoader

Most used methods

  • <init>
  • loadClass
  • findClass

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now