at.dms.compiler.tools.common
Class MessageDescription

java.lang.Object
  extended by at.dms.compiler.tools.common.MessageDescription

public class MessageDescription
extends 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
           
static int LVL_ERROR
           
static int LVL_INFO
           
static int LVL_NOTICE
           
static int LVL_UNDEFINED
           
static int LVL_WARNING
           
 
Constructor Summary
MessageDescription(String format, String reference, int level)
          Constructs a message description
 
Method Summary
 String format(Object[] parameters)
          Returns a string explaining the error.
 String getFormat()
          Returns the message format.
 int getLevel()
          Returns the level of this message.
 String getReference()
          Returns a reference to a documentation on 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
See Also:
Constant Field Values

LVL_ERROR

public static final int LVL_ERROR
See Also:
Constant Field Values

LVL_CAUTION

public static final int LVL_CAUTION
See Also:
Constant Field Values

LVL_WARNING

public static final int LVL_WARNING
See Also:
Constant Field Values

LVL_NOTICE

public static final int LVL_NOTICE
See Also:
Constant Field Values

LVL_INFO

public static final int LVL_INFO
See Also:
Constant Field Values
Constructor Detail

MessageDescription

public MessageDescription(String format,
                          String reference,
                          int level)
Constructs a message description

Parameters:
format - the textual message format (with placeholders)
reference - the document describing the reason for this message
level - the severity level of this message
Method Detail

getFormat

public String getFormat()
Returns the message format.


getReference

public String getReference()
Returns a reference to a documentation on this message.


getLevel

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


format

public String format(Object[] parameters)
Returns a string explaining the error.

Parameters:
parameters - the array of parameters