Package org.aspectj.bridge

Examples of org.aspectj.bridge.MessageHandler


   * @return number of messages reported with level ERROR or above
   * @throws any unchecked exceptions the compiler does
   */
  public static int bareMain(String[] args, boolean useSystemExit, List fails, List errors, List warnings, List infos) {
    Main main = new Main();
    MessageHandler holder = new MessageHandler();
    main.setHolder(holder);
    try {
      main.runMain(args, useSystemExit);
    } finally {
      readMessages(holder, IMessage.FAIL, true, fails);
      readMessages(holder, IMessage.ERROR, false, errors);
      readMessages(holder, IMessage.WARNING, false, warnings);
      readMessages(holder, IMessage.INFO, false, infos);
    }
    return holder.numMessages(IMessage.ERROR, true);
  }
View Full Code Here


        CompilationAndWeavingContext.setMultiThreaded(true);
      }
    } catch (Exception e) {
      // silent
    }
    ourHandler = new MessageHandler(true);
  }
View Full Code Here

    protected int spoon() throws BuildException {
        //if (version) version(null);
        int result = -1;
        final IMessageHolder holder;
        {
        MessageHandler handler = new MessageHandler();
        if (!verbose) {
          handler.ignore(IMessage.INFO);
        }
        final IMessageHandler delegate
          = verbose ? MessagePrinter.VERBOSE: MessagePrinter.TERSE;
      handler.setInterceptor(delegate);
      holder = handler;
        }
        try {
            String[] args = cmd.getCommandline();
            // XXX avoid rendering if not verbosely logging?
View Full Code Here

      log("maxMem ignored unless forked: " + maxMem, Project.MSG_WARN);
    }
    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 {
      numPreviousErrors = holder.numMessages(IMessage.ERROR, true);
    }
View Full Code Here

    protected int spoon() throws BuildException {
        //if (version) version(null);
        int result = -1;
        final IMessageHolder holder;
        {
        MessageHandler handler = new MessageHandler();
        if (!verbose) {
          handler.ignore(IMessage.INFO);
        }
        final IMessageHandler delegate
          = verbose ? MessagePrinter.VERBOSE: MessagePrinter.TERSE;
      handler.setInterceptor(delegate);
      holder = handler;
        }
        try {
            String[] args = cmd.getCommandline();
            // XXX avoid rendering if not verbosely logging?
View Full Code Here

    List fails,
    List errors,
    List warnings,
    List infos) {
    Main main = new Main();
    MessageHandler holder = new MessageHandler();
    main.setHolder(holder);
    try {
      main.runMain(args, useSystemExit);
    } finally {
      readMessages(holder, IMessage.FAIL, true, fails);
      readMessages(holder, IMessage.ERROR, false, errors);
      readMessages(holder, IMessage.WARNING, false, warnings);
      readMessages(holder, IMessage.INFO, false, infos);
    }
    return holder.numMessages(IMessage.ERROR, true);
  }
View Full Code Here

    private Runnable completionRunner;
   
    public Main() {
        controller = new CommandController();
        commandName = ReflectionFactory.ECLIPSE;
        ourHandler = new MessageHandler(true);
    }   
View Full Code Here

    private List compileInProcess( AjBuildConfig buildConfig )
        throws CompilerException
    {

        MessageHandler messageHandler = new MessageHandler();

        AjBuildManager manager = new AjBuildManager( messageHandler );

        try
        {
            manager.batchBuild( buildConfig, messageHandler );
        }
        catch ( AbortException e )
        {
            throw new CompilerException( "Unknown error while compiling", e );
        }
        catch ( IOException e )
        {
            throw new CompilerException( "Unknown error while compiling", e );
        }

        // We need the location of the maven so we have a couple of options
        // here.
        //
        // The aspectjrt jar is something this component needs to function so we
        // can either
        // bake it into the plugin and retrieve it somehow or use a system
        // property or we
        // could pass in a set of parameters in a Map.

        boolean errors = messageHandler.hasAnyMessage( IMessage.ERROR, true );

        List messages = new ArrayList();
        if ( errors )
        {
            IMessage[] errorMessages = messageHandler.getMessages( IMessage.ERROR, true );

            for ( int i = 0; i < errorMessages.length; i++ )
            {
                IMessage m = errorMessages[i];
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.MessageHandler

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.