org.jdtaus.core.text
Class MessageEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.jdtaus.core.text.MessageEvent
All Implemented Interfaces:
Serializable

public class MessageEvent
extends EventObject

Event holding messages.

Version:
$Id: MessageEvent.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
MessageEventSource, Serialized Form

Field Summary
static int ERROR
          Event constant for error messages.
static int INFORMATION
          Event constant for information messages.
static int NOTIFICATION
          Event constant for notification messages.
static int WARNING
          Event constant for warning messages.
 
Constructor Summary
MessageEvent(Object source, Message[] messages, int type)
          Creates a new MessageEvent instance taking multiple messages.
MessageEvent(Object source, Message message, int type)
          Creates a new MessageEvent instance taking a single message.
 
Method Summary
 Message[] getMessages()
          Getter for property messages.
 int getType()
          Getter for property type.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Event constant for error messages.

See Also:
Constant Field Values

INFORMATION

public static final int INFORMATION
Event constant for information messages.

See Also:
Constant Field Values

NOTIFICATION

public static final int NOTIFICATION
Event constant for notification messages.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Event constant for warning messages.

See Also:
Constant Field Values
Constructor Detail

MessageEvent

public MessageEvent(Object source,
                    Message[] messages,
                    int type)
Creates a new MessageEvent instance taking multiple messages.

Parameters:
source - the source of the new event.
messages - the messages for the new event.
type - constant indicating the type of the events' messages.
Throws:
NullPointerException - if messages is null.
IllegalArgumentException - if source is null or type is not equal to one of the constants INFORMATION, NOTIFICATION, WARNING or ERROR or the length of messages is zero.

MessageEvent

public MessageEvent(Object source,
                    Message message,
                    int type)
Creates a new MessageEvent instance taking a single message.

Parameters:
source - the source of the new event.
message - the message for the new event.
type - constant indicating the type of the events' messages.
Throws:
NullPointerException - if message is null.
IllegalArgumentException - if source is null or type is not equal to one of the constants INFORMATION, NOTIFICATION, WARNING or ERROR.
Method Detail

getMessages

public final Message[] getMessages()
Getter for property messages.

Returns:
the messages of the event.

getType

public final int getType()
Getter for property type.

Returns:
the type of the events' messages.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class EventObject
Returns:
a string representation of the object.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.