Class Application
- java.lang.Object
-
- jakarta.faces.application.Application
-
- Direct Known Subclasses:
ApplicationWrapper
public abstract class Application extends Object
Application represents a per-web-application singleton object where applications based on JavaServer Faces (or implementations wishing to provide extended functionality) can register application-wide singletons that provide functionality required by JavaServer Faces. Default implementations of each object are provided for cases where the application does not choose to customize the behavior.
The instance of
Holds webapp-wide resources for a Faces application. There is a single one of these for a web application, accessable viaApplicationis created by calling thegetApplication()method ofApplicationFactory. Because this instance is shared, it must be implemented in a thread-safe manner.FacesContext.getCurrentInstance().getApplication()
In particular, this provides a factory for UIComponent objects. It also provides convenience methods for creating ValueBinding objects. See Javadoc of Faces Specification
-
-
Constructor Summary
Constructors Constructor Description Application()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddBehavior(String behaviorId, String behaviorClass)abstract voidaddComponent(String componentType, String componentClass)Register a new mapping of component type to the name of the correspondingUIComponentclass.abstract voidaddConverter(Class<?> targetClass, String converterClass)Register a new converter class that is capable of performing conversions for the specified target class.abstract voidaddConverter(String converterId, String converterClass)Register a new mapping of converter id to the name of the correspondingConverterclass.voidaddDefaultValidatorId(String validatorId)voidaddELContextListener(jakarta.el.ELContextListener listener)Provide a way for Faces applications to register anELContextListenerthat will be notified on creation ofELContextinstances.voidaddELResolver(jakarta.el.ELResolver resolver)Cause an the argumentresolverto be added to the resolver chain as specified in section 5.5.1 of the JavaServer Faces Specification.voidaddSearchKeywordResolver(SearchKeywordResolver resolver)abstract voidaddValidator(String validatorId, String validatorClass)Register a new mapping of validator id to the name of the correspondingValidatorclass.BehaviorcreateBehavior(String behaviorId)UIComponentcreateComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType)Call thegetValue()method on the specifiedValueExpression.UIComponentcreateComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)UIComponentcreateComponent(FacesContext context, Resource componentResource)???UIComponentcreateComponent(FacesContext context, String componentType, String rendererType)abstract UIComponentcreateComponent(String componentType)Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.abstract ConvertercreateConverter(Class<?> targetClass)Instantiate and return a newinstance of the class that has registered itself as capable of performing conversions for objects of the specified type.Converterabstract ConvertercreateConverter(String converterId)Instantiate and return a newinstance of the class specified by a previous call toConverteraddConverter()for the specified converter id.abstract ValidatorcreateValidator(String validatorId)Instantiate and return a newinstance of the class specified by a previous call toValidatoraddValidator()for the specified validator id.<T> TevaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType)Get a value by evaluating an expression.abstract ActionListenergetActionListener()Return the defaultActionListenerto be registered for allActionSourcecomponents in this appication.Iterator<String>getBehaviorIds()abstract Iterator<String>getComponentTypes()Return anIteratorover the set of currently defined component types for thisApplication.abstract Iterator<String>getConverterIds()Return anIteratorover the set of currently registered converter ids for thisApplicationabstract Iterator<Class<?>>getConverterTypes()Return anIteratorover the set ofClassinstances for whichConverterclasseshave been explicitly registered.abstract LocalegetDefaultLocale()Return the defaultLocalefor this application.abstract StringgetDefaultRenderKitId()Return therenderKitIdto be used for rendering this application.Map<String,String>getDefaultValidatorInfo()jakarta.el.ELContextListener[]getELContextListeners()If no calls have been made toaddELContextListener(jakarta.el.ELContextListener), this method must return an empty arrayjakarta.el.ELResolvergetELResolver()Return the singletonELResolverinstance to be used for all EL resolution.jakarta.el.ExpressionFactorygetExpressionFactory()Return theExpressionFactoryinstance for this application.FlowHandlergetFlowHandler()abstract StringgetMessageBundle()Return the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application.abstract NavigationHandlergetNavigationHandler()Return theinstance that will be passed the outcome returned by any invoked application action for this web application.NavigationHandlerProjectStagegetProjectStage()Return the project stage for the currently running application instance.ResourceBundlegetResourceBundle(FacesContext ctx, String name)Find aResourceBundleas defined in the application configuration resources under the specified name.ResourceHandlergetResourceHandler()Return the singleton, stateless, thread-safefor this application.ResourceHandlerSearchExpressionHandlergetSearchExpressionHandler()SearchKeywordResolvergetSearchKeywordResolver()abstract StateManagergetStateManager()Return theStateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.abstract Iterator<Locale>getSupportedLocales()Return anIteratorover the supportedLocalesfor this appication.abstract Iterator<String>getValidatorIds()Return anIteratorover the set of currently registered validator ids for thisApplication.abstract ViewHandlergetViewHandler()Set theinstance that will be utilized during theViewHandlerRestore View and Render Responsephases of the request processing lifecycle.voidpublishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)voidpublishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source)If there are one or more listeners for events of the type represented bysystemEventClass, call those listeners,passing source as thesourceof the event.voidremoveELContextListener(jakarta.el.ELContextListener listener)Remove the argumentlistenerfrom the list ofELContextListeners.abstract voidsetActionListener(ActionListener listener)Set the defaultto be registered for allActionListenercomponents.ActionSourceabstract voidsetDefaultLocale(Locale locale)Set the defaultLocalefor this application.abstract voidsetDefaultRenderKitId(String renderKitId)Return therenderKitIdto be used for rendering this application.voidsetFlowHandler(FlowHandler flowHandler)abstract voidsetMessageBundle(String bundle)Set the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application.abstract voidsetNavigationHandler(NavigationHandler handler)Set theNavigationHandlerinstance that will be passed the outcome returned by any invoked application action for this web application.voidsetResourceHandler(ResourceHandler resourceHandler)voidsetSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler)abstract voidsetStateManager(StateManager manager)Set theStateManagerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.abstract voidsetSupportedLocales(Collection<Locale> locales)Set theLocaleinstances representing the supportedLocalesfor this application.abstract voidsetViewHandler(ViewHandler handler)Set theViewHandlerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.voidsubscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)voidsubscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)voidunsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)voidunsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
-
-
-
Method Detail
-
addBehavior
public void addBehavior(String behaviorId, String behaviorClass)
- Parameters:
behaviorId-behaviorClass-- Since:
- 2.0 FIXME: Notify EG, this should not be abstract and throw UnsupportedOperationException
-
addComponent
public abstract void addComponent(String componentType, String componentClass)
Register a new mapping of component type to the name of the correspondingUIComponentclass. This allows subsequent calls tocreateComponent()to serve as a factory forUIComponentinstances.- Parameters:
componentType- - The component type to be registeredcomponentClass- - The fully qualified class name of the correspondingUIComponentimplementation- Throws:
NullPointerException- ifcomponentTypeorcomponentClassisnull
-
addConverter
public abstract void addConverter(Class<?> targetClass, String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class.- Parameters:
targetClass- - The class for which this converter is registeredconverterClass- - The fully qualified class name of the correspondingConverterimplementation- Throws:
NullPointerException- iftargetClassorconverterClassisnull
-
addConverter
public abstract void addConverter(String converterId, String converterClass)
Register a new mapping of converter id to the name of the correspondingConverterclass. This allows subsequent calls to createConverter() to serve as a factory forConverterinstances.- Parameters:
converterId- - The converterId to be registeredconverterClass- - The fully qualified class name of the correspondingConverterimplementation- Throws:
NullPointerException- ifcomponentTypeorcomponentClassisnull
-
addDefaultValidatorId
public void addDefaultValidatorId(String validatorId)
- Parameters:
validatorId-- Since:
- 2.0
-
addELContextListener
public void addELContextListener(jakarta.el.ELContextListener listener)
Provide a way for Faces applications to register an
ELContextListenerthat will be notified on creation ofELContextinstances.An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Since:
- 1.2
-
addELResolver
public void addELResolver(jakarta.el.ELResolver resolver)
Cause an the argument
resolverto be added to the resolver chain as specified in section 5.5.1 of the JavaServer Faces Specification.It is not possible to remove an
ELResolverregistered with this method, once it has been registered.It is illegal to register an ELResolver after the application has received any requests from the client. If an attempt is made to register a listener after that time, an IllegalStateException must be thrown.
ELResolversare in the chain, aside from the standard ones. It is permissible to addELResolversbefore or after initialization to a CompositeELResolver that is already in the chain.The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extendApplication.- Since:
- 1.2
-
addValidator
public abstract void addValidator(String validatorId, String validatorClass)
Register a new mapping of validator id to the name of the correspondingValidatorclass. This allows subsequent calls tocreateValidator()to serve as a factory forValidatorinstances.- Parameters:
validatorId- The validator id to be registeredvalidatorClass- The fully qualified class name of the corresponding Validator implementation- Throws:
NullPointerException- ifvalidatorIdorvalidatorClassisnull
-
createBehavior
public Behavior createBehavior(String behaviorId) throws FacesException
- Parameters:
behaviorId-- Returns:
- Throws:
FacesException- Since:
- 2.0 FIXME: Notify EG, this should not be abstract and throw UnsupportedOperationException
-
createComponent
public UIComponent createComponent(FacesContext context, Resource componentResource)
???- Parameters:
context-componentResource-- Returns:
- Since:
- 2.0
-
createComponent
public UIComponent createComponent(FacesContext context, String componentType, String rendererType)
- Parameters:
context-componentType-rendererType-- Returns:
- Since:
- 2.0
-
createComponent
public abstract UIComponent createComponent(String componentType) throws FacesException
Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.
- Throws:
FacesException- if there is no mapping defined for the specified componentType, or if an instance of the specified type could not be created for any reason.
-
createComponent
public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException
Call the
getValue()method on the specifiedValueExpression. If it returns ainstance, return it as the value of this method. If it does not, instantiate a newUIComponentinstance of the specified component type, pass the new component to theUIComponentsetValue()method of the specifiedValueExpression, and return it.- Parameters:
componentExpression- -ValueExpressionrepresenting a component value expression (typically specified by thecomponentattribute of a custom tag)context- -FacesContextfor the current requestcomponentType- - Component type to create if the ValueExpression does not return a component instance- Throws:
FacesException- if acannot be createdUIComponentNullPointerException- if any parameter is nullA default implementation is provided that throws
UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Since:
- 1.2
-
createComponent
public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
- Parameters:
componentExpression-context-componentType-rendererType-- Returns:
- Since:
- 2.0
-
createConverter
public abstract Converter createConverter(Class<?> targetClass)
Instantiate and return a new
instance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no suchConverterclass can be identified, return null.ConverterTo locate an appropriate
class, the following algorithm is performed, stopping as soon as an appropriateConverterclass is found: Locate aConverterregistered for the target class itself. Locate aConverterregistered for interfaces that are implemented by the target class (directly or indirectly). Locate aConverterregistered for the superclass (if any) of the target class, recursively working up the inheritance hierarchy.ConverterIf the
has a single argument constructor that accepts a Class, instantiate theConverterusing that constructor, passing the argumentConvertertargetClassas the sole argument. Otherwise, simply use the zero-argument constructor.- Parameters:
targetClass- - Target class for which to return aConverter- Throws:
FacesException- if thecannot be createdConverterNullPointerException- iftargetClassisnull
-
createConverter
public abstract Converter createConverter(String converterId)
Instantiate and return a newinstance of the class specified by a previous call toConverteraddConverter()for the specified converter id. If there is no such registration for this converter id, returnnull.- Parameters:
converterId- - The converter id for which to create and return a newinstanceConverter- Throws:
FacesException- if thecannot be createdConverterNullPointerException- if converterId isnull
-
createValidator
public abstract Validator createValidator(String validatorId) throws FacesException
Instantiate and return a newinstance of the class specified by a previous call toValidatoraddValidator()for the specified validator id.- Parameters:
validatorId- Theid for which to create and return a new Validator instanceValidator- Throws:
FacesException- if aof the specified id cannot be createdValidatorNullPointerException- if validatorId isnull
-
evaluateExpressionGet
public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws jakarta.el.ELException
Get a value by evaluating an expression.
Call
then callgetExpressionFactory()ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class)passing the argumentexpressionandexpectedType. Calland pass it toFacesContext.getELContext()ValueExpression.getValue(jakarta.el.ELContext), returning the result.An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Throws:
jakarta.el.ELException
-
getActionListener
public abstract ActionListener getActionListener()
Return the default
ActionListenerto be registered for allActionSourcecomponents in this appication. If not explicitly set, a default implementation must be provided that performs the following functions:- The
processAction()method must first callFacesContext.renderResponse()in order to bypass any intervening lifecycle phases, once the method returns. - The
processAction()method must next determine the logical outcome of this event, as follows: - If the originating component has a non-
null actionproperty, retrieve theMethodExpressionfrom the property, and callinvoke()on it. Convert the returned value (if any) to a String, and use it as the logical outcome. - Otherwise, the logical outcome is null.
- The
processAction()method must finally retrieve theNavigationHandlerinstance for this application and callNavigationHandler.handleNavigation(jakarta.faces.context.FacesContext, java.lang.String, java.lang.String)passing: - the
FacesContextfor the current request - If there is a
MethodExpressioninstance for theactionproperty of this component, the result of callingExpression.getExpressionString()on it, null otherwise - the logical outcome as determined above
Note that the specification for the default
ActionListenercontiues to call for the use of a deprecated property (action) and class (MethodExpression). Unfortunately, this is necessary because the default ActionListener must continue to work with components that do not implementActionSource2, and only implementActionSource. - The
-
getBehaviorIds
public Iterator<String> getBehaviorIds()
- Returns:
- Since:
- 2.0 FIXME: Notify EG, this should not be abstract and throw UnsupportedOperationException
-
getComponentTypes
public abstract Iterator<String> getComponentTypes()
Return anIteratorover the set of currently defined component types for thisApplication.
-
getConverterIds
public abstract Iterator<String> getConverterIds()
Return anIteratorover the set of currently registered converter ids for thisApplication- Returns:
-
getConverterTypes
public abstract Iterator<Class<?>> getConverterTypes()
Return anIteratorover the set ofClassinstances for whichConverterclasseshave been explicitly registered.- Returns:
-
getDefaultLocale
public abstract Locale getDefaultLocale()
Return the defaultLocalefor this application. If not explicitly set,nullis returned.- Returns:
-
getDefaultRenderKitId
public abstract String getDefaultRenderKitId()
Return therenderKitIdto be used for rendering this application. If not explicitly set,nullis returned.- Returns:
-
getELContextListeners
public jakarta.el.ELContextListener[] getELContextListeners()
If no calls have been made to
addELContextListener(jakarta.el.ELContextListener), this method must return an empty array.
Otherwise, return an array representing the list of listeners added by calls to
addELContextListener(jakarta.el.ELContextListener).An
implementationis provided that throws UnsupportedOperationException so that users that decorate theApplicationcontinue to work.- Since:
- 1.2
-
getELResolver
public jakarta.el.ELResolver getELResolver()
Return the singletonELResolverinstance to be used for all EL resolution. This is actually an instance ofCompositeELResolverthat must contain the following ELResolver instances in the following order:ELResolverinstances declared using the <el-resolver> element in the application configuration resources.- An
implementationthat wraps the head of the legacy VariableResolver chain, as per sectionVariableResolver ChainWrapperin Chapter 5 in the spec document. - An
implementationthat wraps the head of the legacy PropertyResolver chain, as per sectionPropertyResolver ChainWrapperin Chapter 5 in the spec document. - Any
ELResolverinstances added by calls to.addELResolver(jakarta.el.ELResolver) - The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend.Application
- Since:
- 1.2
-
getExpressionFactory
public jakarta.el.ExpressionFactory getExpressionFactory()
Return the
ExpressionFactoryinstance for this application. This instance is used by the convenience methodevaluateExpressionGet(jakarta.faces.context.FacesContext, java.lang.String, java.lang.Class).An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Returns:
- Since:
- 1.2
-
getMessageBundle
public abstract String getMessageBundle()
Return the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application. If not explicitly set,nullis returned.
-
getNavigationHandler
public abstract NavigationHandler getNavigationHandler()
Return theinstance that will be passed the outcome returned by any invoked application action for this web application. If not explicitly set, a default implementation must be provided that performs the functions described in theNavigationHandlerclass description.NavigationHandler
-
getProjectStage
public ProjectStage getProjectStage()
Return the project stage for the currently running application instance. The default value is
ProjectStage.ProductionThe implementation of this method must perform the following algorithm or an equivalent with the same end result to determine the value to return.
- If the value has already been determined by a previous call to this method, simply return that value.
- Look for a
JNDIenvironment entry under the key given by the value of(return type of java.lang.String). If found, continue with the algorithm below, otherwise, look for an entry in theProjectStage.PROJECT_STAGE_JNDI_NAMEinitParamMapof theExternalContextfrom the currentFacesContextwith the keyProjectStage.PROJECT_STAGE_PARAM_NAME - If a value is found found, see if an enum constant can be obtained by calling
ProjectStage.valueOf(), passing the value from theinitParamMap. If this succeeds without exception, save the value and return it. - If not found, or any of the previous attempts to discover the enum constant value have failed, log a
descriptive error message, assign the value as
ProjectStage.Productionand return it.
- Since:
- 2.0
-
getResourceBundle
public ResourceBundle getResourceBundle(FacesContext ctx, String name)
Find a
ResourceBundleas defined in the application configuration resources under the specified name. If aResourceBundlewas defined for the name, return an instance that uses the locale of the current.UIViewRootThe default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend this class.- Returns:
ResourceBundlefor the current UIViewRoot, otherwise null- Throws:
FacesException- if a bundle was defined, but not resolvableNullPointerException- if ctx == null || name == null
-
getResourceHandler
public ResourceHandler getResourceHandler()
Return the singleton, stateless, thread-safe
for this application. The Faces implementation must support the following techniques for declaring an alternate implementation ofResourceHandlerResourceHandler.- The
ResourceHandlerimplementation is declared in the application configuration resources by giving the fully qualified class name as the value of the<resource-handler>element within theapplicationelement. - RELEASE_PENDING(edburns) It can also be declared via an annotation as specified in [287-ConfigAnnotations].
In all of the above cases, the runtime must employ the decorator pattern as for every other pluggable artifact in Faces.
- Since:
- 2.0
- The
-
getStateManager
public abstract StateManager getStateManager()
Return theStateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle. If not explicitly set, a default implementation must be provided that performs the functions described in theStateManagerdescription in the JavaServer Faces Specification.
-
getSupportedLocales
public abstract Iterator<Locale> getSupportedLocales()
Return anIteratorover the supportedLocalesfor this appication.
-
getValidatorIds
public abstract Iterator<String> getValidatorIds()
Return anIteratorover the set of currently registered validator ids for thisApplication.
-
getViewHandler
public abstract ViewHandler getViewHandler()
Set theinstance that will be utilized during theViewHandlerRestore View and Render Responsephases of the request processing lifecycle.- Returns:
-
publishEvent
public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
- Parameters:
facesContext-systemEventClass-sourceBaseType-source-- Since:
- 2.0
-
publishEvent
public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source)
If there are one or more listeners for events of the type represented by
systemEventClass, call those listeners,passing source as thesourceof the event. The implementation should be as fast as possible in determining whether or not a listener for the givensystemEventClassandsourcehas been installed, and should return immediately once such a determination has been made. The implementation ofpublishEventmust honor the requirements stated insubscribeToEvent(java.lang.Class, java.lang.Class, jakarta.faces.event.SystemEventListener)The default implementation must implement an algorithm semantically equivalent to the following to locate listener instances and to invoke them.
- If the
sourceargument implements, callSystemEventListenerHolderon it, passing theSystemEventListenerHolder.getListenersForEventClass(java.lang.Class)systemEventClassargument. If the list is not empty, perform algorithmtraverseListenerListon the list. - If any
Applicationlevel listeners have been installed by previous calls to, perform algorithmsubscribeToEvent(java.lang.Class, java.lang.Class, SystemEventListener)traverseListenerListon the list. - If any
Applicationlevel listeners have been installed by previous calls to, perform algorithmsubscribeToEvent(java.lang.Class, SystemEventListener)traverseListenerListon the list.
If the act of invoking the
processListenermethod causes anto be thrown, processing of the listeners must be aborted.AbortProcessingExceptionAlgorithm
traverseListenerList: For each listener in the list,- Call
, passing theSystemEventListener.isListenerForSource(java.lang.Object)sourceargument. If this returnsfalse, take no action on the listener. - Otherwise, if the event to be passed to the listener instances has not yet been constructed, construct the
event, passing
sourceas the argument to the one-argument constructor that takes anObject. This same event instance must be passed to all listener instances. - Call
, passing the listener instance as the argument. If this returnsSystemEvent.isAppropriateListener(jakarta.faces.event.FacesListener)false, take no action on the listener. - Call
, passing the listener instance.SystemEvent.processListener(jakarta.faces.event.FacesListener)
- Parameters:
systemEventClass- - The Class of event that is being published. Must be non-null.source- - Thesourcefor the event of type systemEventClass. Must be non-null, and must implement.SystemEventListenerHolder- Since:
- 2.0
- If the
-
removeELContextListener
public void removeELContextListener(jakarta.el.ELContextListener listener)
Remove the argument
listenerfrom the list ofELContextListeners. Iflisteneris null, no exception is thrown and no action is performed. Iflisteneris not in the list, no exception is thrown and no action is performed.An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Parameters:
listener-
-
setActionListener
public abstract void setActionListener(ActionListener listener)
Set the defaultto be registered for allActionListenercomponents.ActionSource- Parameters:
listener- - The new defaultActionListener- Throws:
NullPointerException- if listener is null
-
setDefaultLocale
public abstract void setDefaultLocale(Locale locale)
Set the defaultLocalefor this application.- Parameters:
locale- - The new defaultLocale- Throws:
NullPointerException- if listener is null
-
setDefaultRenderKitId
public abstract void setDefaultRenderKitId(String renderKitId)
Return therenderKitIdto be used for rendering this application. If not explicitly set,nullis returned.- Parameters:
renderKitId-
-
setMessageBundle
public abstract void setMessageBundle(String bundle)
Set the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application. See the JavaDocs for thejava.util.ResourceBundleclass for more information about the syntax for resource bundle names.- Parameters:
bundle- - Base name of the resource bundle to be used- Throws:
NullPointerException- if bundle is null
-
setNavigationHandler
public abstract void setNavigationHandler(NavigationHandler handler)
Set theNavigationHandlerinstance that will be passed the outcome returned by any invoked application action for this web application.- Parameters:
handler- - The new NavigationHandler instance
-
setResourceHandler
public void setResourceHandler(ResourceHandler resourceHandler)
- Parameters:
resourceHandler-- Since:
- 2.0
-
setStateManager
public abstract void setStateManager(StateManager manager)
Set theStateManagerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.- Parameters:
manager- The newStateManagerinstance- Throws:
IllegalStateException- if this method is called after at least one request has been processed by theLifecycleinstance for this application.NullPointerException- if manager isnull
-
setSupportedLocales
public abstract void setSupportedLocales(Collection<Locale> locales)
Set theLocaleinstances representing the supportedLocalesfor this application.- Parameters:
locales- The set of supportedLocalesfor this application- Throws:
NullPointerException- if the argument newLocales isnull.
-
setViewHandler
public abstract void setViewHandler(ViewHandler handler)
Set theViewHandlerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.- Parameters:
handler- - The newViewHandlerinstance- Throws:
IllegalStateException- if this method is called after at least one request has been processed by theLifecycleinstance for this application.NullPointerException- ifhandlerisnull
-
subscribeToEvent
public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
- Parameters:
systemEventClass-sourceClass-listener-- Since:
- 2.0
-
subscribeToEvent
public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
- Parameters:
systemEventClass-listener-- Since:
- 2.0
-
unsubscribeFromEvent
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
- Parameters:
systemEventClass-sourceClass-listener-- Since:
- 2.0
-
unsubscribeFromEvent
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
- Parameters:
systemEventClass-listener-- Since:
- 2.0
-
getFlowHandler
public FlowHandler getFlowHandler()
- Returns:
- Since:
- 2.2
-
setFlowHandler
public void setFlowHandler(FlowHandler flowHandler)
- Parameters:
flowHandler-- Since:
- 2.2
-
addSearchKeywordResolver
public void addSearchKeywordResolver(SearchKeywordResolver resolver)
-
getSearchKeywordResolver
public SearchKeywordResolver getSearchKeywordResolver()
-
getSearchExpressionHandler
public SearchExpressionHandler getSearchExpressionHandler()
- Returns:
- Since:
- 2.3
-
setSearchExpressionHandler
public void setSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler)
- Parameters:
searchExpressionHandler-- Since:
- 2.3
-
-