Class MavenMessageHandler

java.lang.Object
org.aspectj.bridge.MessageHandler
org.codehaus.mojo.aspectj.MavenMessageHandler
All Implemented Interfaces:
org.aspectj.bridge.IMessageHandler, org.aspectj.bridge.IMessageHolder

public class MavenMessageHandler extends org.aspectj.bridge.MessageHandler
MessageHandler implementation which uses the standard Maven Log to emit messages from the AJC process. For warnings and error messages from the AJC, the message detail (containing information about class and line number location) is emitted as well.
Author:
Kaare Nilsen, Lennart Jörelid, jGuru Europe AB
  • Field Summary

    Fields inherited from class org.aspectj.bridge.MessageHandler

    handleMessageResult, ignoring, interceptor, messages

    Fields inherited from interface org.aspectj.bridge.IMessageHandler

    SYSTEM_ERR, SYSTEM_OUT, THROW

    Fields inherited from interface org.aspectj.bridge.IMessageHolder

    EQUAL, ORGREATER
  • Constructor Summary

    Constructors
    Constructor
    Description
    MavenMessageHandler(org.apache.maven.plugin.logging.Log log)
    Constructs a MessageHandler with a Maven plugin logger, and emitting detailed information for all AJC message kinds the DEFAULT_DETAIL_TYPES List.
    MavenMessageHandler(org.apache.maven.plugin.logging.Log log, List<org.aspectj.bridge.IMessage.Kind> showDetailsForMessageKindList)
    Constructs a MessageHandler with a Maven plugin logger.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    handleMessage(org.aspectj.bridge.IMessage message)
    Copies output from the supplied message onto the active Maven Log.

    Methods inherited from class org.aspectj.bridge.MessageHandler

    clearMessages, dontIgnore, getErrors, getMessages, getUnmodifiableListView, getWarnings, hasAnyMessage, ignore, init, init, isIgnoring, numMessages, setInterceptor, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MavenMessageHandler

      public MavenMessageHandler(org.apache.maven.plugin.logging.Log log, List<org.aspectj.bridge.IMessage.Kind> showDetailsForMessageKindList)
      Constructs a MessageHandler with a Maven plugin logger.
      Parameters:
      log - The active Maven Log.
      showDetailsForMessageKindList - A List holding all AJC message types for which this MavenMessageHandler should emit details onto the Maven log (i.e. class name, line/row number etc.)
    • MavenMessageHandler

      public MavenMessageHandler(org.apache.maven.plugin.logging.Log log)
      Constructs a MessageHandler with a Maven plugin logger, and emitting detailed information for all AJC message kinds the DEFAULT_DETAIL_TYPES List.
      Parameters:
      log - The active Maven Log.
  • Method Details

    • handleMessage

      public boolean handleMessage(org.aspectj.bridge.IMessage message)
      Copies output from the supplied message onto the active Maven Log. If the message type (i.e. message.getKind()) is listed in the showDetailsForMessageKindList List, the message is prefixed with location details (Class, row/line number etc.) as well.

      Specified by:
      handleMessage in interface org.aspectj.bridge.IMessageHandler
      Overrides:
      handleMessage in class org.aspectj.bridge.MessageHandler