-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBehavior(String behaviorId, String behaviorClass) Register a new mapping of behavior id to the name of the correspondingBehaviorclass.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) Register a validator by its id that is applied to allUIInputcomponents in a view.voidaddELContextListener(ELContextListener listener) Provide a way for Faces applications to register anELContextListenerthat will be notified on creation ofELContextinstances.voidaddELResolver(ELResolver resolver) Cause an the argumentresolverto be added to the resolver chain as specified in section 5.3.2 "ELResolver" of the Jakarta Faces Specification Document.voidCause the argumentresolverto be added to the head of the resolver chain.voidaddValidator(String validatorId, String validatorClass) Register a new mapping of validator id to the name of the correspondingValidatorclass.createBehavior(String behaviorId) Instantiate and return a newBehaviorinstance of the class specified by a previous call toaddBehavior()for the specified behavior id.createComponent(ValueExpression componentExpression, FacesContext context, String componentType) createComponent(ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) LikeApplication.createComponent(ValueExpression, FacesContext, String)except theRendererfor the component to be returned must be inspected for the annotations mentioned inApplication.createComponent(ValueExpression, FacesContext, String)as specified in the documentation for that method.createComponent(FacesContext context, Resource componentResource) createComponent(FacesContext context, String componentType, String rendererType) LikeApplication.createComponent(String)except theRendererfor the component to be returned must be inspected for the annotations mentioned inApplication.createComponent(ValueExpression, FacesContext, String)as specified in the documentation for that method.createComponent(String componentType) Instantiate and return a newUIComponentinstance of the class specified by a previous call toaddComponent()for the specified component type.Converter<?> createConverter(Class<?> targetClass) Instantiate and return a newConverterinstance of the class that has registered itself as capable of performing conversions for objects of the specified type.Converter<?> createConverter(String converterId) Instantiate and return a newConverterinstance of the class specified by a previous call toaddConverter()for the specified converter id.Validator<?> createValidator(String validatorId) Instantiate and return a newValidatorinstance of the class specified by a previous call toaddValidator()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 application.Return anIteratorover the set of currently registered behavior ids for thisApplication.Return anIteratorover the set of currently defined component types for thisApplication.Return anIteratorover the set of currently registered converter ids for thisApplication.Return anIteratorover the set ofClassinstances for whichConverterclasses have been explicitly registered.Return the defaultLocalefor this application.Return therenderKitIdto be used for rendering this application.Return an immutableMapover the set of currently registered default validator IDs and their class name for thisApplication.If no calls have been made toApplication.addELContextListener(jakarta.el.ELContextListener), this method must return an empty array.Return the singletonELResolverinstance to be used for all Jakarta Expression Language resolution.Return theExpressionFactoryinstance for this application.Return the thread-safe singletonFlowHandlerfor this application.Return the fully qualified class name of theResourceBundleto be used for Jakarta Faces messages for this application.Return theNavigationHandlerinstance that will be passed the outcome returned by any invoked application action for this web application.Return the project stage for the currently running application instance.getResourceBundle(FacesContext context, String var) Find aResourceBundleas defined in the application configuration resources under the specified name.Return the singleton, stateless, thread-safeResourceHandlerfor this application.Return the thread-safe singletonSearchExpressionHandlerfor this application.Return the singletonSearchKeywordResolverinstance to be used for all search keyword resolution.Return theStateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.Return anIteratorover the supportedLocales for this appication.Return anIteratorover the set of currently registered validator ids for thisApplication.Return theViewHandlerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.voidpublishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source) This method functions exactly likeApplication.publishEvent(FacesContext,Class,Object), except the run-time must use the argumentsourceBaseTypeto find the matching listener instead of using theClassof thesourceargument.voidpublishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Object source) IfFacesContext.isProcessingEvents()istrueand there are one or more listeners for events of the type represented bysystemEventClass, call those listeners, passingsourceas the source of the event.voidremoveELContextListener(ELContextListener listener) Remove the argumentlistenerfrom the list ofELContextListeners.voidsetActionListener(ActionListener actionListener) Set the defaultActionListenerto be registered for allActionSourcecomponents.voidsetCompositeELResolver(FacesCompositeELResolver compositeELResolver) voidsetDefaultLocale(Locale locale) Set the defaultLocalefor this application.voidsetDefaultRenderKitId(String renderKitId) Set therenderKitIdto be used to render this application.voidsetFlowHandler(FlowHandler flowHandler) Set theFlowHandlerinstance used by theNavigationHandlerto satisfy the requirements of the faces flows feature.voidsetMessageBundle(String messageBundle) Set the fully qualified class name of theResourceBundleto be used for Jakarta Faces messages for this application.voidsetNavigationHandler(NavigationHandler navigationHandler) Set theNavigationHandlerinstance that will be passed the outcome returned by any invoked application action for this web application.voidsetResourceHandler(ResourceHandler resourceHandler) Set theResourceHandlerinstance that will be utilized for rendering the markup for resources, and for satisfying client requests to serve up resources.voidsetSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler) Set theSearchExpressionHandlerinstance used by the application.voidsetStateManager(StateManager stateManager) Set theStateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.voidsetSupportedLocales(Collection<Locale> newLocales) Set theLocaleinstances representing the supportedLocales for this application.voidsetViewHandler(ViewHandler viewHandler) Set theViewHandlerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.voidsubscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) Install the listener instance referenced by argumentlistenerinto application as a listener for events of typesystemEventClass.voidsubscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) Install the listener instance referenced by argumentlistenerinto the application as a listener for events of typesystemEventClassthat originate from objects of typesourceClass.voidunsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) Remove the listener instance referenced by argumentlistenerfrom the application as a listener for events of typesystemEventClass.voidunsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) Remove the listener instance referenced by argumentlistenerfrom the application as a listener for events of typesystemEventClassthat originate from objects of typesourceClass.
-
Field Details
-
THIS_LIBRARY
- See Also:
-
-
Constructor Details
-
ApplicationImpl
public ApplicationImpl()Constructor
-
-
Method Details
-
publishEvent
public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Object source) Description copied from class:ApplicationIf
FacesContext.isProcessingEvents()istrueand there are one or more listeners for events of the type represented bysystemEventClass, call those listeners, passingsourceas the source of 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<? extends jakarta.faces.event.SystemEvent>, java.lang.Class<?>, jakarta.faces.event.SystemEventListener)regarding the storage and retrieval of listener instances. Specifically, ifApplication.subscribeToEvent(Class,Class,SystemEventListener)was called, thesourceClassargument must match exactly theClassof thesourceargument in the call topublishEvent(). The implementation must not do any inheritance hierarachy inspection when looking for a match between thesourceClasspassed toApplication.subscribeToEvent(Class,Class,SystemEventListener)and thesourceClasspassed topublishEvent()in order to find any listeners to which the event should be published. In the case where theClassof thesourceargument does not match theClassof thesourceClassused when the listener was subscribed usingsubscribeToEvent(),Application.publishEvent(FacesContext,Class,Class,Object)can be used to provide theClassused to perform the listener lookup and match.The default implementation must implement an algorithm semantically equivalent to the following to locate listener instances and to invoke them.
-
If the
sourceargument implementsSystemEventListenerHolder, callSystemEventListenerHolder.getListenersForEventClass(java.lang.Class<? extends jakarta.faces.event.SystemEvent>)on it, passing thesystemEventClassargument. If the list is not empty, perform algorithm traverseListenerList on the list. -
If any view level listeners have been installed by previous calls to
Application.subscribeToEvent(Class, Class, jakarta.faces.event.SystemEventListener)on theUIViewRoot, perform algorithm traverseListenerList on the list of listeners for that event installed on theUIViewRoot. -
If any
Applicationlevel listeners have been installed by previous calls toApplication.subscribeToEvent(Class, Class, jakarta.faces.event.SystemEventListener), perform algorithm traverseListenerList on the list. -
If any
Applicationlevel listeners have been installed by previous calls toApplication.subscribeToEvent(Class, jakarta.faces.event.SystemEventListener), perform algorithm traverseListenerList on the list.
If the act of invoking the
processListenermethod causes anAbortProcessingExceptionto be thrown, processing of the listeners must be aborted, no further processing of the listeners for this event must take place, and the exception must be logged withLevel.SEVERE.Algorithm traverseListenerList: For each listener in the list,
-
Call
SystemEventListener.isListenerForSource(java.lang.Object), passing thesourceargument. 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), passing the listener instance as the argument. If this returnsfalse, take no action on the listener. -
Call
SystemEvent.processListener(jakarta.faces.event.FacesListener), passing the listener instance.
A default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
publishEventin classApplication- Parameters:
context- theFacesContextfor the current requestsystemEventClass- TheClassof event that is being published.source- The source for the event of typesystemEventClass.- See Also:
-
-
publishEvent
public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source) Description copied from class:ApplicationThis method functions exactly like
Application.publishEvent(FacesContext,Class,Object), except the run-time must use the argumentsourceBaseTypeto find the matching listener instead of using theClassof thesourceargument.A default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
publishEventin classApplication- Parameters:
context- theFacesContextfor the current requestsystemEventClass- TheClassof event that is being published.sourceBaseType- TheClassof the source event that must be used to lookup the listener to which this event must be published. If this argument isnullthe return fromsource.getClass()must be used as thesourceBaseType.source- The source for the event of typesystemEventClass.- See Also:
-
subscribeToEvent
public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) Description copied from class:ApplicationInstall the listener instance referenced by argument
listenerinto application as a listener for events of typesystemEventClass. The default implementation simply calls through toApplication.subscribeToEvent(Class, Class, jakarta.faces.event.SystemEventListener)passingnullas thesourceClassargumentA default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
subscribeToEventin classApplication- Parameters:
systemEventClass- theClassof event for whichlistenermust be fired.listener- the implementation ofSystemEventListenerwhoseSystemEventListener.processEvent(jakarta.faces.event.SystemEvent)method must be called when events of typesystemEventClassare fired.See
Application.subscribeToEvent(java.lang.Class,java.lang.Class,jakarta.faces.event.SystemEventListener)for an additional requirement regarding when it is valid to call this method.- See Also:
-
subscribeToEvent
public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) Description copied from class:ApplicationInstall the listener instance referenced by argument
listenerinto the application as a listener for events of typesystemEventClassthat originate from objects of typesourceClass.If argument
sourceClassis non-null,sourceClassandsystemEventClassmust be used to store the argumentlistenerin the application in such a way that thelistenercan be quickly looked up by the implementation ofApplication.publishEvent(jakarta.faces.context.FacesContext, java.lang.Class<? extends jakarta.faces.event.SystemEvent>, java.lang.Object)givensystemEventClassand an instance of theClassreferenced bysourceClass. If argumentsourceClassisnull, thelistenermust be discoverable by the implementation ofApplication.publishEvent(jakarta.faces.context.FacesContext, java.lang.Class<? extends jakarta.faces.event.SystemEvent>, java.lang.Object)given onlysystemEventClass.It is valid to call this method during the processing of an event which was subscribed to by a previous call to this method.
- Overrides:
subscribeToEventin classApplication- Parameters:
systemEventClass- theClassof event for whichlistenermust be fired.sourceClass- theClassof the instance which causes events of typesystemEventClassto be fired. May benull.listener- the implementation ofSystemEventListenerwhoseSystemEventListener.processEvent(jakarta.faces.event.SystemEvent)method must be called when events of typesystemEventClassare fired.- See Also:
-
unsubscribeFromEvent
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener) Description copied from class:ApplicationRemove the listener instance referenced by argument
listenerfrom the application as a listener for events of typesystemEventClass. The default implementation simply calls through toApplication.unsubscribeFromEvent(Class, jakarta.faces.event.SystemEventListener)passingnullas thesourceClassargumentSee
Application.subscribeToEvent(java.lang.Class,java.lang.Class,jakarta.faces.event.SystemEventListener)for an additional requirement regarding when it is valid to call this method.- Overrides:
unsubscribeFromEventin classApplication- Parameters:
systemEventClass- theClassof event for whichlistenermust be fired.listener- the implementation ofSystemEventListenerto remove from the internal data structure.- See Also:
-
unsubscribeFromEvent
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener) Description copied from class:ApplicationRemove the listener instance referenced by argument
listenerfrom the application as a listener for events of typesystemEventClassthat originate from objects of typesourceClass. SeeApplication.subscribeToEvent(Class, Class, jakarta.faces.event.SystemEventListener)for the specification of how the listener is stored, and therefore, how it must be removed.See
Application.subscribeToEvent(java.lang.Class,java.lang.Class,jakarta.faces.event.SystemEventListener)for an additional requirement regarding when it is valid to call this method.- Overrides:
unsubscribeFromEventin classApplication- Parameters:
systemEventClass- theClassof event for whichlistenermust be fired.sourceClass- theClassof the instance which causes events of typesystemEventClassto be fired. May benull.listener- the implementation ofSystemEventListenerto remove from the internal data structure.- See Also:
-
addELContextListener
Description copied from class:ApplicationProvide a way for Faces applications to register an
ELContextListenerthat will be notified on creation ofELContextinstances. This listener will be called once per request.An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
addELContextListenerin classApplication- Parameters:
listener- the Jakarta Expression Language context listener to add.- See Also:
-
removeELContextListener
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 classApplication- Parameters:
listener- the Jakarta Expression Language context listener to remove.- See Also:
-
getELContextListeners
Description copied from class:ApplicationIf no calls have been made to
Application.addELContextListener(jakarta.el.ELContextListener), this method must return an empty array.Otherwise, return an array representing the list of listeners added by calls to
Application.addELContextListener(jakarta.el.ELContextListener).An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
getELContextListenersin classApplication- Returns:
- an array of Jakarta Expression Language context listeners.
- See Also:
-
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<? extends T>).The implementation must return the
ExpressionFactoryfrom the Expression Language container by callingjakarta.el.ELManager.getExpressionFactory().An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
getExpressionFactoryin classApplication- Returns:
- the expression factory.
- See Also:
-
evaluateExpressionGet
public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws ELException Description copied from class:ApplicationGet a value by evaluating an expression.
Call
Application.getExpressionFactory()then callExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class<?>)passing the argumentexpressionandexpectedType. CallFacesContext.getELContext()and pass it toValueExpression.getValue(jakarta.el.ELContext), returning the result.An implementation is provided that throws
UnsupportedOperationExceptionso that users that decorate theApplicationcontinue to work.- Overrides:
evaluateExpressionGetin classApplication- Type Parameters:
T- the return type.- Parameters:
context- the Faces context.expression- the expression.expectedType- the expected type.- Returns:
- the result of the evaluation.
- Throws:
ELException- See Also:
-
getELResolver
Description copied from class:ApplicationReturn the singleton
ELResolverinstance to be used for all Jakarta Expression Language resolution. This is actually an instance ofCompositeELResolverthat must contain the followingELResolverinstances in the following order:-
ELResolverinstances declared using the <el-resolver> element in the application configuration resources. -
An
implementationthat wraps the head of the legacyVariableResolverchain, as per section VariableResolver ChainWrapper in Chapter 5 in the spec document. -
An
implementationthat wraps the head of the legacyPropertyResolverchain, as per section PropertyResolver ChainWrapper in 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 classApplication- Returns:
- the Jakarta Expression Language resolver.
- See Also:
-
-
addELResolver
Description copied from class:ApplicationCause an the argument
resolverto be added to the resolver chain as specified in section 5.3.2 "ELResolver" of the Jakarta Faces Specification Document.It is not possible to remove an
ELResolverregistered with this method, once it has been registered.It is illegal to register an
ELResolverafter the application has received any requests from the client. If an attempt is made to register a listener after that time, anIllegalStateExceptionmust be thrown. This restriction is in place to allow the Jakarta Server Pages container to optimize for the common case where no additionalELResolvers are in the chain, aside from the standard ones. It is permissible to addELResolvers before or after initialization to aCompositeELResolverthat 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 classApplication- Parameters:
resolver- the Jakarta Expression Language resolver to add.- See Also:
-
getApplicationELResolvers
-
getCompositeELResolver
-
setCompositeELResolver
-
getViewHandler
Description copied from class:ApplicationReturn the
ViewHandlerinstance 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 theViewHandlerdescription in the Jakarta Faces Specification.- Specified by:
getViewHandlerin classApplication- Returns:
- the view handler.
- See Also:
-
setViewHandler
Description copied from class:ApplicationSet the
ViewHandlerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.- Specified by:
setViewHandlerin classApplication- Parameters:
viewHandler- The newViewHandlerinstance- See Also:
-
getResourceHandler
Description copied from class:ApplicationReturn the singleton, stateless, thread-safe
ResourceHandlerfor this application. The Jakarta Faces implementation must support the following techniques for declaring an alternate implementation ofResourceHandler.-
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 the<application>element.
In all of the above cases, the runtime must employ the decorator pattern as for every other pluggable artifact in Jakarta Faces.
A default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
getResourceHandlerin classApplication- Returns:
- the resource handler.
- See Also:
-
-
setResourceHandler
Description copied from class:ApplicationSet the
ResourceHandlerinstance that will be utilized for rendering the markup for resources, and for satisfying client requests to serve up resources.- Overrides:
setResourceHandlerin classApplication- Parameters:
resourceHandler- The newResourceHandlerinstance- See Also:
-
getStateManager
Description copied from class:ApplicationReturn the
StateManagerinstance 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 Jakarta Faces Specification.- Specified by:
getStateManagerin classApplication- Returns:
- the state manager.
- See Also:
-
setStateManager
Description copied from class:ApplicationSet the
StateManagerinstance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.- Specified by:
setStateManagerin classApplication- Parameters:
stateManager- The newStateManagerinstance- See Also:
-
getActionListener
Description copied from class:ApplicationReturn the default
ActionListenerto be registered for allActionSourcecomponents in this application. If not explicitly set, a default implementation must be provided that performs the functions as specified in the section 7.1.1 "ActionListener Property" in the chapter 7 "Application Integration" of the Jakarta Faces Specification Document.Note that the specification for the default
ActionListenercontiues to call for the use of a deprecated property (action) and class (MethodBinding). Unfortunately, this is necessary because the defaultActionListenermust continue to work with components that do not implementActionSource, and only implementActionSource.- Specified by:
getActionListenerin classApplication- Returns:
- the action listener.
- See Also:
-
setActionListener
Description copied from class:ApplicationSet the default
ActionListenerto be registered for allActionSourcecomponents.- Specified by:
setActionListenerin classApplication- Parameters:
actionListener- The new defaultActionListener- See Also:
-
getFlowHandler
Description copied from class:ApplicationReturn the thread-safe singleton
FlowHandlerfor this application. For implementations declaring compliance with version 2.2 of the specification, this method must never returnnull, even if the application has no flows. This is necessary to enable dynamic flow creation during the application's lifetime.All implementations that declare compliance with version 2.2 of the specification must implement this method. For the purpose of backward compatibility with environments that extend
Applicationbut do not override this method, an implementation is provided that returnsnull. Due to the decoratable nature ofApplication, code calling this method should always check for anullreturn.- Overrides:
getFlowHandlerin classApplication- Returns:
- the flow handler.
-
setFlowHandler
Description copied from class:ApplicationSet the
FlowHandlerinstance used by theNavigationHandlerto satisfy the requirements of the faces flows feature.- Overrides:
setFlowHandlerin classApplication- Parameters:
flowHandler- the flow handler to set.
-
getSupportedLocales
Description copied from class:ApplicationReturn an
Iteratorover the supportedLocales for this appication.- Specified by:
getSupportedLocalesin classApplication- Returns:
- an iterator of the supported locales.
- See Also:
-
setSupportedLocales
Description copied from class:ApplicationSet the
Localeinstances representing the supportedLocales for this application.- Specified by:
setSupportedLocalesin classApplication- Parameters:
newLocales- The set of supportedLocales for this application- See Also:
-
getDefaultLocale
Description copied from class:ApplicationReturn the default
Localefor this application. If not explicitly set,nullis returned.- Specified by:
getDefaultLocalein classApplication- Returns:
- the default Locale, or
null. - See Also:
-
setDefaultLocale
Description copied from class:ApplicationSet the default
Localefor this application.- Specified by:
setDefaultLocalein classApplication- Parameters:
locale- The new defaultLocale- See Also:
-
setMessageBundle
Description copied from class:ApplicationSet the fully qualified class name of the
ResourceBundleto be used for Jakarta 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 classApplication- Parameters:
messageBundle- Base name of the resource bundle to be used- See Also:
-
getMessageBundle
Description copied from class:ApplicationReturn the fully qualified class name of the
ResourceBundleto be used for Jakarta Faces messages for this application. If not explicitly set,nullis returned.- Specified by:
getMessageBundlein classApplication- Returns:
- the message bundle class name, or
null. - See Also:
-
getDefaultRenderKitId
Description copied from class:ApplicationReturn the
renderKitIdto be used for rendering this application. If not explicitly set,nullis returned.- Specified by:
getDefaultRenderKitIdin classApplication- Returns:
- the default render kit id, or
null. - See Also:
-
setDefaultRenderKitId
Description copied from class:ApplicationSet the
renderKitIdto be used to render this application. Unless the client has provided a customViewHandlerthat supports the use of multipleRenderKitinstances in the same application, this method must only be called at application startup, before any Faces requests have been processed. This is a limitation of the current Specification, and may be lifted in a future release.- Specified by:
setDefaultRenderKitIdin classApplication- Parameters:
renderKitId- the render kit id to set.- See Also:
-
getResourceBundle
Description 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 currentUIViewRoot.The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend this class.- Overrides:
getResourceBundlein classApplication- Parameters:
context- the Faces context.var- the name of the resource bundle.- Returns:
- the resource bundle.
- See Also:
-
addBehavior
Description copied from class:ApplicationRegister a new mapping of behavior id to the name of the corresponding
Behaviorclass. This allows subsequent calls tocreateBehavior()to serve as a factory forBehaviorinstances.- Overrides:
addBehaviorin classApplication- Parameters:
behaviorId- The behavior id to be registeredbehaviorClass- The fully qualified class name of the correspondingBehaviorimplementation- See Also:
-
createBehavior
Description copied from class:ApplicationInstantiate and return a new
Behaviorinstance of the class specified by a previous call toaddBehavior()for the specified behavior id.- Overrides:
createBehaviorin classApplication- Parameters:
behaviorId- The behavior id for which to create and return a newBehaviorinstance- Returns:
- the behavior.
- Throws:
FacesException- if theBehaviorcannot be created- See Also:
-
getBehaviorIds
Description copied from class:ApplicationReturn an
Iteratorover the set of currently registered behavior ids for thisApplication.- Overrides:
getBehaviorIdsin classApplication- Returns:
- an iterator with behavior ids.
- See Also:
-
createComponent
Description copied from class:ApplicationInstantiate and return a new
UIComponentinstance of the class specified by a previous call toaddComponent()for the specified component type.Before the component instance is returned, it must be inspected for the presence of a
ListenerFor(orListenersFor) orResourceDependency(orResourceDependencies) annotation. If any of these annotations are present, the action listed inListenerFororResourceDependencymust be taken on the component, before it is returned from this method. This variant ofcreateComponentmust not inspect theRendererfor the component to be returned for any of the afore mentioned annotations. Such inspection is the province ofApplication.createComponent(ValueExpression, FacesContext, String, String)orApplication.createComponent(FacesContext, String, String).- Specified by:
createComponentin classApplication- Parameters:
componentType- The component type for which to create and return a newUIComponentinstance- Returns:
- the UI component.
- Throws:
FacesException- if aUIComponentof the specified type cannot be created
-
addComponent
Description copied from class:ApplicationRegister a new mapping of component type to the name of the corresponding
UIComponentclass. This allows subsequent calls tocreateComponent()to serve as a factory forUIComponentinstances.- Specified by:
addComponentin classApplication- Parameters:
componentType- The component type to be registeredcomponentClass- The fully qualified class name of the correspondingUIComponentimplementation- See Also:
-
createComponent
public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException Description copied from class:ApplicationCall the
getValue()method on the specifiedValueExpression. If it returns aUIComponentinstance, 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 thesetValue()method of the specifiedValueExpression, and return it.Before the component instance is returned, it must be inspected for the presence of a
ListenerFor(orListenersFor) orResourceDependency(orResourceDependencies) annotation. If any of these annotations are present, the action listed inListenerFororResourceDependencymust be taken on the component, before it is returned from this method. This variant ofcreateComponentmust not inspect theRendererfor the component to be returned for any of the afore mentioned annotations. Such inspection is the province ofApplication.createComponent(ValueExpression, FacesContext, String, String)orApplication.createComponent(FacesContext, String, String).A default implementation is provided that throws
UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function.- Overrides:
createComponentin classApplication- 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 theValueExpressiondoes not return a component instance- Returns:
- the UI component.
- Throws:
FacesException- if aUIComponentcannot be created
-
createComponent
public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) Description copied from class:ApplicationLike
Application.createComponent(ValueExpression, FacesContext, String)except theRendererfor the component to be returned must be inspected for the annotations mentioned inApplication.createComponent(ValueExpression, FacesContext, String)as specified in the documentation for that method. TheRendererinstance to inspect must be obtained by callingFacesContext.getRenderKit()and callingRenderKit.getRenderer(java.lang.String, java.lang.String)on the result, passing the argumentcomponentTypeas the first argument and the result of callingUIComponent.getFamily()on the newly created component as the second argument. If no suchRenderercan be found, a message must be logged with a helpful error message. Otherwise,UIComponent.setRendererType(java.lang.String)must be called on the newly createdUIComponentinstance, passing the argumentrendererTypeas the argument.A default implementation is provided that throws
UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function.- Overrides:
createComponentin classApplication- 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 theValueExpressiondoes not return a component instancerendererType- The renderer-type of theRendererthat will render this component. Anullvalue must be accepted for this parameter.- Returns:
- the UI component.
-
createComponent
Description copied from class:ApplicationLike
Application.createComponent(String)except theRendererfor the component to be returned must be inspected for the annotations mentioned inApplication.createComponent(ValueExpression, FacesContext, String)as specified in the documentation for that method. TheRendererinstance to inspect must be obtained by callingFacesContext.getRenderKit()and callingRenderKit.getRenderer(java.lang.String, java.lang.String)on the result, passing the argumentcomponentTypeas the first argument and the result of callingUIComponent.getFamily()on the newly created component as the second argument. If no suchRenderercan be found, a message must be logged with a helpful error message. Otherwise,UIComponent.setRendererType(java.lang.String)must be called on the newly createdUIComponentinstance, passing the argumentrendererTypeas the argument.A default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
createComponentin classApplication- Parameters:
context-FacesContextfor the current requestcomponentType- Component type to createrendererType- The renderer-type of theRendererthat will render this component. Anullvalue must be accepted for this parameter.- Returns:
- the UI component.
-
createComponent
public UIComponent createComponent(FacesContext context, Resource componentResource) throws FacesException Description copied from class:ApplicationInstantiate and return a new
UIComponentinstance from the argumentResource. An algorithm semantically equivalent to the following must be followed to instantiate theUIComponentto return.-
Obtain a reference to the
ViewDeclarationLanguagefor thisApplicationinstance by callingViewHandler.getViewDeclarationLanguage(jakarta.faces.context.FacesContext, java.lang.String), passing theviewIdfound by callingUIViewRoot.getViewId()on theUIViewRootin the argumentFacesContext. -
Obtain a reference to the composite component metadata for this composite component by calling
ViewDeclarationLanguage.getComponentMetadata(jakarta.faces.context.FacesContext, jakarta.faces.application.Resource), passing thefacesContextandcomponentResourcearguments to this method. This version of the Jakarta Faces Specification uses JavaBeans as the API to the component metadata. -
Determine if the component author declared a
componentTypefor this component instance by obtaining theBeanDescriptorfrom the component metadata and calling itsgetValue()method, passingUIComponent.COMPOSITE_COMPONENT_TYPE_KEYas the argument. If non-null, the result must be aValueExpressionwhose value is thecomponent-typeof theUIComponentto be created for thisResourcecomponent. Call through toApplication.createComponent(java.lang.String)to create the component. -
Otherwise, determine if a script based component for this
Resourcecan be found by callingViewDeclarationLanguage.getScriptComponentResource(jakarta.faces.context.FacesContext, jakarta.faces.application.Resource). If the result is non-null, and is a script written in a language satisfying the content typetext/javascript, create aUIComponentinstance from the script resource. -
Otherwise, let library-name be the return from calling
Resource.getLibraryName()on the argumentcomponentResourceand resource-name be the return from callingResource.getResourceName()on the argumentcomponentResource. Create a fully qualified Java class name by removing any file extension from resource-name and let fqcn belibrary-name + "." + resource-name. If a class with the name of fqcn cannot be found, take no action and continue to the next step. If any ofInstantiationException,IllegalAccessException, orClassCastExceptionare thrown, wrap the exception in aFacesExceptionand re-throw it. If any other exception is thrown, log the exception and continue to the next step. -
If none of the previous steps have yielded a
UIComponentinstance, callApplication.createComponent(java.lang.String)passing "jakarta.faces.NamingContainer" as the argument. -
Call
UIComponent.setRendererType(java.lang.String)on theUIComponentinstance, passing "jakarta.faces.Composite" as the argument. -
Store the argument
Resourcein the attributesMapof theUIComponentunder the key,Resource.COMPONENT_RESOURCE_KEY. -
Store composite component metadata in the attributes
Mapof theUIComponentunder the key,UIComponent.BEANINFO_KEY.
Before the component instance is returned, it must be inspected for the presence of a
ListenerForannotation. If this annotation is present, the action listed inListenerFormust be taken on the component, before it is returned from this method.A default implementation is provided that throws
UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function.- Overrides:
createComponentin classApplication- Parameters:
context-FacesContextfor the current requestcomponentResource- AResourcethat points to a source file that provides an implementation of a component.- Returns:
- the UI component.
- Throws:
FacesException- if aUIComponentfrom theResourcecannot be created
-
-
getComponentTypes
Description copied from class:ApplicationReturn an
Iteratorover the set of currently defined component types for thisApplication.- Specified by:
getComponentTypesin classApplication- Returns:
- an iterator with component types.
- See Also:
-
addConverter
Description copied from class:ApplicationRegister a new mapping of converter id to the name of the corresponding
Converterclass. This allows subsequent calls tocreateConverter()to serve as a factory forConverterinstances.- Specified by:
addConverterin classApplication- Parameters:
converterId- The converter id to be registeredconverterClass- The fully qualified class name of the correspondingConverterimplementation- See Also:
-
addConverter
Description copied from class:ApplicationRegister a new converter class that is capable of performing conversions for the specified target class.
- Specified by:
addConverterin classApplication- Parameters:
targetClass- The class for which this converter is registeredconverterClass- The fully qualified class name of the correspondingConverterimplementation- See Also:
-
createConverter
Description copied from class:ApplicationInstantiate and return a new
Converterinstance of the class specified by a previous call toaddConverter()for the specified converter id.If the
toLowerCase()of theStringrepresenation of the value of the "jakarta.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE" application configuration parameter is "true" (without the quotes) and theConverterinstance to be returned is an instance ofDateTimeConverter,DateTimeConverter.setTimeZone(java.util.TimeZone)must be called, passing the return fromTimeZone.getDefault().The argument
convertermust be inspected for the presence of theResourceDependencyannotation. If theResourceDependencyannotation is present, the action described inResourceDependencymust be taken. If theResourceDependencyannotation is not present, the argumentconvertermust be inspected for the presence of theResourceDependenciesannotation. If theResourceDependenciesannotation is present, the action described inResourceDependenciesmust be taken.- Specified by:
createConverterin classApplication- Parameters:
converterId- The converter id for which to create and return a newConverterinstance- Returns:
- the converter.
- See Also:
-
createConverter
Description copied from class:ApplicationInstantiate and return a new
Converterinstance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no suchConverterclass can be identified, returnnull.To locate an appropriate
Converterclass, the following algorithm is performed, stopping as soon as an appropriateConverterclass is found:- Locate a
Converterregistered for the target class itself. - Locate a
Converterregistered for interfaces that are implemented by the target class (directly or indirectly). - Locate a
Converterregistered for the superclass (if any) of the target class, recursively working up the inheritance hierarchy.
If the
Converterhas a single argument constructor that accepts aClass, instantiate theConverterusing that constructor, passing the argumenttargetClassas the sole argument. Otherwise, simply use the zero-argument constructor.If the
toLowerCase()of theStringrepresenation of the value of the "jakarta.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE" application configuration parameter is "true" (without the quotes) and theConverterinstance to be returned is an instance ofDateTimeConverter,DateTimeConverter.setTimeZone(java.util.TimeZone)must be called, passing the return fromTimeZone.getDefault().- Specified by:
createConverterin classApplication- Parameters:
targetClass- Target class for which to return aConverter- Returns:
- the converter.
- See Also:
- Locate a
-
getConverterIds
Description copied from class:ApplicationReturn an
Iteratorover the set of currently registered converter ids for thisApplication.- Specified by:
getConverterIdsin classApplication- Returns:
- an iterator with converter ids.
- See Also:
-
getConverterTypes
Description copied from class:ApplicationReturn an
Iteratorover the set ofClassinstances for whichConverterclasses have been explicitly registered.- Specified by:
getConverterTypesin classApplication- Returns:
- an iterator with converter types.
- See Also:
-
addValidator
Description copied from class:ApplicationRegister a new mapping of validator id to the name of the corresponding
Validatorclass. This allows subsequent calls tocreateValidator()to serve as a factory forValidatorinstances.- Specified by:
addValidatorin classApplication- Parameters:
validatorId- The validator id to be registeredvalidatorClass- The fully qualified class name of the correspondingValidatorimplementation- See Also:
-
createValidator
Description copied from class:ApplicationInstantiate and return a new
Validatorinstance of the class specified by a previous call toaddValidator()for the specified validator id.The argument
validatormust be inspected for the presence of theResourceDependencyannotation. If theResourceDependencyannotation is present, the action described inResourceDependencymust be taken. If theResourceDependencyannotation is not present, the argumentvalidatormust be inspected for the presence of theResourceDependenciesannotation. If theResourceDependenciesannotation is present, the action described inResourceDependenciesmust be taken.- Specified by:
createValidatorin classApplication- Parameters:
validatorId- The validator id for which to create and return a newValidatorinstance- Returns:
- the validator.
- Throws:
FacesException- if aValidatorof the specified id cannot be created- See Also:
-
getValidatorIds
Description copied from class:ApplicationReturn an
Iteratorover the set of currently registered validator ids for thisApplication.- Specified by:
getValidatorIdsin classApplication- Returns:
- an iterator of validator ids.
- See Also:
-
addDefaultValidatorId
Description copied from class:ApplicationRegister a validator by its id that is applied to all
UIInputcomponents in a view. The validator to most often serve this role is theBeanValidator. The usage contract for this method assumes that the validator has been registered using the normal “by-id” registration mechanism.An implementation is provided that takes no action so that users that decorate the
Applicationcontinue to work.- Overrides:
addDefaultValidatorIdin classApplication- Parameters:
validatorId- the validator id.- See Also:
-
getDefaultValidatorInfo
Description copied from class:ApplicationReturn an immutable
Mapover the set of currently registered default validator IDs and their class name for thisApplication.An implementation is provided that returns
Collections.emptyMapso that users that decorate theApplicationcontinue to work.- Overrides:
getDefaultValidatorInfoin classApplication- Returns:
- a map of default validator information.
- See Also:
-
getProjectStage
Description 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_NAME(return type ofjava.lang.String). If found, continue with the algorithm below, otherwise, look for an entry in theinitParamMapof theExternalContextfrom the currentFacesContextwith the key given by the value ofProjectStage.PROJECT_STAGE_PARAM_NAMEIf a value is 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.A default implementation is provided that throws
.UnsupportedOperationExceptionso that users that decorateApplicationcan continue to function- Overrides:
getProjectStagein classApplication- Returns:
- the project stage.
- See Also:
-
getSearchExpressionHandler
Description copied from class:ApplicationReturn the thread-safe singleton
SearchExpressionHandlerfor this application.- Overrides:
getSearchExpressionHandlerin classApplication- Returns:
- the
SearchExpressionHandler.
-
setSearchExpressionHandler
Description copied from class:ApplicationSet the
SearchExpressionHandlerinstance used by the application.- Overrides:
setSearchExpressionHandlerin classApplication- Parameters:
searchExpressionHandler- theSearchExpressionHandler.
-
addSearchKeywordResolver
Description copied from class:ApplicationCause the argument
resolverto be added to the head of the resolver chain.It is not possible to remove a
SearchKeywordResolverregistered with this method, once it has been registered.The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extendApplication.- Overrides:
addSearchKeywordResolverin classApplication- Parameters:
resolver- the SearchKeywordResolver to add.
-
getSearchKeywordResolver
Description copied from class:ApplicationReturn the singleton
SearchKeywordResolverinstance to be used for all search keyword resolution. This is actually an instance of a composite SearchKeywordResolver that must contain the followingSearchKeywordResolverinstances in the following order:-
SearchKeywordResolverinstances declared using the <search-keyword-resolver> element in the application configuration resources. -
Any
SearchKeywordResolverinstances added by calls toApplication.addSearchKeywordResolver(jakarta.faces.component.search.SearchKeywordResolver). -
The
SearchKeywordResolverimplementations for@all,@child(n),@form,@id(...),@namingcontainer,@next,@none,@parent,@previous,@rootand@this.
The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extendApplication.- Overrides:
getSearchKeywordResolverin classApplication- Returns:
- the
SearchKeywordResolver.
-
-