org.media.mn8
Class MessageFormatter

java.lang.Object
  |
  +--org.media.mn8.MessageFormatter

public class MessageFormatter
extends Object

Class responsible for formatting logging messages. Loading them from the resource bundles and properly formatting them to be displayed.

Version:
$Revision: 1.5 $ $Date: 2002/07/24 23:25:27 $
Author:
Remus Pereni

Method Summary
 String getInterpMessage(String type_id, String message_id, String optional, int line)
          The main method for displaying system interpretation related messages for mn8.
 String getMessage(String type_id, String message_id)
          The main method for displaying system messages for mn8.
 String getMessage(String type_id, String message_id, String optional)
          The main method for displaying system messages for mn8.
 String getMessage(String type_id, String message_id, String optional, String suplementary)
          The main method for displaying system messages for mn8.
 String getMessageInfo(String message_id)
           
static MessageFormatter getReference()
          Method for getting the MessageFormatter instance.
 String getTypeInfo(String type_id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReference

public static MessageFormatter getReference()
Method for getting the MessageFormatter instance. Don't forger that it implements a Singleton pattern.

Returns:
The default instance of MessageFormatter

getMessage

public String getMessage(String type_id,
                         String message_id)
The main method for displaying system messages for mn8.

Parameters:
type_id - The type of the messages (error, warning, ...). This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages.type. has to be inserted before the key in the resource bundle to store such messages types.
   mn8.messages.type.warning=[WARNING]
 
message_id - The id of the messages. This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages. has to be inserted before the key in the resource bundle to store such messages.
   mn8.messages.file_missing=Sorry the file: xxx.jar \n is mising.
 

getMessage

public String getMessage(String type_id,
                         String message_id,
                         String optional)
The main method for displaying system messages for mn8.

Parameters:
type_id - The type of the messages (error, warning, ...). This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages.type. has to be inserted before the key in the resource bundle to store such messages types.
   mn8.messages.type.warning=[WARNING]
 
message_id - The id of the messages. This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages. has to be inserted before the key in the resource bundle to store such messages.
   mn8.messages.file_missing=Sorry the file: xxx.jar \n is mising.
 
optional - Another text to be added to the message. Usualy displayed on the same line.
Returns:
The formatted message.

getInterpMessage

public String getInterpMessage(String type_id,
                               String message_id,
                               String optional,
                               int line)
The main method for displaying system interpretation related messages for mn8.

Parameters:
type_id - The type of the messages (error, warning, ...). This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages.type. has to be inserted before the key in the resource bundle to store such messages types.
   mn8.messages.type.warning=[WARNING]
 
message_id - The id of the messages. This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages. has to be inserted before the key in the resource bundle to store such messages.
   mn8.messages.file_missing=Sorry the file: xxx.jar \n is mising.
 
optional - Another text to be added to the message. Usualy displayed on the same line.
line - The line number of the erroneous message.
Returns:
The formatted message.

getMessage

public String getMessage(String type_id,
                         String message_id,
                         String optional,
                         String suplementary)
The main method for displaying system messages for mn8.

Parameters:
type_id - The type of the messages (error, warning, ...). This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages.type. has to be inserted before the key in the resource bundle to store such messages types.
   mn8.messages.type.warning=[WARNING]
 
message_id - The id of the messages. This is actually an key in the resource bundle where the actual value which will be displayed is hold. mn8.messages. has to be inserted before the key in the resource bundle to store such messages.
   mn8.messages.file_missing=Sorry the file: xxx.jar \n is mising.
 
optional - Another text to be added to the message. Usualy displayed on the same line.
Returns:
The formatted message.

getMessageInfo

public String getMessageInfo(String message_id)

getTypeInfo

public String getTypeInfo(String type_id)


"Copyright © 2000-2002 Internet Multicasting Services, media.org & noLimits Technologies. All Rights Reserved."