org.ploin.pmf
Interface IPropertiesLoader

All Known Implementing Classes:
PropertiesLoader

public interface IPropertiesLoader

Description: This class is responsible for reading properties files

                                    ........
                                 .WHHUUVOOOOU&,
     dMMMMMMMMMMMa,   .MMMMF   .MHW0Oz+!``````?G.   .MMMM% .MMMMMMMMMMMN,
    .MMMMMMMMMMMMMMr  JMMMM   JHHXwOz;:^..```  `O,  JMMM#  dMMMMMMMMMMMMN
    JMMM#     ,MMMMF  MMMMF  .MHVXwOz++.^.````  +n .MMMM$ .MMMMt    dMMM#
   .MMMMt     .MMMMt .MMMM!  JMHWWXwOz++....  `.+X JMMMM  JMMMM    .MMMM%
   JMMM#     .MMMM@  dMMM#   ,MHHWWXwOzz+++....?df MMMMF .MMMMF    JMMM#
  .MMMMNNNNNMMMMMD   MMMMMNNm 4MHHWWXXwOOzzz1+1wX'.MMMM! .MMMM`   .MMMM$
  .MMMMMMMMMMMM"`    .YMMMMMF  TMHHHWWWXXXwwwwXK! MMMMF  MMMMF    JMMMM
  MMMMF                          TMMHHHHHWWWHY^
 .MMMM'                             `7""""^`
 dMMM#
 

$HeadURL: svn://ploin.de /time/trunk/src/main/java/org/ploin/time/java/gui/bean/MyMessagesBean.java $
$LastChangedBy: r.reiz $
$Revision: 48 $
$Date: 2009-11-18 01:06:13 +0100 (Wed, 18 Nov 2009) $


Method Summary
 java.lang.String getDirectory()
          Gets the path to the properties file.
 java.lang.String getMessage(java.lang.String key)
          Returns a message with the key "key" from the property file "propFile".
 java.lang.String getMessage(java.lang.String client, java.lang.String key)
          Returns a message with the key "key" from the property file.
 java.util.Properties getProperties(java.lang.String client, java.lang.String propName)
          This method looks for a properties file with the given name "propName".
It looks for a properties file in the following directories in this order: client directory mail directory class-root
 java.util.Properties getPropertiesFromDirectory(java.lang.String propName)
          This method looks for a properties file with the given name "propName".
It looks for the file only in the mail-directory.
 java.util.Properties getPropertiesFromMandant(java.lang.String client, java.lang.String propName)
          This method looks for a properties file with the given name "propName".
It looks for the file only in the client-directory.
 java.util.Properties getPropertiesFromRoot(java.lang.String propName)
          This method looks for a properties file with the given name "propName".
It looks for the file only in the root-directory (class-root).
 java.lang.String getPropFile()
          Gets the name of the properties file.
 java.util.Map<java.lang.String,java.lang.String> replaceVariables(TemplateConfig templateConfig)
          This method replaces all variables (${variable}) in the map with values found in the mail.properties.
 void setDirectory(java.lang.String directory)
          Sets the path to the properties file.
 void setPropFile(java.lang.String propFile)
          Sets the name of the properties file.
 

Method Detail

getMessage

java.lang.String getMessage(java.lang.String key)
Returns a message with the key "key" from the property file "propFile". It looks for a properties file in the following directories in this order:
  1. mail directory
  2. class-root
If the key is null, the method returns null.

Parameters:
key - :the key to search
Returns:
String :the value to the key.

getMessage

java.lang.String getMessage(java.lang.String client,
                            java.lang.String key)
Returns a message with the key "key" from the property file. It looks for a properties file in the following directories in this order:
  1. client directory
  2. mail directory
  3. class-root

Parameters:
client - :the client/mandant for the mail
key - :the key to search
Returns:
String :the value to the key.

replaceVariables

java.util.Map<java.lang.String,java.lang.String> replaceVariables(TemplateConfig templateConfig)
This method replaces all variables (${variable}) in the map with values found in the mail.properties. The variable-name is the key.

Parameters:
templateConfig - containing mandant/client, locale, template-name and map.
Returns:
a new map with replaced values

getProperties

java.util.Properties getProperties(java.lang.String client,
                                   java.lang.String propName)
This method looks for a properties file with the given name "propName".
It looks for a properties file in the following directories in this order:
  1. client directory
  2. mail directory
  3. class-root

Parameters:
client - - the client to the mail
propName - - the name of the properties file
Returns:
A Properties Object

getPropertiesFromMandant

java.util.Properties getPropertiesFromMandant(java.lang.String client,
                                              java.lang.String propName)
This method looks for a properties file with the given name "propName".
It looks for the file only in the client-directory. If there is no file with the given name it returns null.

Parameters:
client - - the client to the mail
propName - - the file name of the properties file.
Returns:
A Properties Object

getPropertiesFromDirectory

java.util.Properties getPropertiesFromDirectory(java.lang.String propName)
This method looks for a properties file with the given name "propName".
It looks for the file only in the mail-directory. If there is no file with the given name it returns null.

Parameters:
propName - - the client to the mail
Returns:
A Properties Object

getPropertiesFromRoot

java.util.Properties getPropertiesFromRoot(java.lang.String propName)
This method looks for a properties file with the given name "propName".
It looks for the file only in the root-directory (class-root). If there is no file with the given name it returns null.

Parameters:
propName - - the client to the mail
Returns:
A Properties Object

getDirectory

java.lang.String getDirectory()
Gets the path to the properties file.

Returns:
the path to the directory there the mail-templates are placed

setDirectory

void setDirectory(java.lang.String directory)
Sets the path to the properties file.

Parameters:
directory - - path to the directory there the mail-templates are placed.

getPropFile

java.lang.String getPropFile()
Gets the name of the properties file.

Returns:
the name of the properties files. The standard is "mail.properties".

setPropFile

void setPropFile(java.lang.String propFile)
Sets the name of the properties file.

Parameters:
propFile - - the name of the properties files.


Copyright © 2009 PLOIN GmbH. All Rights Reserved.