Class ApplicationWrapper

java.lang.Object
jakarta.faces.application.Application
jakarta.faces.application.ApplicationWrapper
All Implemented Interfaces:
FacesWrapper<Application>

public abstract class ApplicationWrapper extends Application implements FacesWrapper<Application>
Since:
2.0
  • Constructor Details

    • ApplicationWrapper

      @Deprecated public ApplicationWrapper()
      Deprecated.
    • ApplicationWrapper

      public ApplicationWrapper(Application delegate)
  • Method Details

    • addBehavior

      public void addBehavior(String behaviorId, String behaviorClass)
      Overrides:
      addBehavior in class Application
    • addComponent

      public void addComponent(String componentType, String componentClass)
      Description copied from class: Application
      Register a new mapping of component type to the name of the corresponding UIComponent class. This allows subsequent calls to createComponent() to serve as a factory for UIComponent instances.
      Specified by:
      addComponent in class Application
      Parameters:
      componentType - - The component type to be registered
      componentClass - - The fully qualified class name of the corresponding UIComponent implementation
    • addConverter

      public void addConverter(Class<?> targetClass, String converterClass)
      Description copied from class: Application
      Register a new converter class that is capable of performing conversions for the specified target class.
      Specified by:
      addConverter in class Application
      Parameters:
      targetClass - - The class for which this converter is registered
      converterClass - - The fully qualified class name of the corresponding Converter implementation
    • addConverter

      public void addConverter(String converterId, String converterClass)
      Description copied from class: Application
      Register a new mapping of converter id to the name of the corresponding Converter class. This allows subsequent calls to createConverter() to serve as a factory for Converter instances.
      Specified by:
      addConverter in class Application
      Parameters:
      converterId - - The converterId to be registered
      converterClass - - The fully qualified class name of the corresponding Converter implementation
    • addDefaultValidatorId

      public void addDefaultValidatorId(String validatorId)
      Overrides:
      addDefaultValidatorId in class Application
    • addELContextListener

      public void addELContextListener(jakarta.el.ELContextListener listener)
      Description copied from class: Application

      Provide a way for Faces applications to register an ELContextListener that will be notified on creation of ELContext instances.

      An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

      Overrides:
      addELContextListener in class Application
    • addELResolver

      public void addELResolver(jakarta.el.ELResolver resolver)
      Description copied from class: Application

      Cause an the argument resolver to 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 ELResolver registered 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. ELResolvers are in the chain, aside from the standard ones. It is permissible to add ELResolvers before or after initialization to a CompositeELResolver that is already in the chain.

      The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend Application.

      Overrides:
      addELResolver in class Application
    • addValidator

      public void addValidator(String validatorId, String validatorClass)
      Description copied from class: Application
      Register a new mapping of validator id to the name of the corresponding Validator class. This allows subsequent calls to createValidator() to serve as a factory for Validator instances.
      Specified by:
      addValidator in class Application
      Parameters:
      validatorId - The validator id to be registered
      validatorClass - The fully qualified class name of the corresponding Validator implementation
    • createBehavior

      public Behavior createBehavior(String behaviorId) throws FacesException
      Overrides:
      createBehavior in class Application
      Returns:
      Throws:
      FacesException
    • createComponent

      public UIComponent createComponent(FacesContext context, Resource componentResource)
      Description copied from class: Application
      ???
      Overrides:
      createComponent in class Application
      Returns:
    • createComponent

      public UIComponent createComponent(FacesContext context, String componentType, String rendererType)
      Overrides:
      createComponent in class Application
      Returns:
    • createComponent

      public UIComponent createComponent(String componentType) throws FacesException
      Description copied from class: Application

      Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.

      Specified by:
      createComponent in 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.
    • createComponent

      public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
      Overrides:
      createComponent in class Application
      Returns:
    • createComponent

      public UIComponent createComponent(jakarta.el.ValueExpression componentExpression, FacesContext contexte, String componentType) throws FacesException
      Description copied from class: Application

      Call the getValue() method on the specified ValueExpression. If it returns a UIComponent instance, return it as the value of this method. If it does not, instantiate a new UIComponent instance of the specified component type, pass the new component to the setValue() method of the specified ValueExpression, and return it.

      Overrides:
      createComponent in class Application
      Parameters:
      componentExpression - - ValueExpression representing a component value expression (typically specified by the component attribute of a custom tag)
      contexte - - FacesContext for the current request
      componentType - - Component type to create if the ValueExpression does not return a component instance
      Throws:
      FacesException - if a UIComponent cannot be created
    • createConverter

      public Converter createConverter(Class<?> targetClass)
      Description copied from class: Application

      Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no such Converter class can be identified, return null.

      To locate an appropriate Converter class, the following algorithm is performed, stopping as soon as an appropriate Converter class is found: Locate a Converter registered for the target class itself. Locate a Converter registered for interfaces that are implemented by the target class (directly or indirectly). Locate a Converter registered for the superclass (if any) of the target class, recursively working up the inheritance hierarchy.

      If the Converter has a single argument constructor that accepts a Class, instantiate the Converter using that constructor, passing the argument targetClass as the sole argument. Otherwise, simply use the zero-argument constructor.

      Specified by:
      createConverter in class Application
      Parameters:
      targetClass - - Target class for which to return a Converter
    • createConverter

      public Converter createConverter(String converterId)
      Description copied from class: Application
      Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id. If there is no such registration for this converter id, return null.
      Specified by:
      createConverter in class Application
      Parameters:
      converterId - - The converter id for which to create and return a new Converter instance
    • createValidator

      public Validator createValidator(String validatorId) throws FacesException
      Description copied from class: Application
      Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.
      Specified by:
      createValidator in class Application
      Parameters:
      validatorId - The Validator id for which to create and return a new Validator instance
      Throws:
      FacesException - if a Validator of the specified id cannot be created
    • evaluateExpressionGet

      public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws jakarta.el.ELException
      Description copied from class: Application

      Get a value by evaluating an expression.

      Call Application.getExpressionFactory() then call ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class) passing the argument expression and expectedType. Call FacesContext.getELContext() and pass it to ValueExpression.getValue(jakarta.el.ELContext), returning the result.

      An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

      Overrides:
      evaluateExpressionGet in class Application
      Throws:
      jakarta.el.ELException
    • getActionListener

      public ActionListener getActionListener()
      Description copied from class: Application

      Return the default ActionListener to be registered for all ActionSource components in this appication. If not explicitly set, a default implementation must be provided that performs the following functions:

      • The processAction() method must first call FacesContext.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 action property, retrieve the MethodExpression from the property, and call invoke() 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 the NavigationHandler instance for this application and call NavigationHandler.handleNavigation(jakarta.faces.context.FacesContext, java.lang.String, java.lang.String) passing:
      • the FacesContext for the current request
      • If there is a MethodExpression instance for the action property of this component, the result of calling Expression.getExpressionString() on it, null otherwise
      • the logical outcome as determined above

      Specified by:
      getActionListener in class Application
    • getBehaviorIds

      public Iterator<String> getBehaviorIds()
      Overrides:
      getBehaviorIds in class Application
      Returns:
    • getComponentTypes

      public Iterator<String> getComponentTypes()
      Description copied from class: Application
      Return an Iterator over the set of currently defined component types for this Application.
      Specified by:
      getComponentTypes in class Application
    • getConverterIds

      public Iterator<String> getConverterIds()
      Description copied from class: Application
      Return an Iterator over the set of currently registered converter ids for this Application
      Specified by:
      getConverterIds in class Application
      Returns:
    • getConverterTypes

      public Iterator<Class<?>> getConverterTypes()
      Description copied from class: Application
      Return an Iterator over the set of Class instances for which Converter classeshave been explicitly registered.
      Specified by:
      getConverterTypes in class Application
      Returns:
    • getDefaultLocale

      public Locale getDefaultLocale()
      Description copied from class: Application
      Return the default Locale for this application. If not explicitly set, null is returned.
      Specified by:
      getDefaultLocale in class Application
      Returns:
    • getDefaultRenderKitId

      public String getDefaultRenderKitId()
      Description copied from class: Application
      Return the renderKitId to be used for rendering this application. If not explicitly set, null is returned.
      Specified by:
      getDefaultRenderKitId in class Application
      Returns:
    • getDefaultValidatorInfo

      public Map<String,String> getDefaultValidatorInfo()
      Overrides:
      getDefaultValidatorInfo in class Application
      Returns:
    • getELContextListeners

      public jakarta.el.ELContextListener[] getELContextListeners()
      Description copied from class: Application

      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 implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

      Overrides:
      getELContextListeners in class Application
    • getELResolver

      public jakarta.el.ELResolver getELResolver()
      Description copied from class: Application
      Return the singleton ELResolver instance to be used for all EL resolution. This is actually an instance of CompositeELResolver that must contain the following ELResolver instances in the following order:
      • ELResolver instances declared using the <el-resolver> element in the application configuration resources.
      • An implementation that wraps the head of the legacy VariableResolver chain, as per section VariableResolver ChainWrapper in Chapter 5 in the spec document.
      • An implementation that wraps the head of the legacy PropertyResolver chain, as per section PropertyResolver ChainWrapper in Chapter 5 in the spec document.
      • Any ELResolver instances added by calls to Application.addELResolver(jakarta.el.ELResolver).
      • The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend Application.
      Overrides:
      getELResolver in class Application
    • getExpressionFactory

      public jakarta.el.ExpressionFactory getExpressionFactory()
      Description copied from class: Application

      Return the ExpressionFactory instance for this application. This instance is used by the convenience method Application.evaluateExpressionGet(jakarta.faces.context.FacesContext, java.lang.String, java.lang.Class).

      An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

      Overrides:
      getExpressionFactory in class Application
      Returns:
    • getMessageBundle

      public String getMessageBundle()
      Description copied from class: Application
      Return the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application. If not explicitly set, null is returned.
      Specified by:
      getMessageBundle in class Application
    • getNavigationHandler

      public NavigationHandler getNavigationHandler()
      Description copied from class: Application
      Return the NavigationHandler instance 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 the NavigationHandler class description.
      Specified by:
      getNavigationHandler in class Application
    • getProjectStage

      public ProjectStage getProjectStage()
      Description copied from class: Application

      Return the project stage for the currently running application instance. The default value is ProjectStage.Production

      The 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 JNDI environment entry under the key given by the value of ProjectStage.PROJECT_STAGE_JNDI_NAME (return type of java.lang.String). If found, continue with the algorithm below, otherwise, look for an entry in the initParamMap of the ExternalContext from the current FacesContext with the key ProjectStage.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 the initParamMap. 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.Production and return it.
      Overrides:
      getProjectStage in class Application
    • getResourceBundle

      public ResourceBundle getResourceBundle(FacesContext ctx, String name)
      Description copied from class: Application

      Find a ResourceBundle as defined in the application configuration resources under the specified name. If a ResourceBundle was defined for the name, return an instance that uses the locale of the current UIViewRoot.

      The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

      Overrides:
      getResourceBundle in class Application
      Returns:
      ResourceBundle for the current UIViewRoot, otherwise null
    • getResourceHandler

      public ResourceHandler getResourceHandler()
      Description copied from class: Application

      Return the singleton, stateless, thread-safe ResourceHandler for this application. The Faces implementation must support the following techniques for declaring an alternate implementation of ResourceHandler.

      • The ResourceHandler implementation 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.
      • 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:
      getResourceHandler in class Application
    • getStateManager

      public StateManager getStateManager()
      Description copied from class: Application
      Return the StateManager instance 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 the StateManager description in the JavaServer Faces Specification.
      Specified by:
      getStateManager in class Application
    • getSupportedLocales

      public Iterator<Locale> getSupportedLocales()
      Description copied from class: Application
      Return an Iterator over the supported Locales for this appication.
      Specified by:
      getSupportedLocales in class Application
    • getValidatorIds

      public Iterator<String> getValidatorIds()
      Description copied from class: Application
      Return an Iterator over the set of currently registered validator ids for this Application.
      Specified by:
      getValidatorIds in class Application
    • getViewHandler

      public ViewHandler getViewHandler()
      Description copied from class: Application
      Set the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
      Specified by:
      getViewHandler in class Application
      Returns:
    • getWrapped

      public Application getWrapped()
      Description copied from interface: FacesWrapper
      A class that implements this interface uses this method to return an instance of the class being wrapped.
      Specified by:
      getWrapped in interface FacesWrapper<Application>
      Returns:
      the instance of the class being wrapped
    • publishEvent

      public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
      Overrides:
      publishEvent in class Application
    • publishEvent

      public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source)
      Description copied from class: Application

      If there are one or more listeners for events of the type represented by systemEventClass, call those listeners,passing source as the source of the event. The implementation should be as fast as possible in determining whether or not a listener for the given systemEventClass and source has been installed, and should return immediately once such a determination has been made. The implementation of publishEvent must honor the requirements stated in Application.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 act of invoking the processListener method causes an AbortProcessingException to be thrown, processing of the listeners must be aborted.

      Algorithm traverseListenerList: For each listener in the list,

      Overrides:
      publishEvent in class Application
      systemEventClass - - The Class of event that is being published. Must be non-null.
      source - - The source for the event of type systemEventClass. Must be non- null, and must implement SystemEventListenerHolder.
    • removeELContextListener

      public void removeELContextListener(jakarta.el.ELContextListener listener)
      Description copied from class: Application

      Remove the argument listener from the list of ELContextListeners. If listener is null, no exception is thrown and no action is performed. If listener is not in the list, no exception is thrown and no action is performed.

      An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

      Overrides:
      removeELContextListener in class Application
    • setActionListener

      public void setActionListener(ActionListener listener)
      Description copied from class: Application
      Set the default ActionListener to be registered for all ActionSource components.
      Specified by:
      setActionListener in class Application
      Parameters:
      listener - - The new default ActionListener
    • setDefaultLocale

      public void setDefaultLocale(Locale locale)
      Description copied from class: Application
      Set the default Locale for this application.
      Specified by:
      setDefaultLocale in class Application
      Parameters:
      locale - - The new default Locale
    • setDefaultRenderKitId

      public void setDefaultRenderKitId(String renderKitId)
      Description copied from class: Application
      Return the renderKitId to be used for rendering this application. If not explicitly set, null is returned.
      Specified by:
      setDefaultRenderKitId in class Application
    • setMessageBundle

      public void setMessageBundle(String bundle)
      Description copied from class: Application
      Set the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application. See the JavaDocs for the java.util.ResourceBundle class for more information about the syntax for resource bundle names.
      Specified by:
      setMessageBundle in class Application
      Parameters:
      bundle - - Base name of the resource bundle to be used
    • setNavigationHandler

      public void setNavigationHandler(NavigationHandler handler)
      Description copied from class: Application
      Set the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.
      Specified by:
      setNavigationHandler in class Application
      Parameters:
      handler - - The new NavigationHandler instance
    • setResourceHandler

      public void setResourceHandler(ResourceHandler resourceHandler)
      Overrides:
      setResourceHandler in class Application
    • setStateManager

      public void setStateManager(StateManager manager)
      Description copied from class: Application
      Set the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
      Specified by:
      setStateManager in class Application
      Parameters:
      manager - The new StateManagerinstance
    • setSupportedLocales

      public void setSupportedLocales(Collection<Locale> locales)
      Description copied from class: Application
      Set the Locale instances representing the supported Locales for this application.
      Specified by:
      setSupportedLocales in class Application
      Parameters:
      locales - The set of supported Locales for this application
    • setViewHandler

      public void setViewHandler(ViewHandler handler)
      Description copied from class: Application
      Set the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
      Specified by:
      setViewHandler in class Application
      Parameters:
      handler - - The new ViewHandler instance
    • subscribeToEvent

      public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
      Overrides:
      subscribeToEvent in class Application
    • subscribeToEvent

      public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
      Overrides:
      subscribeToEvent in class Application
    • unsubscribeFromEvent

      public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
      Overrides:
      unsubscribeFromEvent in class Application
    • unsubscribeFromEvent

      public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
      Overrides:
      unsubscribeFromEvent in class Application
    • setFlowHandler

      public void setFlowHandler(FlowHandler flowHandler)
      Overrides:
      setFlowHandler in class Application
    • getFlowHandler

      public FlowHandler getFlowHandler()
      Overrides:
      getFlowHandler in class Application
      Returns:
    • setSearchExpressionHandler

      public void setSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler)
      Overrides:
      setSearchExpressionHandler in class Application
    • getSearchExpressionHandler

      public SearchExpressionHandler getSearchExpressionHandler()
      Overrides:
      getSearchExpressionHandler in class Application
      Returns:
    • getSearchKeywordResolver

      public SearchKeywordResolver getSearchKeywordResolver()
      Overrides:
      getSearchKeywordResolver in class Application
    • addSearchKeywordResolver

      public void addSearchKeywordResolver(SearchKeywordResolver resolver)
      Overrides:
      addSearchKeywordResolver in class Application