org.aspectj.tools.ajc
Class Main.MessagePrinter

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

public static class Main.MessagePrinter
extends java.lang.Object
implements IMessageHandler

interceptor IMessageHandler to print as we go. This formats all messages to the user.


Field Summary
static IMessageHandler TERSE
           
static IMessageHandler VERBOSE
           
 
Fields inherited from interface org.aspectj.bridge.IMessageHandler
SYSTEM_ERR, SYSTEM_OUT, THROW
 
Constructor Summary
protected Main.MessagePrinter(boolean verbose)
           
 
Method Summary
 void dontIgnore(IMessage.Kind kind)
          No-op
protected  java.io.PrintStream getStreamFor(IMessage.Kind kind)
           
 boolean handleMessage(IMessage message)
          Print errors and warnings to System.err, and optionally info to System.out, rendering message String only.
 void ignore(IMessage.Kind kind)
          No-op
 boolean isIgnoring(IMessage.Kind kind)
          Signal clients whether this will ignore messages of a given type.
static java.lang.String render(IMessage message)
          Render message differently.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static final IMessageHandler VERBOSE

TERSE

public static final IMessageHandler TERSE
Constructor Detail

Main.MessagePrinter

protected Main.MessagePrinter(boolean verbose)
Method Detail

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 java.lang.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:
IMessageHandler.isIgnoring(org.aspectj.bridge.IMessage.Kind)

getStreamFor

protected java.io.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:
IMessageHandler.ignore(org.aspectj.bridge.IMessage.Kind)