|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aspectj.bridge.MessageHandler
public class MessageHandler
This handler accumulates messages. To control messages accumulated, clients can ignore messages of a given kind, or install a listener/interceptor. The interceptor handles all messages (even null) first, and can halt further processing/accumlation by returning true. Clients can obtain messages accumulated using the get... methods. XXX this does not permit messages to be removed.
Field Summary |
---|
Fields inherited from interface org.aspectj.bridge.IMessageHolder |
---|
EQUAL, ORGREATER |
Fields inherited from interface org.aspectj.bridge.IMessageHandler |
---|
SYSTEM_ERR, SYSTEM_OUT, THROW |
Constructor Summary | |
---|---|
MessageHandler()
same as MessageHandler(false) |
|
MessageHandler(boolean accumulateOnly)
|
Method Summary | |
---|---|
void |
clearMessages()
Clear the messages without changing other behavior. |
void |
dontIgnore(IMessage.Kind kind)
Remove a message kind from the list of those ignored from now on. |
IMessage[] |
getErrors()
|
IMessage[] |
getMessages(IMessage.Kind kind,
boolean orGreater)
Get all messages or those of a specific kind. |
java.util.List<IMessage> |
getUnmodifiableListView()
|
IMessage[] |
getWarnings()
|
boolean |
handleMessage(IMessage message)
This implementation accumulates message. |
boolean |
hasAnyMessage(IMessage.Kind kind,
boolean orGreater)
Tell whether this holder has any message of this kind (optionally or greater). |
void |
ignore(IMessage.Kind kind)
Set a message kind to be ignored from now on |
void |
init()
Initialize this, removing any messages accumulated, kinds being ignored, or interceptor. |
void |
init(boolean accumulateOnly)
Initialize this, removing any messages accumulated, kinds being ignored, or interceptor. |
boolean |
isIgnoring(IMessage.Kind kind)
Signal clients whether this will ignore messages of a given type. |
int |
numMessages(IMessage.Kind kind,
boolean orGreater)
Count the messages currently held by this holder. |
void |
setInterceptor(IMessageHandler interceptor)
Set the interceptor which gets any message before we process it. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MessageHandler()
public MessageHandler(boolean accumulateOnly)
accumulateOnly
- the result of handleMessage (i.e., if true, then only accumulate messages - stop processingMethod Detail |
---|
public void init()
public void init(boolean accumulateOnly)
accumulateOnly
- boolean value returned from handleMessage after accumulating in listpublic void clearMessages()
clearMessages
in interface IMessageHolder
public boolean handleMessage(IMessage message)
handleMessage
in interface IMessageHandler
message
- the IMessage to handle - never null
IMessageHandler.handleMessage(IMessage)
public boolean isIgnoring(IMessage.Kind kind)
IMessageHandler
isIgnoring
in interface IMessageHandler
ignore(IMessage.Kind)
,
org.aspectj.bridge.IMessageHandler#isIgnoring(Kind)
public void ignore(IMessage.Kind kind)
ignore
in interface IMessageHandler
public void dontIgnore(IMessage.Kind kind)
dontIgnore
in interface IMessageHandler
public boolean hasAnyMessage(IMessage.Kind kind, boolean orGreater)
IMessageHolder
hasAnyMessage
in interface IMessageHolder
kind
- the IMessage.Kind to check for - accept any if nullorGreater
- if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
org.aspectj.bridge.IMessageHolder#hasAnyMessage(Kind, boolean)
public int numMessages(IMessage.Kind kind, boolean orGreater)
IMessageHolder
numMessages
in interface IMessageHolder
kind
- the IMessage.Kind expected, or null for all messagesorGreater
- if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
public java.util.List<IMessage> getUnmodifiableListView()
getUnmodifiableListView
in interface IMessageHolder
IMessageHolder.getUnmodifiableListView()
public IMessage[] getMessages(IMessage.Kind kind, boolean orGreater)
getMessages
in interface IMessageHolder
kind
- the IMessage.Kind expected, or null for all messagesorGreater
- if true, also get any greater than the target kind as determined by IMessage.Kind.COMPARATOR
public IMessage[] getErrors()
public IMessage[] getWarnings()
public void setInterceptor(IMessageHandler interceptor)
interceptor
- the IMessageHandler passed the message. Pass null to remove the old interceptor.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |