Package fr.paris.lutece.util.bean
Class BeanUtil
java.lang.Object
fr.paris.lutece.util.bean.BeanUtil
Bean Utils
-
Method Summary
Modifier and TypeMethodDescriptionconvertMap(Map<String, String[]> mapInput) Convert map by casifying parameters names.static StringconvertUnderscores(String strSource) Remove underscore and set the next letter in capsstatic org.apache.commons.beanutils.BeanUtilsBeangetBeanUtilsBean(String key) Retrieves a BeanUtilsBean instance by its key.static org.apache.commons.beanutils.BeanUtilsBeangetBeanUtilsBean(Locale locale, boolean enhanced) Retrieves a BeanUtilsBean instance for a specific locale and configuration type.static org.apache.commons.beanutils.BeanUtilsBeangetEnhancedBean(Locale locale) Retrieves the enhanced configuration BeanUtilsBean for the given locale.static org.apache.commons.beanutils.BeanUtilsBeangetStandardBean(Locale locale) Retrieves the standard configuration BeanUtilsBean for the given locale.static voidinit()BeanUtil initialization, considering Lutèce availables locales and date format propertiesstatic voidPopulate a bean using parameters in http requeststatic voidPopulate a bean using parameters in http request, with locale date format controls
-
Method Details
-
init
public static void init()BeanUtil initialization, considering Lutèce availables locales and date format properties -
populate
Populate a bean using parameters in http request- Parameters:
bean-request-
-
populate
public static void populate(Object bean, jakarta.servlet.http.HttpServletRequest request, Locale locale) Populate a bean using parameters in http request, with locale date format controls- Parameters:
bean- bean to populaterequest- http requestlocale-
-
convertMap
Convert map by casifying parameters names.- Parameters:
mapInput- The input map- Returns:
- The output map
-
convertUnderscores
Remove underscore and set the next letter in caps- Parameters:
strSource- The source- Returns:
- The converted string
-
getBeanUtilsBean
public static org.apache.commons.beanutils.BeanUtilsBean getBeanUtilsBean(Locale locale, boolean enhanced) Retrieves a BeanUtilsBean instance for a specific locale and configuration type.- Parameters:
locale- The locale for which to retrieve the BeanUtilsBeanenhanced- Whether to retrieve the enhanced configuration instance (true) or standard configuration instance (false)- Returns:
- The BeanUtilsBean instance
- Throws:
IllegalStateException- if manager is not initialized
-
getBeanUtilsBean
Retrieves a BeanUtilsBean instance by its key.- Parameters:
key- The key identifying the BeanUtilsBean instance- Returns:
- The BeanUtilsBean instance associated with the key, or null if not found
- Throws:
IllegalStateException- if manager is not initialized
-
getEnhancedBean
Retrieves the enhanced configuration BeanUtilsBean for the given locale.- Parameters:
locale- The locale for which to retrieve the BeanUtilsBean- Returns:
- The enhanced BeanUtilsBean instance, or null if not found
- Throws:
IllegalStateException- if manager is not initialized
-
getStandardBean
Retrieves the standard configuration BeanUtilsBean for the given locale.- Parameters:
locale- The locale for which to retrieve the BeanUtilsBean- Returns:
- The standard BeanUtilsBean instance, or null if not found
- Throws:
IllegalStateException- if manager is not initialized
-