Package jakarta.faces

Class FactoryFinder

    • Method Detail

      • getFactory

        public static Object getFactory​(String factoryName)
                                 throws FacesException

        Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description.

        The standard factories and wrappers in Faces all implement the interface FacesWrapper. If the returned Object is an implementation of one of the standard factories, it must be legal to cast it to an instance of FacesWrapper and call FacesWrapper.getWrapped() on the instance.

        Parameters:
        factoryName - Fully qualified name of the JavaServer Faces factory for which an implementation instance is requested
        Returns:
        A per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class
        Throws:
        FacesException - if the web application class loader cannot be identified
        FacesException - if an instance of the configured factory implementation class cannot be loaded
        FacesException - if an instance of the configured factory implementation class cannot be instantiated
        IllegalArgumentException - if factoryname does not identify a standard JavaServer Faces factory name
        IllegalStateException - if there is no configured factory implementation class for the specified factory name
        NullPointerException - if factoryname is null
      • setFactory

        public static void setFactory​(String factoryName,
                                      String implName)