Class LangHelper


  • public class LangHelper
    extends Object
    • Constructor Detail

      • LangHelper

        public LangHelper()
    • Method Detail

      • smartInstance

        public static Object smartInstance​(javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           Class c)
                                    throws Exception
        return the instance of a class.
        Returns:
        list of class returned :
        • HttpServletRequest
        • HttpServletResponse
        • HttpSession
        • ServletContext
        • StaticConfig
        • ContentContext
        • GlobalContext
        • I18nAccess
        • RequestService
        • EditContext
        • ContentService
        • ComponentContext
        • MenuElement : return the current page.
        • UserFactory
        • AdminUserFactory
        • AdminUserSecurity
        • PageConfiguration
        • ModuleContext
        • Module : current module.
        • MessageRepository
        • FileCache
        • StaticContext
        • UserInterfaceContext
        • ClipBoard
        • PersistenceService
        • User
        • AbstractModuleContext : return the current module context
        • ? extends AbstractModuleContext : instanciate a abstract module
        • >
        • String : the query parameter (when user make a search)
        • NotificationService
        • SharedContentService
        Throws:
        Exception
      • putAllIfNotExist

        public static void putAllIfNotExist​(Map map1,
                                            Map map2)
      • unsigned

        public static final int unsigned​(byte b)
      • arrays

        public static Object arrays​(Object[] arrays,
                                    int i,
                                    Object defaultValue)
        save access to array.
        Parameters:
        arrays -
        i - index.
        defaultValue -
        Returns:
        default value if array is smaller than index.
      • collectionToMap

        public static Map<?,​?> collectionToMap​(Collection<?> col)
      • asFirst

        public static boolean asFirst​(List list,
                                      Object item)
        put item as first of a list
        Parameters:
        list -
        item -
        Returns:
        false if item not found in list.
      • main

        public static void main​(String[] args)
      • clearWeekReferenceCollection

        public static <T> void clearWeekReferenceCollection​(Collection<WeakReference<T>> col)
      • clearWeekReferenceMap

        public static <K,​T> void clearWeekReferenceMap​(Map<K,​WeakReference<T>> map)
      • getModifiableList

        public static <E> List<E> getModifiableList​(List<E> list)
      • createList

        public static <E> List<E> createList​(E... items)
      • compareNull

        public static Integer compareNull​(Object obj1,
                                          Object obj2)
        compare two objects with one of them null.
        Parameters:
        obj1 -
        obj2 -
        Returns:
        null if two objects != null
      • isTrue

        public static boolean isTrue​(Object obj)