Class Main.MessagePrinter

java.lang.Object
org.aspectj.tools.ajc.Main.MessagePrinter
All Implemented Interfaces:
IMessageHandler
Direct Known Subclasses:
Main.LogModeMessagePrinter
Enclosing class:
Main

public static class Main.MessagePrinter extends Object implements IMessageHandler
interceptor IMessageHandler to print as we go. This formats all messages to the user.
  • Field Details

  • Constructor Details

    • MessagePrinter

      protected MessagePrinter(boolean verbose)
  • Method Details

    • handleMessage

      public boolean handleMessage(IMessage message)
      Print errors and warnings to System.err, and optionally info to System.out, rendering message String only.
      Specified by:
      handleMessage in interface IMessageHandler
      Parameters:
      message - the IMessage to handle - never null
      Returns:
      false always
    • render

      public static String render(IMessage message)
      Render message differently. If abort, then prefix stack trace with feedback request. If the actual message is empty, then use toString on the whole. Prefix message part with file:line; If it has context, suffix message with context.
      Parameters:
      message - the IMessage to render
      Returns:
      String rendering IMessage (never null)
    • isIgnoring

      public boolean isIgnoring(IMessage.Kind kind)
      Description copied from interface: IMessageHandler
      Signal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.
      Specified by:
      isIgnoring in interface IMessageHandler
      Returns:
      true if this handler is ignoring all messages of this type
    • dontIgnore

      public void dontIgnore(IMessage.Kind kind)
      No-op
      Specified by:
      dontIgnore in interface IMessageHandler
      Parameters:
      kind -
      See Also:
    • getStreamFor

      protected PrintStream getStreamFor(IMessage.Kind kind)
      Returns:
      System.err for FAIL, ABORT, ERROR, and WARNING, System.out for INFO if -verbose and WEAVEINFO if -showWeaveInfo.
    • ignore

      public void ignore(IMessage.Kind kind)
      No-op
      Specified by:
      ignore in interface IMessageHandler
      Parameters:
      kind -
      See Also: