public abstract class ApplicationWrapper extends Application implements FacesWrapper<Application>
| Constructor and Description |
|---|
ApplicationWrapper()
Deprecated.
|
ApplicationWrapper(Application delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBehavior(String behaviorId,
String behaviorClass) |
void |
addComponent(String componentType,
String componentClass)
Register a new mapping of component type to the name of the corresponding
UIComponent class. |
void |
addConverter(Class<?> targetClass,
String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class.
|
void |
addConverter(String converterId,
String converterClass)
Register a new mapping of converter id to the name of the corresponding
Converter class. |
void |
addDefaultValidatorId(String validatorId) |
void |
addELContextListener(javax.el.ELContextListener listener)
Provide a way for Faces applications to register an
ELContextListener that will be notified on
creation of ELContext instances. |
void |
addELResolver(javax.el.ELResolver resolver)
Cause an the argument
resolver to be added to the resolver chain as specified in section 5.5.1 of
the JavaServer Faces Specification. |
void |
addSearchKeywordResolver(SearchKeywordResolver resolver) |
void |
addValidator(String validatorId,
String validatorClass)
Register a new mapping of validator id to the name of the corresponding
Validator class. |
Behavior |
createBehavior(String behaviorId) |
UIComponent |
createComponent(FacesContext context,
Resource componentResource)
???
|
UIComponent |
createComponent(FacesContext context,
String componentType,
String rendererType) |
UIComponent |
createComponent(String componentType)
Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of
this class.
|
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext contexte,
String componentType)
Call the
getValue() method on the specified ValueExpression. |
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext context,
String componentType,
String rendererType) |
Converter |
createConverter(Class<?> targetClass)
Instantiate and return a new
instance of the class that has registered itself as
capable of performing conversions for objects of the specified type. |
Converter |
createConverter(String converterId)
Instantiate and return a new
instance of the class specified by a previous call to
addConverter() for the specified converter id. |
Validator |
createValidator(String validatorId)
Instantiate and return a new
instance of the class specified by a previous call to
addValidator() for the specified validator id. |
<T> T |
evaluateExpressionGet(FacesContext context,
String expression,
Class<? extends T> expectedType)
Deprecated.
|
ActionListener |
getActionListener()
Return the default
ActionListener to be registered for all ActionSource components
in this appication. |
Iterator<String> |
getBehaviorIds() |
Iterator<String> |
getComponentTypes()
Return an
Iterator over the set of currently defined component types for this
Application. |
Iterator<String> |
getConverterIds()
Return an
Iterator over the set of currently registered converter ids for this
Application |
Iterator<Class<?>> |
getConverterTypes()
Return an
Iterator over the set of Class instances for which classeshave been explicitly registered. |
Locale |
getDefaultLocale()
Return the default
Locale for this application. |
String |
getDefaultRenderKitId()
Return the
renderKitId to be used for rendering this application. |
Map<String,String> |
getDefaultValidatorInfo() |
javax.el.ELContextListener[] |
getELContextListeners()
If no calls have been made to
addELContextListener(javax.el.ELContextListener), this method must
return an empty array |
javax.el.ELResolver |
getELResolver()
Return the singleton
ELResolver instance to be used for all EL resolution. |
javax.el.ExpressionFactory |
getExpressionFactory()
Return the
ExpressionFactory instance for this application. |
FlowHandler |
getFlowHandler() |
String |
getMessageBundle()
Return the fully qualified class name of the
ResourceBundle to be used for JavaServer Faces messages
for this application. |
NavigationHandler |
getNavigationHandler()
Return the
instance that will be passed the outcome returned by any
invoked application action for this web application. |
ProjectStage |
getProjectStage()
Return the project stage for the currently running application instance.
|
ResourceBundle |
getResourceBundle(FacesContext ctx,
String name)
Find a
ResourceBundle as defined in the application configuration resources under the specified
name. |
ResourceHandler |
getResourceHandler()
Return the singleton, stateless, thread-safe
for this application. |
SearchExpressionHandler |
getSearchExpressionHandler() |
SearchKeywordResolver |
getSearchKeywordResolver() |
StateManager |
getStateManager()
Return the
StateManager instance that will be utilized during the Restore View and Render Response
phases of the request processing lifecycle. |
Iterator<Locale> |
getSupportedLocales()
Return an
Iterator over the supported Locales for this appication. |
Iterator<String> |
getValidatorIds()
Return an
Iterator over the set of currently registered validator ids for this
Application. |
ViewHandler |
getViewHandler()
Set the
instance that will be utilized during the
Restore View and Render Response phases of the request processing lifecycle. |
Application |
getWrapped()
A class that implements this interface uses this method to return an instance of the class being wrapped.
|
void |
publishEvent(FacesContext facesContext,
Class<? extends SystemEvent> systemEventClass,
Class<?> sourceBaseType,
Object source) |
void |
publishEvent(FacesContext facesContext,
Class<? extends SystemEvent> systemEventClass,
Object source)
If there are one or more listeners for events of the type represented by
systemEventClass, call
those listeners,passing source as the source of the event. |
void |
removeELContextListener(javax.el.ELContextListener listener)
Remove the argument
listener from the list of ELContextListeners. |
void |
setActionListener(ActionListener listener)
Set the default
to be registered for all
components. |
void |
setDefaultLocale(Locale locale)
Set the default
Locale for this application. |
void |
setDefaultRenderKitId(String renderKitId)
Return the
renderKitId to be used for rendering this application. |
void |
setFlowHandler(FlowHandler flowHandler) |
void |
setMessageBundle(String bundle)
Set the fully qualified class name of the
ResourceBundle to be used for JavaServer Faces messages
for this application. |
void |
setNavigationHandler(NavigationHandler handler)
Set the
NavigationHandler instance that will be passed the outcome returned by any invoked application
action for this web application. |
void |
setResourceHandler(ResourceHandler resourceHandler) |
void |
setSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler) |
void |
setStateManager(StateManager manager)
Set the
StateManager instance that will be utilized during the Restore View and Render Response
phases of the request processing lifecycle. |
void |
setSupportedLocales(Collection<Locale> locales)
Set the
Locale instances representing the supported Locales for this application. |
void |
setViewHandler(ViewHandler handler)
Set the
ViewHandler instance that will be utilized during the Restore View and Render Response
phases of the request processing lifecycle. |
void |
subscribeToEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener) |
void |
subscribeToEvent(Class<? extends SystemEvent> systemEventClass,
SystemEventListener listener) |
void |
unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener) |
void |
unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
SystemEventListener listener) |
@Deprecated public ApplicationWrapper()
public ApplicationWrapper(Application delegate)
public void addBehavior(String behaviorId, String behaviorClass)
addBehavior in class Applicationpublic void addComponent(String componentType, String componentClass)
ApplicationUIComponent class. This allows
subsequent calls to createComponent() to serve as a factory for UIComponent instances.addComponent in class ApplicationcomponentType - - The component type to be registeredcomponentClass - - The fully qualified class name of the corresponding UIComponent implementationpublic void addConverter(Class<?> targetClass, String converterClass)
ApplicationaddConverter in class ApplicationtargetClass - - The class for which this converter is registeredconverterClass - - The fully qualified class name of the corresponding Converter implementationpublic void addConverter(String converterId, String converterClass)
ApplicationConverter class. This allows
subsequent calls to createConverter() to serve as a factory for Converter instances.addConverter in class ApplicationconverterId - - The converterId to be registeredconverterClass - - The fully qualified class name of the corresponding Converter implementationpublic void addDefaultValidatorId(String validatorId)
addDefaultValidatorId in class Applicationpublic void addELContextListener(javax.el.ELContextListener listener)
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.
addELContextListener in class Applicationpublic void addELResolver(javax.el.ELResolver resolver)
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. This restriction
is in place to allow the JSP container to optimize for the common case where no additional
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.
addELResolver in class Applicationpublic void addValidator(String validatorId, String validatorClass)
ApplicationValidator class. This allows
subsequent calls to createValidator() to serve as a factory for Validator instances.addValidator in class ApplicationvalidatorId - The validator id to be registeredvalidatorClass - The fully qualified class name of the corresponding Validator implementationpublic Behavior createBehavior(String behaviorId) throws FacesException
createBehavior in class ApplicationFacesExceptionpublic UIComponent createComponent(FacesContext context, Resource componentResource)
ApplicationcreateComponent in class Applicationpublic UIComponent createComponent(FacesContext context, String componentType, String rendererType)
createComponent in class Applicationpublic UIComponent createComponent(String componentType) throws FacesException
ApplicationCreate a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.
createComponent in class ApplicationFacesException - 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.public UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
createComponent in class Applicationpublic UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext contexte, String componentType) throws FacesException
Application
Call the getValue() method on the specified ValueExpression. If it returns a
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
UIComponentsetValue() method of the specified ValueExpression, and return it.
createComponent in class ApplicationcomponentExpression - - ValueExpression representing a component value expression (typically specified by the
component attribute of a custom tag)contexte - - FacesContext for the current requestcomponentType - - Component type to create if the ValueExpression does not return a component instanceFacesException - if a UIComponent cannot be createdpublic Converter createConverter(Class<?> targetClass)
Application
Instantiate and return a new instance of the class that has registered itself as
capable of performing conversions for objects of the specified type. If no such Converter
class can be identified, return null.
Converter
To locate an appropriate 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.
Converter
If the has a single argument constructor that accepts a Class, instantiate the
Converter using that constructor, passing the argument ConvertertargetClass as
the sole argument. Otherwise, simply use the zero-argument constructor.
createConverter in class ApplicationtargetClass - - Target class for which to return a Converterpublic Converter createConverter(String converterId)
ApplicationConverter 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.createConverter in class ApplicationconverterId - - The converter id for which to create and return a new Converter instancepublic Validator createValidator(String validatorId) throws FacesException
ApplicationValidator instance of the class specified by a previous call to
addValidator() for the specified validator id.createValidator in class ApplicationvalidatorId - The Validator id for which to create and return a new
Validator instanceFacesException - if a Validator of the specified id cannot be created@Deprecated public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws javax.el.ELException
ApplicationGet a value by evaluating an expression.
Call then call
Application.getExpressionFactory()ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
passing the argument expression and expectedType. Call
and pass it to
FacesContext.getELContext()ValueExpression.getValue(javax.el.ELContext), returning the result.
An implementation is provided that throws UnsupportedOperationException so that users that decorate
the Application continue to work.
evaluateExpressionGet in class Applicationjavax.el.ELExceptionpublic ActionListener getActionListener()
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:
processAction() method must first call FacesContext.renderResponse()in order to
bypass any intervening lifecycle phases, once the method returns.processAction() method must next determine the logical
outcome of this event, as follows: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.processAction() method must finally retrieve the NavigationHandler instance
for this application and call NavigationHandler.handleNavigation(javax.faces.context.FacesContext,
java.lang.String, java.lang.String) passing:FacesContext for the current requestMethodExpression instance for the action property of this component,
the result of calling Expression.getExpressionString() on it, null otherwise
Note that the specification for the default ActionListener contiues to call for the use of a
deprecated property (action) and class (MethodExpression). Unfortunately, this is
necessary because the default ActionListener must continue to work with components that do not implement
ActionSource2, and only implement ActionSource.
getActionListener in class Applicationpublic Iterator<String> getBehaviorIds()
getBehaviorIds in class Applicationpublic Iterator<String> getComponentTypes()
ApplicationIterator over the set of currently defined component types for this
Application.getComponentTypes in class Applicationpublic Iterator<String> getConverterIds()
ApplicationIterator over the set of currently registered converter ids for this
ApplicationgetConverterIds in class Applicationpublic Iterator<Class<?>> getConverterTypes()
ApplicationIterator over the set of Class instances for which Converter
classeshave been explicitly registered.getConverterTypes in class Applicationpublic Locale getDefaultLocale()
ApplicationLocale for this application. If not explicitly set, null is
returned.getDefaultLocale in class Applicationpublic String getDefaultRenderKitId()
ApplicationrenderKitId to be used for rendering this application. If not explicitly set,
null is returned.getDefaultRenderKitId in class Applicationpublic Map<String,String> getDefaultValidatorInfo()
getDefaultValidatorInfo in class Applicationpublic javax.el.ELContextListener[] getELContextListeners()
Application
If no calls have been made to addELContextListener(javax.el.ELContextListener), this method must
return an empty array
.
Otherwise, return an array representing the list of listeners added by calls to
addELContextListener(javax.el.ELContextListener).
An implementation is provided that throws UnsupportedOperationException so that users that decorate
the Application continue to work.
getELContextListeners in class Applicationpublic javax.el.ELResolver getELResolver()
ApplicationELResolver 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. implementation that wraps the head of the legacy VariableResolver chain, as per section
VariableResolver ChainWrapper in Chapter 5 in the spec document.implementation that wraps the head of the legacy PropertyResolver chain, as per section
PropertyResolver ChainWrapper in Chapter 5 in the spec document.ELResolver instances added by calls to
Application.addELResolver(javax.el.ELResolver).UnsupportedOperationException and is provided for the sole
purpose of not breaking existing applications that extend Application.getELResolver in class Applicationpublic javax.el.ExpressionFactory getExpressionFactory()
Application
Return the ExpressionFactory instance for this application. This instance is used by the convenience
method Application.evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class).
The implementation must return the ExpressionFactory from the JSP container by calling
JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory().
An implementation is provided that throws UnsupportedOperationException so that users that decorate
the Application continue to work.
getExpressionFactory in class Applicationpublic String getMessageBundle()
ApplicationResourceBundle to be used for JavaServer Faces messages
for this application. If not explicitly set, null is returned.getMessageBundle in class Applicationpublic NavigationHandler getNavigationHandler()
ApplicationNavigationHandler 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.getNavigationHandler in class Applicationpublic ProjectStage getProjectStage()
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.
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_NAMEProjectStage.valueOf(), passing the value from the initParamMap. If this succeeds
without exception, save the value and return it.ProjectStage.Production and return it.getProjectStage in class Applicationpublic ResourceBundle getResourceBundle(FacesContext ctx, String name)
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.
getResourceBundle in class ApplicationResourceBundle for the current UIViewRoot, otherwise nullpublic ResourceHandler getResourceHandler()
Application
Return the singleton, stateless, thread-safe for this application. The JSF
implementation must support the following techniques for declaring an alternate implementation of ResourceHandler
ResourceHandler.
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.In all of the above cases, the runtime must employ the decorator pattern as for every other pluggable artifact in JSF.
getResourceHandler in class Applicationpublic StateManager getStateManager()
ApplicationStateManager 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.getStateManager in class Applicationpublic Iterator<Locale> getSupportedLocales()
ApplicationIterator over the supported Locales for this appication.getSupportedLocales in class Applicationpublic Iterator<String> getValidatorIds()
ApplicationIterator over the set of currently registered validator ids for this
Application.getValidatorIds in class Applicationpublic ViewHandler getViewHandler()
ApplicationViewHandler instance that will be utilized during the
Restore View and Render Response phases of the request processing lifecycle.getViewHandler in class Applicationpublic Application getWrapped()
FacesWrappergetWrapped in interface FacesWrapper<Application>public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
publishEvent in class Applicationpublic void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source)
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,
javax.faces.event.SystemEventListener)
The default implementation must implement an algorithm semantically equivalent to the following to locate listener instances and to invoke them.
source argument implements
SystemEventListenerHolder, call
SystemEventListenerHolder.getListenersForEventClass(java.lang.Class)
on it, passing the
systemEventClass argument. If the list is not empty, perform algorithm
traverseListenerList on the list.Application level listeners have been installed by previous calls to Application.subscribeToEvent(java.lang.Class, java.lang.Class, SystemEventListener), perform algorithm
traverseListenerList on the list.Application level listeners have been installed by previous calls to
Application.subscribeToEvent(java.lang.Class, SystemEventListener), perform algorithm
traverseListenerList on the list.
If the act of invoking the processListener method causes an
to be thrown,
processing of the listeners must be aborted.
AbortProcessingException
Algorithm traverseListenerList: For each listener in the list,
SystemEventListener.isListenerForSource(java.lang.Object), passing the source
argument. If this returns false, take no action on the listener.source as the argument to the one-argument constructor that takes an
Object. This same event instance must be passed to all listener instances.SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing the listener
instance as the argument. If this returns false, take no action on the listener.SystemEvent.processListener(javax.faces.event.FacesListener), passing the listener
instance.publishEvent in class ApplicationsystemEventClass - - 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.public void removeELContextListener(javax.el.ELContextListener listener)
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.
removeELContextListener in class Applicationpublic void setActionListener(ActionListener listener)
ApplicationActionListener to be registered for all
ActionSource
components.setActionListener in class Applicationlistener - - The new default ActionListenerpublic void setDefaultLocale(Locale locale)
ApplicationLocale for this application.setDefaultLocale in class Applicationlocale - - The new default Localepublic void setDefaultRenderKitId(String renderKitId)
ApplicationrenderKitId to be used for rendering this application. If not explicitly set, null
is returned.setDefaultRenderKitId in class Applicationpublic void setMessageBundle(String bundle)
ApplicationResourceBundle 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.setMessageBundle in class Applicationbundle - - Base name of the resource bundle to be usedpublic void setNavigationHandler(NavigationHandler handler)
ApplicationNavigationHandler instance that will be passed the outcome returned by any invoked application
action for this web application.setNavigationHandler in class Applicationhandler - - The new NavigationHandler instancepublic void setResourceHandler(ResourceHandler resourceHandler)
setResourceHandler in class Applicationpublic void setStateManager(StateManager manager)
ApplicationStateManager instance that will be utilized during the Restore View and Render Response
phases of the request processing lifecycle.setStateManager in class Applicationmanager - The new StateManagerinstancepublic void setSupportedLocales(Collection<Locale> locales)
ApplicationLocale instances representing the supported Locales for this application.setSupportedLocales in class Applicationlocales - The set of supported Locales for this applicationpublic void setViewHandler(ViewHandler handler)
ApplicationViewHandler instance that will be utilized during the Restore View and Render Response
phases of the request processing lifecycle.setViewHandler in class Applicationhandler - - The new ViewHandler instancepublic void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
subscribeToEvent in class Applicationpublic void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
subscribeToEvent in class Applicationpublic void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
unsubscribeFromEvent in class Applicationpublic void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
unsubscribeFromEvent in class Applicationpublic void setFlowHandler(FlowHandler flowHandler)
setFlowHandler in class Applicationpublic FlowHandler getFlowHandler()
getFlowHandler in class Applicationpublic void setSearchExpressionHandler(SearchExpressionHandler searchExpressionHandler)
setSearchExpressionHandler in class Applicationpublic SearchExpressionHandler getSearchExpressionHandler()
getSearchExpressionHandler in class Applicationpublic SearchKeywordResolver getSearchKeywordResolver()
getSearchKeywordResolver in class Applicationpublic void addSearchKeywordResolver(SearchKeywordResolver resolver)
addSearchKeywordResolver in class ApplicationCopyright © 2022 The Apache Software Foundation. All rights reserved.