org.apache.myfaces.application
Class ApplicationImpl

java.lang.Object
  extended by javax.faces.application.Application
      extended by org.apache.myfaces.application.ApplicationImpl

public class ApplicationImpl
extends Application

DOCUMENT ME!

Version:
$Revision: 1505865 $ $Date: 2013-07-22 19:19:31 -0500 (Mon, 22 Jul 2013) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $), Anton Koinov, Thomas Spiegl, Stan Silvert

Field Summary
static String DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
          Set the default timezone as system timezone when a converter extending from DateTimeConverter is created.
static String MYFACES_PROJECT_STAGE_SYSTEM_PROPERTY_NAME
          Deprecated. 
static String PROJECT_STAGE_SYSTEM_PROPERTY_NAME
           
 
Constructor Summary
ApplicationImpl()
           
 
Method Summary
 void addBehavior(String behaviorId, String behaviorClass)
           
 void addComponent(String componentType, String componentClassName)
           
 void addConverter(Class<?> targetClass, String converterClass)
           
 void addConverter(String converterId, String converterClass)
           
 void addDefaultValidatorId(String validatorId)
           
 void addELContextListener(javax.el.ELContextListener listener)
           
 void addELResolver(javax.el.ELResolver resolver)
           
 void addValidator(String validatorId, String validatorClass)
           
 Behavior createBehavior(String behaviorId)
           
 UIComponent createComponent(FacesContext context, Resource componentResource)
           
 UIComponent createComponent(FacesContext context, String componentType, String rendererType)
           
 UIComponent createComponent(String componentType)
           
 UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String componentType)
          Deprecated. Use createComponent(ValueExpression, FacesContext, String) instead.
 UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext facesContext, String componentType)
           
 UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
           
 Converter createConverter(Class<?> targetClass)
           
 Converter createConverter(String converterId)
          Return an instance of the converter class that has been registered under the specified id.
 MethodBinding createMethodBinding(String reference, Class<?>[] params)
          Deprecated.  
 Validator createValidator(String validatorId)
           
 ValueBinding createValueBinding(String reference)
          Deprecated.  
<T> T
evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType)
           
 ActionListener getActionListener()
           
 Iterator<String> getBehaviorIds()
           
 Iterator<String> getComponentTypes()
           
 Iterator<String> getConverterIds()
           
 Iterator<Class<?>> getConverterTypes()
           
 Locale getDefaultLocale()
           
 String getDefaultRenderKitId()
           
 Map<String,String> getDefaultValidatorInfo()
           
 javax.el.ELContextListener[] getELContextListeners()
           
 javax.el.ELResolver getELResolver()
           
 javax.el.ExpressionFactory getExpressionFactory()
           
 String getMessageBundle()
           
 NavigationHandler getNavigationHandler()
           
 ProjectStage getProjectStage()
           
 PropertyResolver getPropertyResolver()
          Deprecated.  
protected  ELResolverBuilder getResolverBuilderForFaces()
           
 ResourceBundle getResourceBundle(FacesContext facesContext, String name)
           
 ResourceHandler getResourceHandler()
           
 StateManager getStateManager()
           
 Iterator<Locale> getSupportedLocales()
           
 Iterator<String> getValidatorIds()
           
 VariableResolver getVariableResolver()
          Deprecated.  
 ViewHandler getViewHandler()
           
 void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
           
 void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Object source)
           
 void removeELContextListener(javax.el.ELContextListener listener)
           
 void setActionListener(ActionListener actionListener)
           
 void setDefaultLocale(Locale locale)
           
 void setDefaultRenderKitId(String defaultRenderKitId)
           
 void setMessageBundle(String messageBundle)
           
 void setNavigationHandler(NavigationHandler navigationHandler)
           
 void setPropertyResolver(PropertyResolver propertyResolver)
          Deprecated.  
 void setResolverBuilderForFaces(ELResolverBuilder factory)
           
 void setResourceHandler(ResourceHandler resourceHandler)
           
 void setStateManager(StateManager stateManager)
           
 void setSupportedLocales(Collection<Locale> locales)
           
 void setVariableResolver(VariableResolver variableResolver)
          Deprecated.  
 void setViewHandler(ViewHandler viewHandler)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECT_STAGE_SYSTEM_PROPERTY_NAME

public static final String PROJECT_STAGE_SYSTEM_PROPERTY_NAME
See Also:
Constant Field Values

MYFACES_PROJECT_STAGE_SYSTEM_PROPERTY_NAME

@Deprecated
public static final String MYFACES_PROJECT_STAGE_SYSTEM_PROPERTY_NAME
Deprecated. 
See Also:
Constant Field Values

DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME

@JSFWebConfigParam(defaultValue="false",
                   expectedValues="true, false",
                   since="2.0",
                   group="validation")
public static final String DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
Set the default timezone as system timezone when a converter extending from DateTimeConverter is created.

See Also:
Constant Field Values
Constructor Detail

ApplicationImpl

public ApplicationImpl()
Method Detail

addELResolver

public final void addELResolver(javax.el.ELResolver resolver)
Overrides:
addELResolver in class Application

addDefaultValidatorId

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

getDefaultValidatorInfo

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

getELResolver

public final javax.el.ELResolver getELResolver()
Overrides:
getELResolver in class Application

getResolverBuilderForFaces

protected final ELResolverBuilder getResolverBuilderForFaces()

setResolverBuilderForFaces

public final void setResolverBuilderForFaces(ELResolverBuilder factory)

getResourceBundle

public final ResourceBundle getResourceBundle(FacesContext facesContext,
                                              String name)
                                       throws FacesException,
                                              NullPointerException
Overrides:
getResourceBundle in class Application
Throws:
FacesException
NullPointerException

createComponent

public final UIComponent createComponent(javax.el.ValueExpression componentExpression,
                                         FacesContext facesContext,
                                         String componentType)
                                  throws FacesException,
                                         NullPointerException
Overrides:
createComponent in class Application
Throws:
FacesException
NullPointerException

createComponent

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

getExpressionFactory

public final javax.el.ExpressionFactory getExpressionFactory()
Overrides:
getExpressionFactory in class Application

evaluateExpressionGet

public final <T> T evaluateExpressionGet(FacesContext context,
                                         String expression,
                                         Class<? extends T> expectedType)
                              throws javax.el.ELException
Overrides:
evaluateExpressionGet in class Application
Throws:
javax.el.ELException

addELContextListener

public final void addELContextListener(javax.el.ELContextListener listener)
Overrides:
addELContextListener in class Application

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)
Overrides:
publishEvent in class Application

removeELContextListener

public final void removeELContextListener(javax.el.ELContextListener listener)
Overrides:
removeELContextListener in class Application

getELContextListeners

public final javax.el.ELContextListener[] getELContextListeners()
Overrides:
getELContextListeners in class Application

setActionListener

public final void setActionListener(ActionListener actionListener)
Specified by:
setActionListener in class Application

getActionListener

public final ActionListener getActionListener()
Specified by:
getActionListener in class Application

getBehaviorIds

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

getComponentTypes

public final Iterator<String> getComponentTypes()
Specified by:
getComponentTypes in class Application

getConverterIds

public final Iterator<String> getConverterIds()
Specified by:
getConverterIds in class Application

getConverterTypes

public final Iterator<Class<?>> getConverterTypes()
Specified by:
getConverterTypes in class Application

setDefaultLocale

public final void setDefaultLocale(Locale locale)
Specified by:
setDefaultLocale in class Application

getDefaultLocale

public final Locale getDefaultLocale()
Specified by:
getDefaultLocale in class Application

setMessageBundle

public final void setMessageBundle(String messageBundle)
Specified by:
setMessageBundle in class Application

getMessageBundle

public final String getMessageBundle()
Specified by:
getMessageBundle in class Application

setNavigationHandler

public final void setNavigationHandler(NavigationHandler navigationHandler)
Specified by:
setNavigationHandler in class Application

getNavigationHandler

public final NavigationHandler getNavigationHandler()
Specified by:
getNavigationHandler in class Application

setPropertyResolver

@Deprecated
public final void setPropertyResolver(PropertyResolver propertyResolver)
Deprecated. 

Specified by:
setPropertyResolver in class Application

getProjectStage

public ProjectStage getProjectStage()
Overrides:
getProjectStage in class Application

getPropertyResolver

@Deprecated
public final PropertyResolver getPropertyResolver()
Deprecated. 

Specified by:
getPropertyResolver in class Application

setResourceHandler

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

getResourceHandler

public final ResourceHandler getResourceHandler()
Overrides:
getResourceHandler in class Application

setSupportedLocales

public final void setSupportedLocales(Collection<Locale> locales)
Specified by:
setSupportedLocales in class Application

getSupportedLocales

public final Iterator<Locale> getSupportedLocales()
Specified by:
getSupportedLocales in class Application

getValidatorIds

public final Iterator<String> getValidatorIds()
Specified by:
getValidatorIds in class Application

setVariableResolver

@Deprecated
public final void setVariableResolver(VariableResolver variableResolver)
Deprecated. 

Specified by:
setVariableResolver in class Application

getVariableResolver

@Deprecated
public final VariableResolver getVariableResolver()
Deprecated. 

Specified by:
getVariableResolver in class Application

setViewHandler

public final void setViewHandler(ViewHandler viewHandler)
Specified by:
setViewHandler in class Application

subscribeToEvent

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

subscribeToEvent

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

unsubscribeFromEvent

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

unsubscribeFromEvent

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

getViewHandler

public final ViewHandler getViewHandler()
Specified by:
getViewHandler in class Application

addBehavior

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

addComponent

public final void addComponent(String componentType,
                               String componentClassName)
Specified by:
addComponent in class Application

addConverter

public final void addConverter(String converterId,
                               String converterClass)
Specified by:
addConverter in class Application

addConverter

public final void addConverter(Class<?> targetClass,
                               String converterClass)
Specified by:
addConverter in class Application

addValidator

public final void addValidator(String validatorId,
                               String validatorClass)
Specified by:
addValidator in class Application

createBehavior

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

createComponent

public UIComponent createComponent(FacesContext context,
                                   Resource componentResource)
Overrides:
createComponent in class Application

createComponent

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

createComponent

public final UIComponent createComponent(String componentType)
                                  throws FacesException
Specified by:
createComponent in class Application
Throws:
FacesException

createComponent

@Deprecated
public final UIComponent createComponent(ValueBinding valueBinding,
                                                    FacesContext facesContext,
                                                    String componentType)
                                  throws FacesException
Deprecated. Use createComponent(ValueExpression, FacesContext, String) instead.

Specified by:
createComponent in class Application
Throws:
FacesException

createConverter

public final Converter createConverter(String converterId)
Return an instance of the converter class that has been registered under the specified id.

Converters are registered via faces-config.xml files, and can also be registered via the addConverter(String id, Class converterClass) method on this class. Here the the appropriate Class definition is found, then an instance is created and returned.

A converter registered via a config file can have any number of nested attribute or property tags. The JSF specification is very vague about what effect these nested tags have. This method ignores nested attribute definitions, but for each nested property tag the corresponding setter is invoked on the new Converter instance passing the property's defaultValuer. Basic typeconversion is done so the target properties on the Converter instance can be String, int, boolean, etc. Note that:

  1. the Sun Mojarra JSF implemenation ignores nested property tags completely, so this behaviour cannot be relied on across implementations.
  2. there is no equivalent functionality for converter classes registered via the Application.addConverter api method.

Note that this method is most commonly called from the standard f:attribute tag. As an alternative, most components provide a "converter" attribute which uses an EL expression to create a Converter instance, in which case this method is not invoked at all. The converter attribute allows the returned Converter instance to be configured via normal dependency-injection, and is generally a better choice than using this method.

Specified by:
createConverter in class Application

createConverter

public final Converter createConverter(Class<?> targetClass)
Specified by:
createConverter in class Application

createMethodBinding

@Deprecated
public final MethodBinding createMethodBinding(String reference,
                                                          Class<?>[] params)
                                        throws ReferenceSyntaxException
Deprecated. 

Specified by:
createMethodBinding in class Application
Throws:
ReferenceSyntaxException

createValidator

public final Validator createValidator(String validatorId)
                                throws FacesException
Specified by:
createValidator in class Application
Throws:
FacesException

createValueBinding

public final ValueBinding createValueBinding(String reference)
                                      throws ReferenceSyntaxException
Deprecated. 

Specified by:
createValueBinding in class Application
Throws:
ReferenceSyntaxException

getDefaultRenderKitId

public final String getDefaultRenderKitId()
Specified by:
getDefaultRenderKitId in class Application

setDefaultRenderKitId

public final void setDefaultRenderKitId(String defaultRenderKitId)
Specified by:
setDefaultRenderKitId in class Application

getStateManager

public final StateManager getStateManager()
Specified by:
getStateManager in class Application

setStateManager

public final void setStateManager(StateManager stateManager)
Specified by:
setStateManager in class Application


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.