Package org.aspectj.bridge

Examples of org.aspectj.bridge.IMessageHandler


    if (compiler.options.complianceLevel >= ClassFileConstants.JDK1_5) {
      inJava5Mode = true;
    }

    IMessageHandler msgHandler = world.getMessageHandler();
    // Do we need to reset the message handler or create a new one? (This saves a ton of memory lost on incremental compiles...)
    if (msgHandler instanceof WeaverMessageHandler) {
      ((WeaverMessageHandler) msgHandler).resetCompiler(compiler);
      weaverMessageHandler = (WeaverMessageHandler) msgHandler;
    } else {
View Full Code Here


    } finally {
      // ???: is this the right point for this? After weaving has finished clear the caches.
      weaverMessageHandler.setCurrentResult(null);
      weaver.allWeavingComplete();
      weaver.tidyUp();
      IMessageHandler imh = weaver.getWorld().getMessageHandler();
      if (imh instanceof WeaverMessageHandler) {
        ((WeaverMessageHandler) imh).resetCompiler(null);
      }
    }
  }
View Full Code Here

    this.incrementalCompilationState = incrementalCompilationState;

    if (compiler.options.complianceLevel >= ClassFileConstants.JDK1_5) {
      inJava5Mode = true;
    }
    IMessageHandler msgHandler = world.getMessageHandler();
    // Do we need to reset the message handler or create a new one? (This saves a ton of memory lost on incremental compiles...)
    if (msgHandler instanceof WeaverMessageHandler) {
      ((WeaverMessageHandler) msgHandler).resetCompiler(compiler);
      weaverMessageHandler = (WeaverMessageHandler) msgHandler;
    } else {
View Full Code Here

  private void postWeave() {
    if (debugPipeline) {
      System.err.println("> postWeave()");
    }
    IMessageHandler imh = weaver.getWorld().getMessageHandler();
    if (imh instanceof WeaverMessageHandler) {
      ((WeaverMessageHandler) imh).setCurrentResult(null);
    }
    if (!droppingBackToFullBuild) {
      weaver.allWeavingComplete();
View Full Code Here

        {
        MessageHandler handler = new MessageHandler();
        if (!verbose) {
          handler.ignore(IMessage.INFO);
        }
        final IMessageHandler delegate
          = verbose ? MessagePrinter.VERBOSE: MessagePrinter.TERSE;
      handler.setInterceptor(delegate);
      holder = handler;
        }
        try {
View Full Code Here

    }
    IMessageHolder holder = messageHolder;
    int numPreviousErrors;
    if (null == holder) {
      MessageHandler mhandler = new MessageHandler(true);
      final IMessageHandler delegate;
      delegate = new AntMessageHandler(this.logger, this.verbose, false);
      mhandler.setInterceptor(delegate);
      holder = mhandler;
      numPreviousErrors = 0;
    } else {
View Full Code Here

      AjcConfigParser parser = new AjcConfigParser(buildConfig, handler);
      parser.parseCommandLine(args);
      boolean swi = buildConfig.getShowWeavingInformation();
      // Now jump through firey hoops to turn them on/off
      if (handler instanceof CountingMessageHandler) {
        IMessageHandler delegate = ((CountingMessageHandler) handler).delegate;
        if (swi) {
          delegate.dontIgnore(IMessage.WEAVEINFO);
        } else {
          delegate.ignore(IMessage.WEAVEINFO);
        }
      }

      boolean incrementalMode = buildConfig.isIncrementalMode() || buildConfig.isIncrementalFileMode();
View Full Code Here

  private void ensureAspectJAttributesUnpacked() {
    if ((bitflag & UNPACKED_AJATTRIBUTES) != 0) {
      return;
    }
    bitflag |= UNPACKED_AJATTRIBUTES;
    IMessageHandler msgHandler = getResolvedTypeX().getWorld().getMessageHandler();
    // Pass in empty list that can store things for readAj5 to process
    List<AjAttribute> l = null;
    try {
      l = Utility.readAjAttributes(className, javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),
          getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN,
          new BcelConstantPoolReader(javaClass.getConstantPool()));
    } catch (RuntimeException re) {
      throw new RuntimeException("Problem processing attributes in " + javaClass.getFileName(), re);
    }
    List<ResolvedPointcutDefinition> pointcuts = new ArrayList<ResolvedPointcutDefinition>();
    typeMungers = new ArrayList<ConcreteTypeMunger>();
    declares = new ArrayList<Declare>();
    processAttributes(l, pointcuts, false);
    ReferenceType type = getResolvedTypeX();
    AsmManager asmManager = ((BcelWorld) type.getWorld()).getModelAsAsmManager();
    l = AtAjAttributes.readAj5ClassAttributes(asmManager, javaClass, type, type.getSourceContext(), msgHandler,
        isCodeStyleAspect);
    AjAttribute.Aspect deferredAspectAttribute = processAttributes(l, pointcuts, true);

    if (pointcuts.size() == 0) {
      this.pointcuts = ResolvedPointcutDefinition.NO_POINTCUTS;
    } else {
      this.pointcuts = pointcuts.toArray(new ResolvedPointcutDefinition[pointcuts.size()]);
    }

    resolveAnnotationDeclares(l);

    if (deferredAspectAttribute != null) {
      // we can finally process the aspect and its associated perclause...
      perClause = deferredAspectAttribute.reifyFromAtAspectJ(this.getResolvedTypeX());
    }
    if (isAspect() && !Modifier.isAbstract(getModifiers()) && isGeneric()) {
      msgHandler.handleMessage(MessageUtil.error("The generic aspect '" + getResolvedTypeX().getName()
          + "' must be declared abstract", getResolvedTypeX().getSourceLocation()));
    }

  }
View Full Code Here

    return supportedPrimitives;
  }

  /* for testing */
  IMessageHandler setCustomMessageHandler(IMessageHandler aHandler) {
    IMessageHandler current = getWorld().getMessageHandler();
    getWorld().setMessageHandler(aHandler);
    return current;
  }
View Full Code Here

    return supportedPrimitives;
  }

  /* for testing */
  IMessageHandler setCustomMessageHandler(IMessageHandler aHandler) {
    IMessageHandler current = getWorld().getMessageHandler();
    getWorld().setMessageHandler(aHandler);
    return current;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.IMessageHandler

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.