com.stratelia.silverpeas.util
Class ResourcesWrapper

java.lang.Object
  extended by com.stratelia.silverpeas.util.ResourcesWrapper

public class ResourcesWrapper
extends Object

Class declaration

Author:

Constructor Summary
ResourcesWrapper(ResourceLocator specificMultilang, ResourceLocator specificIcons, ResourceLocator specificSettings, String language)
           
ResourcesWrapper(ResourceLocator specificMultilang, ResourceLocator specificIcons, String language)
           
ResourcesWrapper(ResourceLocator specificMultilang, String language)
           
 
Method Summary
 Date getDate(String date)
           
 String getDBDate(Date date)
           
 String getDBDate(String date)
           
 String getIcon(String key)
           
 ResourceBundle getIconsBundle()
          Return the icons ResourceBundle for usage in JSTL.
 String getInputDate(Date date)
           
 String getInputDate(String dateDB)
           
 String getLanguage()
           
 ResourceBundle getMultilangBundle()
          Return the ResourceBundle for usage in JSTL.
 String getOutputDate(Date date)
           
 String getOutputDate(String dateDB)
           
 String getOutputDateAndHour(Date date)
           
 String getOutputDateAndHour(Date date, Date defaultDate)
          Display first not null date
 String getSetting(String key)
          We look at the key in the specific settings file.
 boolean getSetting(String key, boolean defaultValue)
           
 int getSetting(String key, int defaultValue)
           
 String getSetting(String key, String defaultValue)
           
 String getString(String key)
           
 String getStringWithParam(String key, String param)
           
 String getStringWithParams(String key, String[] params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourcesWrapper

public ResourcesWrapper(ResourceLocator specificMultilang,
                        ResourceLocator specificIcons,
                        String language)
Parameters:
specificMultilang - - Multilang of component
specificIcons - - Icons of component
language - - user's language

ResourcesWrapper

public ResourcesWrapper(ResourceLocator specificMultilang,
                        ResourceLocator specificIcons,
                        ResourceLocator specificSettings,
                        String language)
Parameters:
specificMultilang - - Multilang of component
specificIcons - - Icons of component
specificSettings - - Settings of component
language - - user's language

ResourcesWrapper

public ResourcesWrapper(ResourceLocator specificMultilang,
                        String language)
Parameters:
specificMultilang - - Multilang of component
language - - user's language
Method Detail

getMultilangBundle

public ResourceBundle getMultilangBundle()
Return the ResourceBundle for usage in JSTL.

Returns:
the ResourceBundle under the ResourceLocator.

getIconsBundle

public ResourceBundle getIconsBundle()
Return the icons ResourceBundle for usage in JSTL.

Returns:
the icons ResourceBundle under the ResourceLocator.

getString

public String getString(String key)
Parameters:
key - - key in the multilang file
Returns:
the value of the key according to the key. If key starts with "GML.", we look at in the general multilang. Else, we look at in the component multilang

getStringWithParam

public String getStringWithParam(String key,
                                 String param)

getStringWithParams

public String getStringWithParams(String key,
                                  String[] params)

getIcon

public String getIcon(String key)

getLanguage

public String getLanguage()

getSetting

public String getSetting(String key)
We look at the key in the specific settings file.

Parameters:
key - - key in the settings file
Returns:
the value of the key if the key exists and if a value is specified. null otherwise.

getSetting

public String getSetting(String key,
                         String defaultValue)

getSetting

public boolean getSetting(String key,
                          boolean defaultValue)

getSetting

public int getSetting(String key,
                      int defaultValue)

getOutputDate

public String getOutputDate(Date date)

getOutputDate

public String getOutputDate(String dateDB)
                     throws ParseException
Throws:
ParseException

getOutputDateAndHour

public String getOutputDateAndHour(Date date)

getOutputDateAndHour

public String getOutputDateAndHour(Date date,
                                   Date defaultDate)
Display first not null date

Parameters:
date - date to display
defaultDate - extra date to display if date1 is empty (or null)
Returns:
the formatted date

getInputDate

public String getInputDate(Date date)

getInputDate

public String getInputDate(String dateDB)
                    throws ParseException
Throws:
ParseException

getDBDate

public String getDBDate(String date)
                 throws ParseException
Throws:
ParseException

getDBDate

public String getDBDate(Date date)

getDate

public Date getDate(String date)
             throws ParseException
Throws:
ParseException


Copyright © 2016 Silverpeas. All Rights Reserved.