com.cc.framework.message
Class MessageResource

java.lang.Object
  extended bycom.cc.framework.message.MessageResource

public class MessageResource
extends java.lang.Object

Class MessageResource

Since:
1.0
Version:
$Revision: 1.11 $
Author:
Harald Schulz

Field Summary
private  int code
          Unique message code
static java.lang.String DEF_LANGUAGE
          Field DEF_LANGUAGE
private  java.lang.String name
          Symbolic name for the message
private  Severity severity
          Severity assigned to the message
private  java.util.Hashtable text
          Message
 
Constructor Summary
MessageResource()
          Constructor for MessageResource
MessageResource(int code, java.lang.String name, Severity severity)
          Constructor for MessageResource
 
Method Summary
 void addText(java.lang.String language, java.lang.String text)
          Adds a message text for the specified language
 java.lang.String expand(java.lang.String language, java.lang.Object param1)
          Replaces the placeholders in the Message with the specified Parameter
 java.lang.String expand(java.lang.String language, java.lang.Object[] params)
          Replaces the placeholders in the Message with the specified Parameters
 java.lang.String expand(java.lang.String language, java.lang.Object param1, java.lang.Object param2)
          Replaces the placeholders in the Message with the specified Parameters
 java.lang.String expand(java.lang.String language, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
          Replaces the placeholders in the Message with the specified Parameters
 int getCode()
          Returns the Code
 java.lang.String getName()
          Returns the Name
 Severity getSeverity()
          Returns the severity
 java.lang.String getText()
          Returns the message text for the default language
 java.lang.String getText(java.lang.String language)
          Returns the message text for the specified language
 java.lang.String toString()
          Creates a String representation for the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEF_LANGUAGE

public static final java.lang.String DEF_LANGUAGE
Field DEF_LANGUAGE

See Also:
Constant Field Values

code

private int code
Unique message code


name

private java.lang.String name
Symbolic name for the message


text

private java.util.Hashtable text
Message


severity

private Severity severity
Severity assigned to the message

Constructor Detail

MessageResource

public MessageResource()
Constructor for MessageResource


MessageResource

public MessageResource(int code,
                       java.lang.String name,
                       Severity severity)
Constructor for MessageResource

Parameters:
code - the message code
name - the symbolic name of the message
severity - the severity assigned for the message
Method Detail

addText

public void addText(java.lang.String language,
                    java.lang.String text)
Adds a message text for the specified language

Parameters:
language - the language of the message text
text - the message text

expand

public java.lang.String expand(java.lang.String language,
                               java.lang.Object[] params)
Replaces the placeholders in the Message with the specified Parameters

Parameters:
language - the language
params - the parameters to replace in the message text
Returns:
String

expand

public java.lang.String expand(java.lang.String language,
                               java.lang.Object param1)
Replaces the placeholders in the Message with the specified Parameter

Parameters:
language - the language of the message
param1 - the parameter to replace in the message text
Returns:
String

expand

public java.lang.String expand(java.lang.String language,
                               java.lang.Object param1,
                               java.lang.Object param2)
Replaces the placeholders in the Message with the specified Parameters

Parameters:
language - the language of the message
param1 - the parameter to replace in the message text
param2 - the parameter to replace in the message text
Returns:
String

expand

public java.lang.String expand(java.lang.String language,
                               java.lang.Object param1,
                               java.lang.Object param2,
                               java.lang.Object param3)
Replaces the placeholders in the Message with the specified Parameters

Parameters:
language - the language of the message
param1 - the parameter to replace in the message text
param2 - the parameter to replace in the message text
param3 - the parameter to replace in the message text
Returns:
String

getCode

public int getCode()
Returns the Code

Returns:
String

toString

public java.lang.String toString()
Creates a String representation for the message

Returns:
String

getName

public java.lang.String getName()
Returns the Name

Returns:
String

getSeverity

public Severity getSeverity()
Returns the severity

Returns:
Severity

getText

public java.lang.String getText(java.lang.String language)
Returns the message text for the specified language

Parameters:
language - the language
Returns:
String

getText

public java.lang.String getText()
Returns the message text for the default language

Returns:
String


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.