net.sf.clirr.core
Class MessageManager

java.lang.Object
  extended by net.sf.clirr.core.MessageManager

public final class MessageManager
extends java.lang.Object

Class which manages API Difference messages, including expanding message codes into strings and descriptions.


Method Summary
 void addMessage(Message msg)
          Add a message to the list of known messages.
 void checkUnique()
          Verify that the list of known messages contains no two objects with the same numeric message id.
static MessageManager getInstance()
          Return the singleton instance of this class.
 java.util.Collection getMessages()
          Return the complete set of registered messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MessageManager getInstance()
Return the singleton instance of this class.


addMessage

public void addMessage(Message msg)
Add a message to the list of known messages.


checkUnique

public void checkUnique()
Verify that the list of known messages contains no two objects with the same numeric message id. This method is expected to be called from the unit tests, so that if a developer adds a new message and accidentally uses the message id of an existing message object, then this will be reported as an error.

Throws:
java.lang.IllegalArgumentException - if any duplicate id is found.

getMessages

public java.util.Collection getMessages()
Return the complete set of registered messages.



Copyright © 2003-2005 Lars Kühne. All Rights Reserved.