IMC Epclient 5.0.3

at.spardat.enterprise.exc
Class NotificationList

java.lang.Object
  extended byat.spardat.enterprise.exc.Notification
      extended byat.spardat.enterprise.exc.NotificationList
All Implemented Interfaces:
INotification, java.io.Serializable

public class NotificationList
extends Notification

A NotificationList is a Notification which acts as container for other notifications. Therefore, this class enriches Notification with the capability to add other notifications to this, see add(INotification) and to iterate over the contained Notifications, see iterator().

Since the contained INotifications may also be NotificationLists, a NotificationList may hold a tree of INotifications.

The type of the notification may be explicitely set via setType(int). If no type is set, the type is derived from the most severe type of the childs. The order of type severity is (from most severe to least severe): T_ERROR, T_WARNING, T_INFORMATION, T_QUESTION.

Author:
YSD, 22.05.2003 09:27:54
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface at.spardat.enterprise.exc.INotification
R_ABORT, R_ABORT_RETRY_IGNORE, R_CANCEL, R_IGNORE, R_NO, R_OK, R_OK_CANCEL, R_RETRY, R_RETRY_CANCEL, R_YES, R_YES_NO, R_YES_NO_CANCEL, T_ERROR, T_INFORMATION, T_QUESTION, T_WARNING
 
Constructor Summary
NotificationList()
          Constructs this with default values.
NotificationList(java.lang.String message)
          Constructs and sets the message to the provided value.
NotificationList(java.lang.String message, java.util.Locale l, java.lang.Object[] params)
          Constructs and sets the message from a format string as defined in java.text.MessageFormat.
NotificationList(java.lang.String messageFmt, java.lang.Object param1)
          Constructs and sets the message of this from a one parameter java.text.MessageFormat compatible string.
NotificationList(java.lang.String messageFmt, java.lang.Object param1, java.lang.Object param2)
          Constructs and sets the message of this from a two parameter java.text.MessageFormat compatible string.
 
Method Summary
 void add(INotification notification)
          Adds a provided notification to the end of the list of notifications.
 int getChildCount()
          Returns the number of Notifications contained in this that are direct childs of this.
 int getNotificationCount()
          Returns the number of Notifications contained in the subtree rooted at this that are not NotificationLists.
 int getType()
          Returns the type.
 java.util.Iterator iterator()
          Returns an Iterator to iterate over the contained Notifications.
 Notification setType(int type)
          Sets the type which may be one of the T_-constants.
 
Methods inherited from class at.spardat.enterprise.exc.Notification
getCode, getMessage, getReaction, getShortMessage, setCode, setMessage, setMessage, setMessage, setMessage, setReaction, setShortMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationList

public NotificationList(java.lang.String messageFmt,
                        java.lang.Object param1,
                        java.lang.Object param2)
Constructs and sets the message of this from a two parameter java.text.MessageFormat compatible string.

Parameters:
messageFmt - format string as defined in java.text.MessageFormat.
param1 - first message parameter
param2 - second message parameter

NotificationList

public NotificationList(java.lang.String messageFmt,
                        java.lang.Object param1)
Constructs and sets the message of this from a one parameter java.text.MessageFormat compatible string.

Parameters:
messageFmt - format string as defined in java.text.MessageFormat.
param1 - message parameter

NotificationList

public NotificationList(java.lang.String message)
Constructs and sets the message to the provided value.

Parameters:
message - the message to set.

NotificationList

public NotificationList()
Constructs this with default values. Use one of the setMessage-methods to set the message for this compound notification.


NotificationList

public NotificationList(java.lang.String message,
                        java.util.Locale l,
                        java.lang.Object[] params)
Constructs and sets the message from a format string as defined in java.text.MessageFormat. The required parameters must be contained in the params array.

Parameters:
message - format string as defined in java.text.MessageFormat or plain text, depending on params.
l - a java.util.Locale to format locale dependent data types or null if the params do not contain local specifics.
params - the parameters of the message. If params is null, message is not to considered to be a MessageFormat-string.
Method Detail

setType

public Notification setType(int type)
Sets the type which may be one of the T_-constants. If this method is not called, the type is defined by the contained Notifications with the highest type-severity.

Overrides:
setType in class Notification
Returns:
this
See Also:
INotification.getType()

getType

public int getType()
Returns the type. Either it has been explicitely set, then the one that has been set is returned. Otherwise, the most severe type of the childs is returned.

Specified by:
getType in interface INotification
Overrides:
getType in class Notification
Returns:
one of the constants with praefix T_ in INotification.
See Also:
INotification.getType()

getChildCount

public int getChildCount()
Returns the number of Notifications contained in this that are direct childs of this.


getNotificationCount

public int getNotificationCount()
Returns the number of Notifications contained in the subtree rooted at this that are not NotificationLists.


iterator

public java.util.Iterator iterator()
Returns an Iterator to iterate over the contained Notifications.


add

public void add(INotification notification)
Adds a provided notification to the end of the list of notifications. Warning: If the provided notification is a NotificationList itself, the list gets tree structured.


IMC Epclient 5.0.3