Dashboard Builder Commons 6.0.0.Beta4

org.jboss.dashboard.commons.message
Class AbstractMessage

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jboss.dashboard.commons.message.AbstractMessage
All Implemented Interfaces:
Serializable, Message

public abstract class AbstractMessage
extends Exception
implements Message

Base implementation of the Message interface.

See Also:
Serialized Form

Field Summary
protected  Object[] elements
          The process elements involved in the message.
protected  String messageCode
          The message code.
protected  int messageType
          Message type;
 
Fields inherited from interface org.jboss.dashboard.commons.message.Message
ERROR, INFO, WARNING
 
Constructor Summary
AbstractMessage(String messageCode, Object[] elements)
          Default constructor.
 
Method Summary
 boolean equals(Object obj)
           
 Object[] getElements()
          The elements involved in the error (the error context).
 String getMessage(Locale l)
          A string representation of the error for the given locale.
abstract  String getMessage(String messageCode, Locale l)
          To be implemented by the subclass.
 String getMessageCode()
          The error code.
 int getMessageType()
          Get the message type.
 boolean isEditable()
          Returns true if this message refers to an editable element
 void setElements(Object[] elements)
           
 void setMessageCode(String messageCode)
           
 void setMessageType(int messageType)
           
 String toString(Object element, Locale l)
          Process element to string converter.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elements

protected Object[] elements
The process elements involved in the message.


messageCode

protected String messageCode
The message code.


messageType

protected int messageType
Message type;

Constructor Detail

AbstractMessage

public AbstractMessage(String messageCode,
                       Object[] elements)
Default constructor.

Parameters:
messageCode - The code of the message.
elements - The process element that produces the message.
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getElements

public Object[] getElements()
Description copied from interface: Message
The elements involved in the error (the error context).

Specified by:
getElements in interface Message
Returns:
An array of Object instances.

setElements

public void setElements(Object[] elements)
Specified by:
setElements in interface Message

getMessageCode

public String getMessageCode()
Description copied from interface: Message
The error code.

Specified by:
getMessageCode in interface Message

setMessageCode

public void setMessageCode(String messageCode)
Specified by:
setMessageCode in interface Message

getMessageType

public int getMessageType()
Description copied from interface: Message
Get the message type.

Specified by:
getMessageType in interface Message

setMessageType

public void setMessageType(int messageType)

getMessage

public String getMessage(Locale l)
Description copied from interface: Message
A string representation of the error for the given locale.

Specified by:
getMessage in interface Message

toString

public String toString(Object element,
                       Locale l)
Process element to string converter.


isEditable

public boolean isEditable()
Description copied from interface: Message
Returns true if this message refers to an editable element

Specified by:
isEditable in interface Message

getMessage

public abstract String getMessage(String messageCode,
                                  Locale l)
To be implemented by the subclass.


Dashboard Builder Commons 6.0.0.Beta4

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.