com.stratelia.silverpeas.silvertrace
Class MsgTrace

java.lang.Object
  extended by com.stratelia.silverpeas.silvertrace.MsgTrace

public final class MsgTrace
extends Object

Class declaration

Version:
%I%, %G%
Author:
Thierry Leroi

Constructor Summary
MsgTrace()
          Constructor declaration
 
Method Summary
static boolean getBooleanProperty(Properties theProps, String propertyName, boolean defaultValue)
          Reads a boolean property and return it's boolean value
static boolean getBooleanProperty(ResourceBundle resource, String propertyName, boolean defaultValue)
          Reads a boolean property and return it's boolean value
 String getMsgString(String messageID)
          Return the string associated to the message ID
 String getMsgString(String messageID, String language)
          Return the string associated to the message ID
 List<File> getPropertyFiles(String pathFiles, String suffix)
          Method declaration
 void initFromProperties(String filePath, String language)
          Initialize all trace messages from a path containing the module's messages files
protected  boolean isDefaultLanguage(String language)
          Method declaration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsgTrace

public MsgTrace()
Constructor declaration

See Also:
Method Detail

initFromProperties

public void initFromProperties(String filePath,
                               String language)
Initialize all trace messages from a path containing the module's messages files

Parameters:
filePath - the path to the ancestor of the property files that contains modules' messages files
language - name of the sub directory containing the error messages (empty = default = "en" = english)
See Also:

getMsgString

public String getMsgString(String messageID)
Return the string associated to the message ID

Parameters:
messageID - looks like "modulename.MSG_..."
Returns:
the message string (could be language dependant)
See Also:

getMsgString

public String getMsgString(String messageID,
                           String language)
Return the string associated to the message ID

Parameters:
messageID - looks like "modulename.MSG_..."
Returns:
the message string (could be language dependant)
See Also:

getBooleanProperty

public static boolean getBooleanProperty(Properties theProps,
                                         String propertyName,
                                         boolean defaultValue)
Reads a boolean property and return it's boolean value

Parameters:
theProps - the Properties object
propertyName - the name of the property to test
defaultValue - the default value to set to the property if it doesn't exist
Returns:
true/false
See Also:

getBooleanProperty

public static boolean getBooleanProperty(ResourceBundle resource,
                                         String propertyName,
                                         boolean defaultValue)
Reads a boolean property and return it's boolean value

Parameters:
resource - the Resource object
propertyName - the name of the property to test
defaultValue - the default value to set to the property if it doesn't exist
Returns:
true/false
See Also:

getPropertyFiles

public List<File> getPropertyFiles(String pathFiles,
                                   String suffix)
Method declaration

Parameters:
pathFiles -
suffix -
Returns:
See Also:

isDefaultLanguage

protected boolean isDefaultLanguage(String language)
Method declaration

Parameters:
language -
Returns:
See Also:


Copyright © 2016 Silverpeas. All Rights Reserved.