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
  • Method Details

    • instance

      static FacesConfigXml instance()
      Returns the concrete FacesConfigXml instance.
      • Since OmniFaces 2.1, this returned a "lazy initialization on demand holder singleton".
      • Since OmniFaces 3.1, this returned an "enum singleton" via a (mockable) interface as per #441.
      • Since OmniFaces 4.7, this returns an "application scoped bean" as per #910.
      Returns:
      The concrete FacesConfigXml instance.
    • 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:
    • 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:
    • getExceptionHandlerFactories

      List<Class<? extends ExceptionHandlerFactory>> getExceptionHandlerFactories()
      Returns an ordered list of all exception handler factories registered on this application. This will return an empty list if there are no exception handler factories definied in faces-config.xml.
      Returns:
      An ordered list of all exception handler factories registered on this application.
      Since:
      4.5
      See Also: