Class BeanUtil

java.lang.Object
fr.paris.lutece.util.bean.BeanUtil

public final class BeanUtil extends Object
Bean Utils
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,String[]>
    convertMap(Map<String,String[]> mapInput)
    Convert map by casifying parameters names.
    static String
    Remove underscore and set the next letter in caps
    static org.apache.commons.beanutils.BeanUtilsBean
    Retrieves a BeanUtilsBean instance by its key.
    static org.apache.commons.beanutils.BeanUtilsBean
    getBeanUtilsBean(Locale locale, boolean enhanced)
    Retrieves a BeanUtilsBean instance for a specific locale and configuration type.
    static org.apache.commons.beanutils.BeanUtilsBean
    Retrieves the enhanced configuration BeanUtilsBean for the given locale.
    static org.apache.commons.beanutils.BeanUtilsBean
    Retrieves the standard configuration BeanUtilsBean for the given locale.
    static void
    BeanUtil initialization, considering Lutèce availables locales and date format properties
    static void
    populate(Object bean, jakarta.servlet.http.HttpServletRequest request)
    Populate a bean using parameters in http request
    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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • init

      public static void init()
      BeanUtil initialization, considering Lutèce availables locales and date format properties
    • populate

      public static void populate(Object bean, jakarta.servlet.http.HttpServletRequest request)
      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 populate
      request - http request
      locale -
    • convertMap

      public static Map<String,String[]> convertMap(Map<String,String[]> mapInput)
      Convert map by casifying parameters names.
      Parameters:
      mapInput - The input map
      Returns:
      The output map
    • convertUnderscores

      public static String convertUnderscores(String strSource)
      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 BeanUtilsBean
      enhanced - 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

      public static org.apache.commons.beanutils.BeanUtilsBean getBeanUtilsBean(String key)
      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

      public static org.apache.commons.beanutils.BeanUtilsBean getEnhancedBean(Locale locale)
      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

      public static org.apache.commons.beanutils.BeanUtilsBean getStandardBean(Locale locale)
      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