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 Summary
Modifier and TypeMethodDescriptionList<Class<? extends ExceptionHandlerFactory>>Returns an ordered list of all exception handler factories registered on this application.Returns a mapping of all resource bundle base names by var.List<Class<? extends ResourceHandler>>Returns an ordered list of all resource handlers registered on this application.Returns an ordered list of all supported locales on this application, with the default locale as the first item, if any.static FacesConfigXmlinstance()Returns the concreteFacesConfigXmlinstance.
-
Method Details
-
instance
Returns the concreteFacesConfigXmlinstance.- 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
FacesConfigXmlinstance.
-
getResourceBundles
Returns a mapping of all resource bundle base names by var.- Returns:
- A mapping of all resource bundle base names by var.
-
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 infaces-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 infaces-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 infaces-config.xml.- Returns:
- An ordered list of all exception handler factories registered on this application.
- Since:
- 4.5
- See Also:
-