Package javassist

Examples of javassist.ClassClassPath


        if ( EJConstants.JAVA_VERSION_INT < 150 )
        {
            throw new IllegalStateException( "DynProxyGenerator supports Java >= 1.5.0 only!" );
        }

        _pool.insertClassPath( new ClassClassPath( this.getClass() ) );
    }
View Full Code Here


     */
    public MockClassLoader(String[] classesToMock, String[] packagesToDefer) {
        super(MockClassLoader.class.getClassLoader(), getPackagesToDefer(packagesToDefer));

        addClassesToModify(classesToMock);
        classPool.appendClassPath(new ClassClassPath(this.getClass()));
    }
View Full Code Here

      return classfileBuffer;
    }

    final ClassPool cp = new ClassPool();
    cp.appendSystemPath();
    cp.appendClassPath( new ClassClassPath( this.getClass() ) );
    cp.appendClassPath( new ClassClassPath( classfile.getClass() ) );

    try {
      cp.makeClassIfNew( new ByteArrayInputStream( classfileBuffer ) );
    }
    catch (IOException e) {
View Full Code Here

      ClassLoader tccl = Thread.currentThread().getContextClassLoader();
      ClassLoader cherryPickCl = new CherryPickClassLoader(included, null, tccl);
      Thread.currentThread().setContextClassLoader(cherryPickCl);
      ClassPool pool = ClassPool.getDefault();
      // Insert a classpath so that Maven does not complain about not finding the class
      pool.insertClassPath(new ClassClassPath(Car.class));
      CtClass carCt = pool.get(CAR);
      try {
         carCt.addField(CtField.make("public int year;", carCt));
         Class carClass = carCt.toClass();
         if (isNewExternalizer) {
View Full Code Here

      urls = paths.toArray(new URL[paths.size()]);
      ClassLoader poolLoader = new URLClassLoader(urls, EmptyClassLoader.EMPTY);
     
      ClassPool pool = new ClassPool(false);
      pool.appendClassPath(new CheckerClassPath(poolLoader));
      pool.appendClassPath(new ClassClassPath(Object.class));
     
      //Add all the classes to compile
      for (File f : files)
      {
         if (f.isDirectory())
View Full Code Here

      return classfileBuffer;
    }
    // This is the same as ClassPool.getDefault() but ensures a new ClassPool per
    ClassPool cp = new ClassPool();
    cp.appendSystemPath();
    cp.appendClassPath(new ClassClassPath(this.getClass()));
    cp.appendClassPath(new ClassClassPath(classfile.getClass()));
    try {
      cp.makeClassIfNew(new ByteArrayInputStream(classfileBuffer));
    } catch (IOException e) {
      throw new RuntimeException(e.getMessage(), e);
    }
View Full Code Here

    public static ClassPool getClassPoolForCurrentContextClassLoader() {
        return getClassPool(Thread.currentThread().getContextClassLoader());
    }

    private static void initClassPool(ClassPool classPool) {
        classPool.appendClassPath(new ClassClassPath(ClassPoolFactory.class));
        classPool.appendSystemPath();
    }
View Full Code Here

    @Before public void setUpMockSWTEnvironment() {
        display = context.mock(Display.class);
        shell = context.mock(Shell.class);

        ClassPool pool = ClassPool.getDefault();
        pool.appendClassPath(new ClassClassPath(MockedAnimatedCanvas.class));
        CtClass ctControl = pool.makeClass("MockedAnimatedCanvas");
        ctControl.addConstructor(new CtConstructor());

        context.checking(new Expectations() {{
            oneOf(display).isDisposed(); will(returnValue(false));
View Full Code Here

     */
    public MockClassLoader(String[] classesToMock, String[] packagesToDefer) {
        super(MockClassLoader.class.getClassLoader(), getPackagesToDefer(packagesToDefer));

        addClassesToModify(classesToMock);
        classPool.appendClassPath(new ClassClassPath(this.getClass()));
    }
View Full Code Here

    //  Create proxy class
    //
      ClassPool pool = ClassPool.getDefault();
     
      // TOMCAT and JBOSS classloader handling
      pool.insertClassPath(new ClassClassPath(superClass));
     
      CtClass proxyClass = pool.makeClass(proxyClassName);
     
    //  Add proxy inheritance
    //
View Full Code Here

TOP

Related Classes of javassist.ClassClassPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.