Package org.aspectj.weaver.bcel

Examples of org.aspectj.weaver.bcel.BcelWeaver


    bcelWorld.setXnoInline(buildConfig.isXnoInline());
    bcelWorld.setXlazyTjp(buildConfig.isXlazyTjp());
    bcelWorld.setXHasMemberSupportEnabled(buildConfig.isXHasMemberEnabled());
    bcelWorld.setPinpointMode(buildConfig.isXdevPinpoint());
    bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold, buildConfig.getOptions().warningThreshold);
    BcelWeaver bcelWeaver = new BcelWeaver(bcelWorld);
    bcelWeaver.setCustomMungerFactory(customMungerFactory);
    state.setWorld(bcelWorld);
    state.setWeaver(bcelWeaver);
    state.clearBinarySourceFiles();

    if (buildConfig.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)) {
      bcelWorld.getLint().loadDefaultProperties();
    } else {
      bcelWorld.getLint().setAll(buildConfig.getLintMode());
    }
    if (buildConfig.getLintSpecFile() != null) {
      bcelWorld.getLint().setFromProperties(buildConfig.getLintSpecFile());
    }

    for (Iterator i = buildConfig.getAspectpath().iterator(); i.hasNext();) {
      File f = (File) i.next();
      if (!f.exists()) {
        IMessage message = new Message("invalid aspectpath entry: " + f.getName(), null, true);
        handler.handleMessage(message);
      } else {
        bcelWeaver.addLibraryJarFile(f);
      }
    }

    // String lintMode = buildConfig.getLintMode();

    File outputDir = buildConfig.getOutputDir();
    if (outputDir == null && buildConfig.getCompilationResultDestinationManager() != null) {
      // send all output from injars and inpath to the default output location
      // (will also later send the manifest there too)
      outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
    }
    // ??? incremental issues
    for (File inJar : buildConfig.getInJars()) {
      List<UnwovenClassFile> unwovenClasses = bcelWeaver.addJarFile(inJar, outputDir, false);
      state.recordBinarySource(inJar.getPath(), unwovenClasses);
    }

    for (File inPathElement : buildConfig.getInpath()) {
      if (!inPathElement.isDirectory()) {
        // its a jar file on the inpath
        // the weaver method can actually handle dirs, but we don't call it, see next block
        List<UnwovenClassFile> unwovenClasses = bcelWeaver.addJarFile(inPathElement, outputDir, true);
        state.recordBinarySource(inPathElement.getPath(), unwovenClasses);
      } else {
        // add each class file in an in-dir individually, this gives us the best error reporting
        // (they are like 'source' files then), and enables a cleaner incremental treatment of
        // class file changes in indirs.
        File[] binSrcs = FileUtil.listFiles(inPathElement, binarySourceFilter);
        for (int j = 0; j < binSrcs.length; j++) {
          UnwovenClassFile ucf = bcelWeaver.addClassFile(binSrcs[j], inPathElement, outputDir);
          List<UnwovenClassFile> ucfl = new ArrayList<UnwovenClassFile>();
          ucfl.add(ucf);
          state.recordBinarySource(binSrcs[j].getPath(), ucfl);
        }
      }
    }

    bcelWeaver.setReweavableMode(buildConfig.isXNotReweavable());

    // check for org.aspectj.runtime.JoinPoint
    ResolvedType joinPoint = bcelWorld.resolve("org.aspectj.lang.JoinPoint");
    if (joinPoint.isMissing()) {
      IMessage message = new Message(
View Full Code Here


    }

    // TODO when the world works in terms of the context, we can remove the loader
    bcelWorld = new LTWWorld(classLoader, weavingContext, getMessageHandler(), null);

    weaver = new BcelWeaver(bcelWorld);

    // register the definitions
    success = registerDefinitions(weaver, classLoader, definitions);
    if (success) {
View Full Code Here

    myBcelWorld.setXnoInline(options.xNoInline);
    myBcelWorld.setXlazyTjp(options.xLazyThisJoinPoint);
    myBcelWorld.setXHasMemberSupportEnabled(options.xHasMember);
    myBcelWorld.setPinpointMode(options.xdevPinpoint);
    setLintProperties(myBcelWorld, options);
    myWeaver = new BcelWeaver(myBcelWorld);
    myWeaver.setReweavableMode(options.xNotReweavable);
    // TODO deal with injars, inpath, and aspectpath here...
  }
View Full Code Here

    bcelWorld.getLint().loadDefaultProperties();
    if (LangUtil.is15VMOrGreater()) {
      bcelWorld.setBehaveInJava5Way(true);
    }

    weaver = new BcelWeaver(bcelWorld);
    registerAspectLibraries(aspectPath);

    enabled = true;
  }
View Full Code Here

    bcelWorld.getLint().loadDefaultProperties();
    if (LangUtil.is15VMOrGreater()) {
      bcelWorld.setBehaveInJava5Way(true);
    }

    weaver = new BcelWeaver(bcelWorld);
    registerAspectLibraries(aspectPath);

    enabled = true;
  }
View Full Code Here

    }

    // TODO when the world works in terms of the context, we can remove the loader
    bcelWorld = new LTWWorld(classLoader, weavingContext, getMessageHandler(), null);

    weaver = new BcelWeaver(bcelWorld);

    // register the definitions
    success = registerDefinitions(weaver, classLoader, definitions);
    if (success) {
View Full Code Here

    }

    // TODO when the world works in terms of the context, we can remove the loader
    bcelWorld = new LTWWorld(classLoader, weavingContext, getMessageHandler(), null);

    weaver = new BcelWeaver(bcelWorld);

    // register the definitions
    success = registerDefinitions(weaver, classLoader, definitions);
    if (success) {
View Full Code Here

    bcelWorld.getLint().loadDefaultProperties();
    if (LangUtil.is15VMOrGreater()) {
      bcelWorld.setBehaveInJava5Way(true);
    }

    weaver = new BcelWeaver(bcelWorld);
    registerAspectLibraries(aspectPath);

    enabled = true;
  }
View Full Code Here

    myBcelWorld.setXnoInline(options.xNoInline);
    myBcelWorld.setXlazyTjp(options.xLazyThisJoinPoint);
    myBcelWorld.setXHasMemberSupportEnabled(options.xHasMember);
    myBcelWorld.setPinpointMode(options.xdevPinpoint);
    setLintProperties(myBcelWorld,options);
    myWeaver = new BcelWeaver(myBcelWorld);
    myWeaver.setReweavableMode(options.xNotReweavable);
    // TODO deal with injars, inpath, and aspectpath here...
  }
View Full Code Here

    bcelWorld.getLint().loadDefaultProperties();
    if (LangUtil.is15VMOrGreater()) {
      bcelWorld.setBehaveInJava5Way(true);
    }

    weaver = new BcelWeaver(bcelWorld);
    registerAspectLibraries(aspectPath);
  }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.bcel.BcelWeaver

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.