at.dms.util
Class MessageDescription

java.lang.Object
  |
  +--at.dms.util.MessageDescription

public class MessageDescription
extends java.lang.Object

This class defines message descriptions (errors, warnings, notices, ...) The message format is a text message with placeholders for its arguments of the form {0}, {1}, ... . Each placeholder will be replaced by the string representation of the corresponding argument.


Field Summary
static int LVL_CAUTION
          Message severity level: caution.
static int LVL_ERROR
          Message severity level: error.
static int LVL_INFO
          Message severity level: info.
static int LVL_NOTICE
          Message severity level: notice.
static int LVL_UNDEFINED
          Message severity level: Bad level or level not specified.
static int LVL_WARNING_1
          Message severity level: warning level 1.
static int LVL_WARNING_2
          Message severity level: warning level 2.
static int LVL_WARNING_3
          Message severity level: warning level 3.
 
Constructor Summary
MessageDescription(java.lang.String format, java.lang.String jlsReference, int level)
          Constructs a message description
 
Method Summary
 java.lang.String format(java.lang.Object[] parameters)
          Returns a string explaining the error.
 java.lang.String getFormat()
          Returns the message format.
 int getLevel()
          Returns the severity level of this message.
static java.lang.String getLevelText(int level)
          Returns a textual description of the severity level.
 java.lang.String getReference()
          Returns a text that refers to the Java Language Specification or other documentation that provides background about this message.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LVL_UNDEFINED

public static final int LVL_UNDEFINED
Message severity level: Bad level or level not specified.

LVL_ERROR

public static final int LVL_ERROR
Message severity level: error.

LVL_CAUTION

public static final int LVL_CAUTION
Message severity level: caution.

LVL_WARNING_1

public static final int LVL_WARNING_1
Message severity level: warning level 1.

LVL_WARNING_2

public static final int LVL_WARNING_2
Message severity level: warning level 2.

LVL_WARNING_3

public static final int LVL_WARNING_3
Message severity level: warning level 3.

LVL_NOTICE

public static final int LVL_NOTICE
Message severity level: notice.

LVL_INFO

public static final int LVL_INFO
Message severity level: info.
Constructor Detail

MessageDescription

public MessageDescription(java.lang.String format,
                          java.lang.String jlsReference,
                          int level)
Constructs a message description
Parameters:
format - the textual message format (with placeholders)
jlsReference - the document describing the reason for this message
level - the severity level of this message
Method Detail

getFormat

public java.lang.String getFormat()
Returns the message format.

getReference

public java.lang.String getReference()
Returns a text that refers to the Java Language Specification or other documentation that provides background about this message.

getLevel

public int getLevel()
Returns the severity level of this message.

getLevelText

public static java.lang.String getLevelText(int level)
Returns a textual description of the severity level.

format

public java.lang.String format(java.lang.Object[] parameters)
Returns a string explaining the error.
Parameters:
parameters - the array of parameters