Package javassist

Examples of javassist.CtClass.writeFile()


        if (ctClazz.isModified()) {
          getLog().debug("Writing enhanced class [" + clazzName + "]");
          // Trying to work around UIMA-2611, see
          // http://stackoverflow.com/questions/13797919/javassist-add-method-and-invoke
          ctClazz.toBytecode();
          ctClazz.writeFile(project.getBuild().getOutputDirectory());
        } else {
          getLog().debug("No changes to class [" + clazzName + "]");
        }
      } catch (IOException e) {
        throw new MojoExecutionException("Enhanced class [" + clazzName + "] cannot be written: "
View Full Code Here


          CtClass clazz = loadClassFile(details.getFile());

          if (this.transformation.shouldTransform(clazz)) {
            clazz.defrost();
            this.transformation.applyTransformations(clazz);
            clazz.writeFile(this.destinationDir);
          }
        }
      } catch (Exception e) {
        throw new GradleException("An error occurred while trying to process class file ", e);
      }
View Full Code Here

          CtClass clazz = loadClassFile(details.getFile());

          if (this.transformation.shouldTransform(clazz)) {
            clazz.defrost();
            this.transformation.applyTransformations(clazz);
            clazz.writeFile(this.destinationDir);
          }
        }
      } catch (Exception e) {
        throw new GradleException("An error occurred while trying to process class file ", e);
      }
View Full Code Here

          CtClass clazz = loadClassFile(details.getFile());

          if (this.transformation.shouldTransform(clazz)) {
            clazz.defrost();
            this.transformation.applyTransformations(clazz);
            clazz.writeFile(this.destinationDir);
          }
        }
      } catch (Exception e) {
        throw new GradleException("An error occurred while trying to process class file ", e);
      }
View Full Code Here

         ClassFileWriter.print(file, out);
      }

      // Write out the changes
      if (outputDir != null)
         clazz.writeFile(outputDir);
      else
         clazz.writeFile(info.getSrcRoot());

      return true;
   }
View Full Code Here

      // Write out the changes
      if (outputDir != null)
         clazz.writeFile(outputDir);
      else
         clazz.writeFile(info.getSrcRoot());

      return true;
   }

   /**
 
View Full Code Here

        CtClass clazz = loadClassFile(pool, file);

        if (transformation.shouldTransform(clazz)) {
          clazz.defrost();
          transformation.applyTransformations(clazz);
          clazz.writeFile(this.destinationDir.toString());
        }
      }
    } catch (Exception e) {
      throw new GradleException("An error occurred while trying to process class file ", e);
    }
View Full Code Here

/* 341 */         this.translator.onLoad(this.classPool, classname);
/*     */       }
/* 343 */       CtClass c = this.classPool.get(classname);
/* 344 */       classfile = c.toBytecode();
/* 345 */       if (this.debugDir != null)
/* 346 */         c.writeFile(this.debugDir);
/*     */     } catch (Exception e)
/*     */     {
/* 349 */       throw new BadHttpRequest(e);
/*     */     }
/*     */
View Full Code Here

   }
  
   private Factory generateClassAndFactory(int loop, String rootName) throws Exception
   {
      CtClass clazz = createClass(loop, rootName);
      clazz.writeFile(directory.getAbsolutePath());
      clazz.detach();
     
      CtClass factoryClass = createFactory(loop, rootName);
      factoryClass.writeFile(directory.getAbsolutePath());
      Class<Factory> realClass = factoryClass.toClass();
View Full Code Here

      CtClass clazz = createClass(loop, rootName);
      clazz.writeFile(directory.getAbsolutePath());
      clazz.detach();
     
      CtClass factoryClass = createFactory(loop, rootName);
      factoryClass.writeFile(directory.getAbsolutePath());
      Class<Factory> realClass = factoryClass.toClass();
      return realClass.newInstance();
   }
  
   private CtClass createClass(int loop, String rootName) throws Exception
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.