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: 676278 $ $Date: 2008-07-13 03:35:04 -0500 (Sun, 13 Jul 2008) $
Author:
Manfred Geiler (latest modification by $Author: skitching $)

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)
           
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)
          Create an object which has an associating "binding" expression tying the component to a user property.
abstract  Converter createConverter(Class targetClass)
           
abstract  Converter createConverter(String converterId)
           
abstract  MethodBinding createMethodBinding(String ref, Class[] params)
          Create an object which can be used to invoke an arbitrary method via an EL expression at a later time.
abstract  Validator createValidator(String validatorId)
           
abstract  ValueBinding createValueBinding(String ref)
          Create an object which can be used to invoke an arbitrary method via an EL expression at a later time.
abstract  ActionListener getActionListener()
           
abstract  Iterator getComponentTypes()
           
abstract  Iterator getConverterIds()
           
abstract  Iterator getConverterTypes()
           
abstract  Locale getDefaultLocale()
           
abstract  String getDefaultRenderKitId()
           
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()
          Get the object used by the VariableResolver to read and write named properties on java beans, Arrays, Lists and Maps.
abstract  StateManager getStateManager()
           
abstract  Iterator getSupportedLocales()
           
abstract  Iterator getValidatorIds()
           
abstract  VariableResolver getVariableResolver()
          Get the object used to resolve expressions of form "#{...}".
abstract  ViewHandler getViewHandler()
           
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)
           
abstract  void setStateManager(StateManager manager)
           
abstract  void setSupportedLocales(Collection locales)
           
abstract  void setVariableResolver(VariableResolver resolver)
           
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

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()
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)

getVariableResolver

public abstract VariableResolver getVariableResolver()
Get the object used to resolve expressions of form "#{...}".


setVariableResolver

public abstract void setVariableResolver(VariableResolver resolver)

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
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 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 getConverterIds()

getConverterTypes

public abstract Iterator getConverterTypes()

createMethodBinding

public abstract MethodBinding createMethodBinding(String ref,
                                                  Class[] params)
                                           throws ReferenceSyntaxException
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 getSupportedLocales()

setSupportedLocales

public abstract void setSupportedLocales(Collection 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 getValidatorIds()

createValueBinding

public abstract ValueBinding createValueBinding(String ref)
                                         throws ReferenceSyntaxException
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.