Package javassist

Examples of javassist.ClassPool.appendClassPath()


    final ClassPool pool = new AnnotationLoadingClassPool();

    // set up the classpath for the classpool
    if (classpath != null) {
      for (File f : this.classpath) {
        pool.appendClassPath(f.toString());
      }
    }

    // add the files to process
    for (File f : this.sources) {
View Full Code Here


      }
    }

    // add the files to process
    for (File f : this.sources) {
      pool.appendClassPath(f.toString());
    }
    return pool;
  }

  public void process(ClassPool pool, Collection<File> files) {
View Full Code Here

    if (clazzProxy == null) {

      ClassPool pool = new ClassPool();
      CtClass ctChieldClass = pool.getOrNull(chieldClassName);

      pool.appendClassPath(new LoaderClassPath(classLoader));
      CtClass ctSuperClass = pool.get(superClassName);

      ctChieldClass = pool.getAndRename(ConfigurationImpl.class.getCanonicalName(), chieldClassName);
      ctChieldClass.setSuperclass(ctSuperClass);
View Full Code Here

            String componentClassName, MutableComponentModel model, BindingSource source,
            Runnable phaseTwoTraining) throws Exception
    {
        ClassPool pool = new ClassPool();
        ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
        pool.appendClassPath(new LoaderClassPath(contextLoader));

        Loader loader = new Loader(contextLoader, pool);

        loader.delegateLoadingOf("org.apache.tapestry.");
View Full Code Here

  public ClassFile( @Nonnull final File classFile, @Nonnull ClassLoader dependenciesClassLoader) throws IOException {
    this.classFile = classFile;
    this.dependenciesClassLoader = dependenciesClassLoader;
    final ClassPool classPool = new ClassPool(true);
    classPool.appendClassPath(new LoaderClassPath(dependenciesClassLoader));

    final InputStream inputStream = new BufferedInputStream( new FileInputStream( classFile ) );
    try {
      compiledClass = classPool.makeClass( inputStream );
    } finally {
View Full Code Here

                int index = 0;
                for (String xformVal : xformVals) {
                    // Load the source class
                    String trimmed = xformVal.trim();
                    classPool.appendClassPath(new LoaderClassPath(Class.forName(trimmed).getClassLoader()));
                    CtClass template = classPool.get(trimmed);

                    // Add in extra interfaces
                    CtClass[] interfacesToCopy = template.getInterfaces();
                    for (CtClass i : interfacesToCopy) {
View Full Code Here

                clazz.defrost();

                for (String xformVal : xformVals) {
                    // Load the source class
                    String trimmed = xformVal.trim();
                    classPool.appendClassPath(new LoaderClassPath(Class.forName(trimmed).getClassLoader()));
                    CtClass template = classPool.get(trimmed);

                    // Copy over all declared annotations from fields from the template class
                    // Note that we do not copy over fields with the @NonCopiedField annotation
                    CtField[] fieldsToCopy = template.getDeclaredFields();
View Full Code Here

public class Enhancer {

  public <T> Class enhanceResource(Class<T> originalType) {
    ClassPool pool = ClassPool.getDefault();
    if (pool.find(Enhancer.class.getName()) == null) {
      pool.appendClassPath(new LoaderClassPath(getClass().getClassLoader()));
    }
    try {
      // TODO extract this enhancement to an interface and test it appart
      CtClass newType =   pool.makeClass("br.com.caelum.restfulie." + originalType.getSimpleName() + "_" + System.currentTimeMillis());
      newType.setSuperclass(pool.get(originalType.getName()));
View Full Code Here

    */
   protected ClassPool createClassPool(VFSDeploymentUnit unit)
   {
      ClassPool pool = new ClassPool();
      ClassPath deploymentPath = new DeploymentUnitClassPath(unit);
      pool.appendClassPath(deploymentPath);
      // fall back to classloader classpath
      ClassPath classPath = new LoaderClassPath(unit.getClassLoader());
      pool.appendClassPath(classPath);
      return pool;
   }
View Full Code Here

      ClassPool pool = new ClassPool();
      ClassPath deploymentPath = new DeploymentUnitClassPath(unit);
      pool.appendClassPath(deploymentPath);
      // fall back to classloader classpath
      ClassPath classPath = new LoaderClassPath(unit.getClassLoader());
      pool.appendClassPath(classPath);
      return pool;
   }

   /**
    * Visit module.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.