Package org.aspectj.bridge
Class MessageWriter
java.lang.Object
org.aspectj.bridge.MessageWriter
- All Implemented Interfaces:
IMessageHandler
- Direct Known Subclasses:
WeavingAdaptor.WeavingAdaptorMessageWriter
An IMessageHandler implementation that writes all to a PrintWriter.
Clients may set this up to throw AbortException for FAIL or ERROR messages.
Subclasses may control whether messages are printed and how they
are rendered by overriding render(IMessage).
-
Field Summary
FieldsFields inherited from interface org.aspectj.bridge.IMessageHandler
SYSTEM_ERR, SYSTEM_OUT, THROW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddontIgnore(IMessage.Kind kind)No-opbooleanhandleMessage(IMessage message)Handle message by printing and (if abortOnFailure) throwing an AbortException if the messages is a failure or an abort (but not for errors).voidignore(IMessage.Kind kind)No-opbooleanisIgnoring(IMessage.Kind kind)Signal clients whether this will ignore messages of a given type.protected String
-
Field Details
-
writer
-
abortOnFailure
protected boolean abortOnFailure
-
-
Constructor Details
-
MessageWriter
-
-
Method Details
-
handleMessage
Handle message by printing and (if abortOnFailure) throwing an AbortException if the messages is a failure or an abort (but not for errors).- Specified by:
handleMessagein interfaceIMessageHandler- Parameters:
message- the IMessage to handle - never null- Returns:
- true if this message was handled by this handler
- Throws:
AbortException- depending on handler logic.- See Also:
IMessageHandler.handleMessage(IMessage)
-
isIgnoring
Description copied from interface:IMessageHandlerSignal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.- Specified by:
isIgnoringin interfaceIMessageHandler- Returns:
- true if this handler is ignoring all messages of this type
- See Also:
IMessageHandler.isIgnoring(org.aspectj.bridge.IMessage.Kind)
-
dontIgnore
No-op- Specified by:
dontIgnorein interfaceIMessageHandler- Parameters:
kind-- See Also:
IMessageHandler.isIgnoring(org.aspectj.bridge.IMessage.Kind)
-
ignore
No-op- Specified by:
ignorein interfaceIMessageHandler- Parameters:
kind-- See Also:
IMessageHandler.ignore(org.aspectj.bridge.IMessage.Kind)
-
render
- Returns:
- null to not print, or message rendering (including newlines)
-