Class ApplicationConfigDecorator
- java.lang.Object
-
- de.cuioss.test.jsf.config.decorator.ApplicationConfigDecorator
-
public class ApplicationConfigDecorator extends Object
Helper class acting as runtime-registry forResourceBundle,NavigationHandler,- Author:
- Oliver Wolff
-
-
Constructor Summary
Constructors Constructor Description ApplicationConfigDecorator(Application application, FacesContext facesContext)
-
Method Summary
-
-
-
Constructor Detail
-
ApplicationConfigDecorator
public ApplicationConfigDecorator(Application application, FacesContext facesContext)
-
-
Method Detail
-
registerResourceBundle
public ApplicationConfigDecorator registerResourceBundle(String bundleName, String bundlePath)
Registers aResourceBundleto a given name- Parameters:
bundleName- the name of the bundle to be registered tobundlePath- the path to theResourceBundle- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
registerSupportedLocales
public ApplicationConfigDecorator registerSupportedLocales(Collection<Locale> locales)
Registers the supportedLocales, seeApplication.setSupportedLocales(Collection)- Parameters:
locales- to be registered- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
registerDefaultLocale
public ApplicationConfigDecorator registerDefaultLocale(Locale locale)
Registers the defaultLocale, seeApplication.setDefaultLocale(Locale)- Parameters:
locale- to be registered- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
registerNavigationCase
public ApplicationConfigDecorator registerNavigationCase(String outcome, String toViewId)
Register a navigation case in a simple way, with two parameter only- Parameters:
outcome- to be registeredtoViewId- to be registered- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
getMockNavigationHandler
public CuiMockConfigurableNavigationHandler getMockNavigationHandler()
- Returns:
- an instance of
CuiMockConfigurableNavigationHandlerIf not already configured this method will implicitly register a new instance
-
setProjectStage
public ApplicationConfigDecorator setProjectStage(ProjectStage projectStage)
Sets theProjectStage. Caution: this method uses hardcore reflection to access the field with the name "_projectStage", may therefore be fragile.- Parameters:
projectStage- to be set- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
setContextPath
public ApplicationConfigDecorator setContextPath(String contextPath)
Sets the contextPath inHttpServletRequest- Parameters:
contextPath- to be set- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
addInitParameter
public ApplicationConfigDecorator addInitParameter(String key, String value)
Registers a concrete InitParameter toExternalContext.getInitParameterMap()- Parameters:
key- used as the key for theExternalContext.getInitParameterMap()value- used as the value for theExternalContext.getInitParameterMap()- Returns:
- the
ApplicationConfigDecoratoritself in order to enable a fluent-api style usage
-
-