Interface FacesConfigXml


  • public interface FacesConfigXml

    This configuration interface parses the /WEB-INF/faces-config.xml and all /META-INF/faces-config.xml files found in the classpath and offers methods to obtain information from them which is not available by the standard Faces API.

    Usage

    Some examples:

     // Get a mapping of all <resource-bundle> vars and base names.
     Map<String, String> resourceBundles = FacesConfigXml.instance().getResourceBundles();
     
     // Get an ordered list of all <supported-locale> values with <default-locale> as first item.
     List<Locale> supportedLocales = FacesConfigXml.instance().getSupportedLocales();
     

    Since OmniFaces 3.1, you can if necessary even inject it.

     @Inject
     private FacesConfigXml facesConfigXml;
     
    Since:
    2.1
    Author:
    Bauke Scholtz, Michele Mariotti
    See Also:
    FacesConfigXmlSingleton, FacesConfigXmlProducer
    • Method Detail

      • instance

        static FacesConfigXml instance()
        Returns the lazily loaded enum singleton instance.
        Returns:
        The lazily loaded enum singleton instance.
        Since:
        3.1
      • getResourceBundles

        Map<String,​String> getResourceBundles()
        Returns a mapping of all resource bundle base names by var.
        Returns:
        A mapping of all resource bundle base names by var.
      • getSupportedLocales

        List<Locale> getSupportedLocales()
        Returns an ordered list of all supported locales on this application, with the default locale as the first item, if any. This will return an empty list if there are no locales definied in faces-config.xml.
        Returns:
        An ordered list of all supported locales on this application, with the default locale as the first item, if any.
        Since:
        2.2
        See Also:
        Application.getDefaultLocale(), Application.getSupportedLocales()
      • getResourceHandlers

        List<Class<? extends ResourceHandler>> getResourceHandlers()
        Returns an ordered list of all resource handlers registered on this application. This will return an empty list if there are no resource handlers definied in faces-config.xml.
        Returns:
        An ordered list of all resource handlers registered on this application.
        Since:
        3.10
        See Also:
        Application.getResourceHandler()