javax.faces.application
Class Application

java.lang.Object
  extended by javax.faces.application.Application

public abstract class Application
extends Object

Holds webapp-wide resources for a JSF application. There is a single one of these for a web application, accessable via

 FacesContext.getCurrentInstance().getApplication()
 
In particular, this provides a factory for UIComponent objects. It also provides convenience methods for creating ValueBinding objects. See Javadoc of JSF Specification

Version:
$Revision: 775008 $ $Date: 2009-05-15 00:23:20 -0500 (Fri, 15 May 2009) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $), Stan Silvert

Constructor Summary
Application()
           
 
Method Summary
abstract  void addComponent(String componentType, String componentClass)
          Define a new mapping from a logical "component type" to an actual java class name.
abstract  void addConverter(Class targetClass, String converterClass)
           
abstract  void addConverter(String converterId, String converterClass)
           
 void addELContextListener(javax.el.ELContextListener listener)
           
 void addELResolver(javax.el.ELResolver resolver)
           
abstract  void addValidator(String validatorId, String validatorClass)
           
abstract  UIComponent createComponent(String componentType)
          Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.
abstract  UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType)
          Deprecated.  
 UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext facesContext, String componentType)
           
abstract  Converter createConverter(Class targetClass)
           
abstract  Converter createConverter(String converterId)
           
abstract  MethodBinding createMethodBinding(String ref, Class[] params)
          Deprecated.  
abstract  Validator createValidator(String validatorId)
           
abstract  ValueBinding createValueBinding(String ref)
          Deprecated.  
 Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType)
           
abstract  ActionListener getActionListener()
           
abstract  Iterator<String> getComponentTypes()
           
abstract  Iterator<String> getConverterIds()
           
abstract  Iterator<Class> getConverterTypes()
           
abstract  Locale getDefaultLocale()
           
abstract  String getDefaultRenderKitId()
           
 javax.el.ELContextListener[] getELContextListeners()
           
 javax.el.ELResolver getELResolver()
           
 javax.el.ExpressionFactory getExpressionFactory()
           
abstract  String getMessageBundle()
           
abstract  NavigationHandler getNavigationHandler()
          Return the NavigationHandler object which is responsible for mapping from a logical (viewid, fromAction, outcome) to the URL of a view to be rendered.
abstract  PropertyResolver getPropertyResolver()
          Deprecated.  
 ResourceBundle getResourceBundle(FacesContext ctx, String name)
           
abstract  StateManager getStateManager()
           
abstract  Iterator<Locale> getSupportedLocales()
           
abstract  Iterator<String> getValidatorIds()
           
abstract  VariableResolver getVariableResolver()
          Deprecated.  
abstract  ViewHandler getViewHandler()
           
 void removeELContextListener(javax.el.ELContextListener listener)
           
abstract  void setActionListener(ActionListener listener)
           
abstract  void setDefaultLocale(Locale locale)
           
abstract  void setDefaultRenderKitId(String renderKitId)
           
abstract  void setMessageBundle(String bundle)
           
abstract  void setNavigationHandler(NavigationHandler handler)
           
abstract  void setPropertyResolver(PropertyResolver resolver)
          Deprecated.  
abstract  void setStateManager(StateManager manager)
           
abstract  void setSupportedLocales(Collection<Locale> locales)
           
abstract  void setVariableResolver(VariableResolver resolver)
          Deprecated.  
abstract  void setViewHandler(ViewHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Method Detail

addELResolver

public void addELResolver(javax.el.ELResolver resolver)

getELResolver

public javax.el.ELResolver getELResolver()

getResourceBundle

public ResourceBundle getResourceBundle(FacesContext ctx,
                                        String name)
                                 throws FacesException,
                                        NullPointerException
Throws:
FacesException
NullPointerException

createComponent

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

getExpressionFactory

public javax.el.ExpressionFactory getExpressionFactory()

addELContextListener

public void addELContextListener(javax.el.ELContextListener listener)

removeELContextListener

public void removeELContextListener(javax.el.ELContextListener listener)

getELContextListeners

public javax.el.ELContextListener[] getELContextListeners()

evaluateExpressionGet

public Object evaluateExpressionGet(FacesContext context,
                                    String expression,
                                    Class expectedType)
                             throws javax.el.ELException
Throws:
javax.el.ELException

getActionListener

public abstract ActionListener getActionListener()

setActionListener

public abstract void setActionListener(ActionListener listener)

getDefaultLocale

public abstract Locale getDefaultLocale()

setDefaultLocale

public abstract void setDefaultLocale(Locale locale)

getDefaultRenderKitId

public abstract String getDefaultRenderKitId()

setDefaultRenderKitId

public abstract void setDefaultRenderKitId(String renderKitId)

getMessageBundle

public abstract String getMessageBundle()

setMessageBundle

public abstract void setMessageBundle(String bundle)

getNavigationHandler

public abstract NavigationHandler getNavigationHandler()
Return the NavigationHandler object which is responsible for mapping from a logical (viewid, fromAction, outcome) to the URL of a view to be rendered.


setNavigationHandler

public abstract void setNavigationHandler(NavigationHandler handler)

getPropertyResolver

public abstract PropertyResolver getPropertyResolver()
Deprecated. 

Get the object used by the VariableResolver to read and write named properties on java beans, Arrays, Lists and Maps. This object is used by the ValueBinding implementation, and during the process of configuring "managed bean" properties.


setPropertyResolver

public abstract void setPropertyResolver(PropertyResolver resolver)
Deprecated. 


getVariableResolver

public abstract VariableResolver getVariableResolver()
Deprecated. 

Get the object used to resolve expressions of form "#{...}".


setVariableResolver

public abstract void setVariableResolver(VariableResolver resolver)
Deprecated. 


getViewHandler

public abstract ViewHandler getViewHandler()

setViewHandler

public abstract void setViewHandler(ViewHandler handler)

getStateManager

public abstract StateManager getStateManager()

setStateManager

public abstract void setStateManager(StateManager manager)

addComponent

public abstract void addComponent(String componentType,
                                  String componentClass)
Define a new mapping from a logical "component type" to an actual java class name. This controls what type is created when method createComponent of this class is called.

Param componentClass must be the fully-qualified class name of some class extending the UIComponent class. The class must have a default constructor, as instances of it will be created using Class.newInstance.

It is permitted to override a previously defined mapping, ie to call this method multiple times with the same componentType string. The createComponent method will simply use the last defined mapping.


createComponent

public abstract UIComponent createComponent(String componentType)
                                     throws FacesException
Create a new UIComponent subclass, using the mappings defined by previous calls to the addComponent method of this class.

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 abstract UIComponent createComponent(ValueBinding componentBinding,
                                            FacesContext context,
                                            String componentType)
                                     throws FacesException
Deprecated. 

Create an object which has an associating "binding" expression tying the component to a user property.

First the specified value-binding is evaluated; if it returns a non-null value then the component "already exists" and so the resulting value is simply returned.

Otherwise a new UIComponent instance is created using the specified componentType, and the new object stored via the provided value-binding before being returned.

Throws:
FacesException

getComponentTypes

public abstract Iterator<String> getComponentTypes()

addConverter

public abstract void addConverter(String converterId,
                                  String converterClass)

addConverter

public abstract void addConverter(Class targetClass,
                                  String converterClass)

createConverter

public abstract Converter createConverter(String converterId)

createConverter

public abstract Converter createConverter(Class targetClass)

getConverterIds

public abstract Iterator<String> getConverterIds()

getConverterTypes

public abstract Iterator<Class> getConverterTypes()

createMethodBinding

public abstract MethodBinding createMethodBinding(String ref,
                                                  Class[] params)
                                           throws ReferenceSyntaxException
Deprecated. 

Create an object which can be used to invoke an arbitrary method via an EL expression at a later time. This is similar to createValueBinding except that it can invoke an arbitrary method (with parameters) rather than just get/set a javabean property.

This is used to invoke ActionListener method, and ValueChangeListener methods.

Throws:
ReferenceSyntaxException

getSupportedLocales

public abstract Iterator<Locale> getSupportedLocales()

setSupportedLocales

public abstract void setSupportedLocales(Collection<Locale> locales)

addValidator

public abstract void addValidator(String validatorId,
                                  String validatorClass)

createValidator

public abstract Validator createValidator(String validatorId)
                                   throws FacesException
Throws:
FacesException

getValidatorIds

public abstract Iterator<String> getValidatorIds()

createValueBinding

public abstract ValueBinding createValueBinding(String ref)
                                         throws ReferenceSyntaxException
Deprecated. 

Create an object which can be used to invoke an arbitrary method via an EL expression at a later time. This is similar to createValueBinding except that it can invoke an arbitrary method (with parameters) rather than just get/set a javabean property.

This is used to invoke ActionListener method, and ValueChangeListener methods.

Throws:
ReferenceSyntaxException


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