Class ApplicationWrapper
- All Implemented Interfaces:
- FacesWrapper<Application>
- Since:
- 2.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBehavior(String behaviorId, String behaviorClass) voidaddComponent(String componentType, String componentClass) Register a new mapping of component type to the name of the correspondingUIComponentclass.voidaddConverter(Class<?> targetClass, String converterClass) Register a new converter class that is capable of performing conversions for the specified target class.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.voidvoidaddValidator(String validatorId, String validatorClass) Register a new mapping of validator id to the name of the correspondingValidatorclass.createBehavior(String behaviorId) createComponent(jakarta.el.ValueExpression componentExpression, FacesContext contexte, String componentType) Call thegetValue()method on the specifiedValueExpression.createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) createComponent(FacesContext context, Resource componentResource) ???createComponent(FacesContext context, String componentType, String rendererType) createComponent(String componentType) Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.createConverter(Class<?> targetClass) Instantiate and return a newConvertercreateConverter(String converterId) Instantiate and return a newConverteraddConverter()for the specified converter id.createValidator(String validatorId) Instantiate and return a newValidatoraddValidator()for the specified validator id.<T> TevaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) Get a value by evaluating an expression.Return the defaultActionListenerto be registered for allActionSourcecomponents in this appication.Return anIteratorover the set of currently defined component types for thisApplication.Return anIteratorover the set of currently registered converter ids for thisApplicationReturn anIteratorover the set ofClassinstances for whichConverterclasseshave been explicitly registered.Return the defaultLocalefor this application.Return therenderKitIdto be used for rendering this application.jakarta.el.ELContextListener[]If no calls have been made toaddELContextListener(jakarta.el.ELContextListener), this method must return an empty arrayjakarta.el.ELResolverReturn the singletonELResolverinstance to be used for all EL resolution.jakarta.el.ExpressionFactoryReturn theExpressionFactoryinstance for this application.Return the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application.Return theNavigationHandlerReturn the project stage for the currently running application instance.getResourceBundle(FacesContext ctx, String name) Find aResourceBundleas defined in the application configuration resources under the specified name.Return the singleton, stateless, thread-safeResourceHandlerReturn theStateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.Return anIteratorover the supportedLocalesfor this appication.Return anIteratorover the set of currently registered validator ids for thisApplication.Set theViewHandlerRestore View and Render Responsephases of the request processing lifecycle.A class that implements this interface uses this method to return an instance of the class being wrapped.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.voidsetActionListener(ActionListener listener) Set the defaultActionListenerActionSourcevoidsetDefaultLocale(Locale locale) Set the defaultLocalefor this application.voidsetDefaultRenderKitId(String renderKitId) Return therenderKitIdto be used for rendering this application.voidsetFlowHandler(FlowHandler flowHandler) voidsetMessageBundle(String bundle) Set the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application.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) voidsetStateManager(StateManager manager) Set theStateManagerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.voidsetSupportedLocales(Collection<Locale> locales) Set theLocaleinstances representing the supportedLocalesfor this application.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) 
- 
Constructor Details- 
ApplicationWrapperDeprecated.
- 
ApplicationWrapper
 
- 
- 
Method Details- 
addBehavior- Overrides:
- addBehaviorin class- Application
 
- 
addComponentDescription copied from class:ApplicationRegister a new mapping of component type to the name of the correspondingUIComponentclass. This allows subsequent calls tocreateComponent()to serve as a factory forUIComponentinstances.- Specified by:
- addComponentin class- Application
- Parameters:
- componentType- - The component type to be registered
- componentClass- - The fully qualified class name of the corresponding- UIComponentimplementation
 
- 
addConverterDescription copied from class:ApplicationRegister a new converter class that is capable of performing conversions for the specified target class.- Specified by:
- addConverterin class- Application
- Parameters:
- targetClass- - The class for which this converter is registered
- converterClass- - The fully qualified class name of the corresponding- Converterimplementation
 
- 
addConverterDescription copied from class:ApplicationRegister a new mapping of converter id to the name of the correspondingConverterclass. This allows subsequent calls to createConverter() to serve as a factory forConverterinstances.- Specified by:
- addConverterin class- Application
- Parameters:
- converterId- - The converterId to be registered
- converterClass- - The fully qualified class name of the corresponding- Converterimplementation
 
- 
addDefaultValidatorId- Overrides:
- addDefaultValidatorIdin class- Application
 
- 
addELContextListenerpublic void addELContextListener(jakarta.el.ELContextListener listener) Description copied from class:ApplicationProvide 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.- Overrides:
- addELContextListenerin class- Application
 
- 
addELResolverpublic void addELResolver(jakarta.el.ELResolver resolver) Description copied from class:ApplicationCause 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.- Overrides:
- addELResolverin class- Application
 
- 
addValidatorDescription copied from class:ApplicationRegister a new mapping of validator id to the name of the correspondingValidatorclass. This allows subsequent calls tocreateValidator()to serve as a factory forValidatorinstances.- Specified by:
- addValidatorin class- Application
- Parameters:
- validatorId- The validator id to be registered
- validatorClass- The fully qualified class name of the corresponding Validator implementation
 
- 
createBehavior- Overrides:
- createBehaviorin class- Application
- Returns:
- Throws:
- FacesException
 
- 
createComponentDescription copied from class:Application???- Overrides:
- createComponentin class- Application
- Returns:
 
- 
createComponent- Overrides:
- createComponentin class- Application
- Returns:
 
- 
createComponentDescription copied from class:ApplicationCreate a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class. - Specified by:
- createComponentin class- Application
- 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.
 
- 
createComponentpublic UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) - Overrides:
- createComponentin class- Application
- Returns:
 
- 
createComponentpublic UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext contexte, String componentType) throws FacesException Description copied from class:ApplicationCall the getValue()method on the specifiedValueExpression. If it returns aUIComponentUIComponentsetValue()method of the specifiedValueExpression, and return it.- Overrides:
- createComponentin class- Application
- Parameters:
- componentExpression- -- ValueExpressionrepresenting a component value expression (typically specified by the- componentattribute of a custom tag)
- contexte- -- FacesContextfor the current request
- componentType- - Component type to create if the ValueExpression does not return a component instance
- Throws:
- FacesException- if a- UIComponent
 
- 
createConverterDescription copied from class:ApplicationInstantiate and return a new ConverterConverterTo locate an appropriate ConverterConverterConverterConverterConverterIf the ConverterConvertertargetClassas the sole argument. Otherwise, simply use the zero-argument constructor.- Specified by:
- createConverterin class- Application
- Parameters:
- targetClass- - Target class for which to return a- Converter
 
- 
createConverterDescription copied from class:ApplicationInstantiate and return a newConverteraddConverter()for the specified converter id. If there is no such registration for this converter id, returnnull.- Specified by:
- createConverterin class- Application
- Parameters:
- converterId- - The converter id for which to create and return a new- Converter
 
- 
createValidatorDescription copied from class:ApplicationInstantiate and return a newValidatoraddValidator()for the specified validator id.- Specified by:
- createValidatorin class- Application
- Parameters:
- validatorId- The- Validator
- Throws:
- FacesException- if a- Validator
 
- 
evaluateExpressionGetpublic <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws jakarta.el.ELException Description copied from class:ApplicationGet a value by evaluating an expression. Call Application.getExpressionFactory()ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class)passing the argumentexpressionandexpectedType. CallFacesContext.getELContext()ValueExpression.getValue(jakarta.el.ELContext), returning the result.An implementation is provided that throws UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
- evaluateExpressionGetin class- Application
- Throws:
- jakarta.el.ELException
 
- 
getActionListenerDescription copied from class:ApplicationReturn 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
 - Specified by:
- getActionListenerin class- Application
 
- The 
- 
getBehaviorIds- Overrides:
- getBehaviorIdsin class- Application
- Returns:
 
- 
getComponentTypesDescription copied from class:ApplicationReturn anIteratorover the set of currently defined component types for thisApplication.- Specified by:
- getComponentTypesin class- Application
 
- 
getConverterIdsDescription copied from class:ApplicationReturn anIteratorover the set of currently registered converter ids for thisApplication- Specified by:
- getConverterIdsin class- Application
- Returns:
 
- 
getConverterTypesDescription copied from class:ApplicationReturn anIteratorover the set ofClassinstances for whichConverterclasseshave been explicitly registered.- Specified by:
- getConverterTypesin class- Application
- Returns:
 
- 
getDefaultLocaleDescription copied from class:ApplicationReturn the defaultLocalefor this application. If not explicitly set,nullis returned.- Specified by:
- getDefaultLocalein class- Application
- Returns:
 
- 
getDefaultRenderKitIdDescription copied from class:ApplicationReturn therenderKitIdto be used for rendering this application. If not explicitly set,nullis returned.- Specified by:
- getDefaultRenderKitIdin class- Application
- Returns:
 
- 
getDefaultValidatorInfo- Overrides:
- getDefaultValidatorInfoin class- Application
- Returns:
 
- 
getELContextListenerspublic jakarta.el.ELContextListener[] getELContextListeners()Description copied from class:ApplicationIf 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.- Overrides:
- getELContextListenersin class- Application
 
- 
getELResolverpublic jakarta.el.ELResolver getELResolver()Description copied from class:ApplicationReturn 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 toApplication.addELResolver(jakarta.el.ELResolver)
- The default implementation throws UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extendApplication
 - Overrides:
- getELResolverin class- Application
 
- 
getExpressionFactorypublic jakarta.el.ExpressionFactory getExpressionFactory()Description copied from class:ApplicationReturn the ExpressionFactoryinstance for this application. This instance is used by the convenience methodApplication.evaluateExpressionGet(jakarta.faces.context.FacesContext, java.lang.String, java.lang.Class).An implementation is provided that throws UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
- getExpressionFactoryin class- Application
- Returns:
 
- 
getMessageBundleDescription copied from class:ApplicationReturn the fully qualified class name of theResourceBundleto be used for JavaServer Faces messages for this application. If not explicitly set,nullis returned.- Specified by:
- getMessageBundlein class- Application
 
- 
getProjectStageDescription copied from class:ApplicationReturn 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 ofProjectStage.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.
 - Overrides:
- getProjectStagein class- Application
 
- 
getResourceBundleDescription copied from class:ApplicationFind 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 currentUIViewRootThe default implementation throws UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend this class.- Overrides:
- getResourceBundlein class- Application
- Returns:
- ResourceBundlefor the current UIViewRoot, otherwise null
 
- 
getResourceHandlerDescription copied from class:ApplicationReturn the singleton, stateless, thread-safe ResourceHandlerResourceHandler.- 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. - Overrides:
- getResourceHandlerin class- Application
 
- The 
- 
getStateManagerDescription copied from class:ApplicationReturn 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.- Specified by:
- getStateManagerin class- Application
 
- 
getSupportedLocalesDescription copied from class:ApplicationReturn anIteratorover the supportedLocalesfor this appication.- Specified by:
- getSupportedLocalesin class- Application
 
- 
getValidatorIdsDescription copied from class:ApplicationReturn anIteratorover the set of currently registered validator ids for thisApplication.- Specified by:
- getValidatorIdsin class- Application
 
- 
getViewHandlerDescription copied from class:ApplicationSet theViewHandlerRestore View and Render Responsephases of the request processing lifecycle.- Specified by:
- getViewHandlerin class- Application
- Returns:
 
- 
getWrappedDescription copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.- Specified by:
- getWrappedin interface- FacesWrapper<Application>
- Returns:
- the instance of the class being wrapped
 
- 
publishEventpublic void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source) - Overrides:
- publishEventin class- Application
 
- 
publishEventpublic void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source) Description copied from class:ApplicationIf 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 inApplication.subscribeToEvent(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 implementsSystemEventListenerHolderSystemEventListenerHolder.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 toApplication.subscribeToEvent(java.lang.Class, java.lang.Class, SystemEventListener)traverseListenerListon the list.
- If any Applicationlevel listeners have been installed by previous calls toApplication.subscribeToEvent(java.lang.Class, SystemEventListener)traverseListenerListon the list.
 If the act of invoking the processListenermethod causes anAbortProcessingExceptionAlgorithm traverseListenerList: For each listener in the list,- Call
 SystemEventListener.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
 SystemEvent.isAppropriateListener(jakarta.faces.event.FacesListener)false, take no action on the listener.
- Call
  SystemEvent.processListener(jakarta.faces.event.FacesListener)
 - Overrides:
- publishEventin class- Application
- systemEventClass- - The Class of event that is being published. Must be non-null.
- source- - The- sourcefor the event of type systemEventClass. Must be non-- null, and must implement- SystemEventListenerHolder
 
- If the 
- 
removeELContextListenerpublic void removeELContextListener(jakarta.el.ELContextListener listener) Description copied from class:ApplicationRemove 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.- Overrides:
- removeELContextListenerin class- Application
 
- 
setActionListenerDescription copied from class:ApplicationSet the defaultActionListenerActionSource- Specified by:
- setActionListenerin class- Application
- Parameters:
- listener- - The new default- ActionListener
 
- 
setDefaultLocaleDescription copied from class:ApplicationSet the defaultLocalefor this application.- Specified by:
- setDefaultLocalein class- Application
- Parameters:
- locale- - The new default- Locale
 
- 
setDefaultRenderKitIdDescription copied from class:ApplicationReturn therenderKitIdto be used for rendering this application. If not explicitly set,nullis returned.- Specified by:
- setDefaultRenderKitIdin class- Application
 
- 
setMessageBundleDescription copied from class:ApplicationSet 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.- Specified by:
- setMessageBundlein class- Application
- Parameters:
- bundle- - Base name of the resource bundle to be used
 
- 
setResourceHandler- Overrides:
- setResourceHandlerin class- Application
 
- 
setStateManagerDescription copied from class:ApplicationSet theStateManagerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.- Specified by:
- setStateManagerin class- Application
- Parameters:
- manager- The new- StateManagerinstance
 
- 
setSupportedLocalesDescription copied from class:ApplicationSet theLocaleinstances representing the supportedLocalesfor this application.- Specified by:
- setSupportedLocalesin class- Application
- Parameters:
- locales- The set of supported- Localesfor this application
 
- 
setViewHandlerDescription copied from class:ApplicationSet theViewHandlerinstance that will be utilized during theRestore View and Render Responsephases of the request processing lifecycle.- Specified by:
- setViewHandlerin class- Application
- Parameters:
- handler- - The new- ViewHandlerinstance
 
- 
subscribeToEventpublic void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) - Overrides:
- subscribeToEventin class- Application
 
- 
subscribeToEventpublic void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) - Overrides:
- subscribeToEventin class- Application
 
- 
unsubscribeFromEventpublic void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) - Overrides:
- unsubscribeFromEventin class- Application
 
- 
unsubscribeFromEventpublic void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) - Overrides:
- unsubscribeFromEventin class- Application
 
- 
setFlowHandler- Overrides:
- setFlowHandlerin class- Application
 
- 
getFlowHandler- Overrides:
- getFlowHandlerin class- Application
- Returns:
 
- 
setSearchExpressionHandler- Overrides:
- setSearchExpressionHandlerin class- Application
 
- 
getSearchExpressionHandler- Overrides:
- getSearchExpressionHandlerin class- Application
- Returns:
 
- 
getSearchKeywordResolver- Overrides:
- getSearchKeywordResolverin class- Application
 
- 
addSearchKeywordResolver- Overrides:
- addSearchKeywordResolverin class- Application
 
 
-