Top Description Fields Methods
org.aspectj.bridge

public Interface IMessageHandler

Known Direct Subinterfaces
org.aspectj.bridge.IMessageHolder
Known Direct Implementers
org.aspectj.bridge.MessageUtil.KindSelector, org.aspectj.bridge.MessageWriter, org.aspectj.bridge.context.PinpointingMessageHandler, org.aspectj.weaver.loadtime.DefaultMessageHandler, org.aspectj.weaver.reflect.ReflectionWorld.ExceptionBasedMessageHandler, org.aspectj.bridge.CountingMessageHandler
Imports
java.io.PrintWriter

Handle messages, logging and/or aborting as appropriate. Implementations define which messages are logged and whether the handler aborts the process. For messages that are costly to construct, clients may query isIgnoring(IMessage.Kind) to avoid construction if the message will be ignored. Clients passing messages to an IMessageHandler should not interfere with aborts by catching AbortException unless otherwise required by their logic or the message handler.

Field Summary

Modifier and TypeField and Description
public static final IMessageHandler
SYSTEM_ERR

print all to System.err and throw AbortException on failure or abort messages

public static final IMessageHandler
SYSTEM_OUT

print all to System.out but do not throw AbortException on failure or abort messages

public static final IMessageHandler
THROW

Throw exceptions for anything with ERROR or greater severity

Method Summary

Modifier and TypeMethod and Description
public void
dontIgnore(IMessage.Kind kind)

Allow fine grained configuration after initialization.

public boolean

Returns:

true if this message was handled by this handler
handleMessage
(IMessage
the IMessage to handle - never null
message
)

Handle message, by reporting and/or throwing an AbortException.

public void
ignore(IMessage.Kind kind)

Allow fine grained configuration after initialization.

public boolean

Returns:

true if this handler is ignoring all messages of this type
isIgnoring
(IMessage.Kind kind)

Signal clients whether this will ignore messages of a given type.

Field Detail

SYSTEM_ERRback to summary
public static final IMessageHandler SYSTEM_ERR

print all to System.err and throw AbortException on failure or abort messages

SYSTEM_OUTback to summary
public static final IMessageHandler SYSTEM_OUT

print all to System.out but do not throw AbortException on failure or abort messages

THROWback to summary
public static final IMessageHandler THROW

Throw exceptions for anything with ERROR or greater severity

Method Detail

dontIgnoreback to summary
public void dontIgnore(IMessage.Kind kind)

Allow fine grained configuration after initialization. Minaly used in LTW. Most of the implementation can have this method be a no-op.

handleMessageback to summary
public boolean handleMessage(IMessage message) throws AbortException

Handle message, by reporting and/or throwing an AbortException.

Parameters
message:IMessage

the IMessage to handle - never null

Returns:boolean

true if this message was handled by this handler

Exceptions
AbortException:
depending on handler logic.
IllegalArgumentException:
if message is null
ignoreback to summary
public void ignore(IMessage.Kind kind)

Allow fine grained configuration after initialization.

isIgnoringback to summary
public boolean isIgnoring(IMessage.Kind kind)

Signal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.

Returns:boolean

true if this handler is ignoring all messages of this type