Class BeanConfigDecorator

    • Method Detail

      • register

        public BeanConfigDecorator register​(Object managedBean,
                                            String name)
        Registers a given Object as jsf-managed bean for the given key
        Parameters:
        managedBean - to be registered, must not be null
        name - to be registered to. May be a correct value-expression or not (actual name only). Must not be null nor empty.
        Returns:
        the BeanConfigDecorator itself in order to enable a fluent-api style usage
      • register

        public BeanConfigDecorator register​(Object managedBean)
        Registers a given Object as jsf-managed bean. It checks the given bean for the annotation Named in oder to extract the corresponding value attribute. If none could be found it uses the Class.getSimpleName() with the first letter being lower-cased
        Parameters:
        managedBean - to be registered, must not be null
        Returns:
        the BeanConfigDecorator itself in order to enable a fluent-api style usage
      • checkManagedBeanKey

        public static String checkManagedBeanKey​(String managedBeanKey)
        In case the beanKey is not an el expression (starting not with '#{') this method wraps the expression accordingly.
        Parameters:
        managedBeanKey - must not be null or empty
        Returns:
        the key wrapped as an EL-Expression if needed, otherwise the given key.
      • getBean

        public static <T> T getBean​(String name,
                                    FacesContext facesContext,
                                    Class<T> expectedType)
        Utility method for accessing a concrete bean
        Parameters:
        name - May be a correct value-expression or not (actual name only). Must not be null nor empty.
        facesContext - to be used for accessing the bean
        expectedType - identifying the type to be checked
        Returns:
        the registered bean for a given type or null, if none could be found