|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.application.Application
Application represents a per-web-application singleton object where applications based on JavaServer Faces (or implementations wishing to provide extended functionality) can register application-wide singletons that provide functionality required by JavaServer Faces. Default implementations of each object are provided for cases where the application does not choose to customize the behavior.
The instance of Application is created by calling the
getApplication() method of ApplicationFactory.
Because this instance is shared, it must be implemented in a
thread-safe manner.
The application also acts as a factory for several types of
Objects specified in the Faces Configuration file. Please see getComponent(java.lang.String), getConverter(java.lang.String),
getMessageResources(java.lang.String), and getValidator(java.lang.String).
| Constructor Summary | |
Application()
|
|
| Method Summary | |
abstract void |
addComponent(java.lang.String componentType,
java.lang.String componentClass)
Register a new mapping of component type to the name of the corresponding UIComponent class. |
abstract void |
addConverter(java.lang.String converterId,
java.lang.String converterClass)
Register a new mapping of converter id to the name of the corresponding Converter class. |
abstract void |
addMessageResources(java.lang.String messageResourcesId,
java.lang.String messageResourcesClass)
Register a new mapping of message resources id to the name of the corresponding MessageResources class. |
abstract void |
addValidator(java.lang.String validatorId,
java.lang.String validatorClass)
Register a new mapping of validator id to the name of the corresponding Validator class. |
abstract ActionListener |
getActionListener()
Return the ActionListener that will be the default
ActionListener to be registered with relevant components
during the Reconstitute Component Tree phase of the
request processing lifecycle. |
abstract UIComponent |
getComponent(java.lang.String componentType)
Instantiate and return a new UIComponent instance of the
class specified by a previous call to addComponent() for
the specified component type. |
abstract java.util.Iterator |
getComponentTypes()
Return an Iterator over the set of currently defined
component types for this Application. |
abstract Converter |
getConverter(java.lang.String converterId)
Instantiate and return a new Converter instance of the
class specified by a previous call to addConverter()
for the specified converter id. |
abstract java.util.Iterator |
getConverterIds()
Return an Iterator over the set of currently registered
converter ids for this Application. |
abstract MessageResources |
getMessageResources(java.lang.String messageResourcesId)
Instantiate (if necessary) and return a MessageResources
instance of the class specified by a previous call to
addMessageResources. |
abstract java.util.Iterator |
getMessageResourcesIds()
Return an Iterator over the set of currently registered
message resources ids for this Application. |
abstract NavigationHandler |
getNavigationHandler()
Return the NavigationHandler instance that will be passed
the outcome returned by any invoked Action for this
web application. |
abstract PropertyResolver |
getPropertyResolver()
Return the PropertyResolver instance that will be utilized
to resolve action and valus references. |
abstract Validator |
getValidator(java.lang.String validatorId)
Instantiate and return a new Validator instance of the
class specified by a previous call to addValidator()
for the specified validator id. |
abstract java.util.Iterator |
getValidatorIds()
Return an Iterator over the set of currently registered
validator ids for this Application. |
abstract ValueBinding |
getValueBinding(java.lang.String ref)
Return a ValueBinding for the specified action or value
reference expression, which may be used to manipulate the corresponding
property value later. |
abstract VariableResolver |
getVariableResolver()
Return the VariableResolver instance that will be utilized
to resolve action and value references. |
abstract void |
setActionListener(ActionListener listener)
Replace the default ActionListener that will be registered
with relevant components during the Reconstitute Component Tree
phase of the requset processing lifecycle. |
abstract void |
setNavigationHandler(NavigationHandler handler)
Set the NavigationHandler instance that will be passed
the outcome returned by any invoked Action for this
web application. |
abstract void |
setPropertyResolver(PropertyResolver resolver)
Set the PropertyResolver instance that will be utilized
to resolve action and value references. |
abstract void |
setVariableResolver(VariableResolver resolver)
Set the VariableResolver instance that will be utilized
to resolve action and value references. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Application()
| Method Detail |
public abstract ActionListener getActionListener()
Return the ActionListener that will be the default
ActionListener to be registered with relevant components
during the Reconstitute Component Tree phase of the
request processing lifecycle. The default implementation will
perform the following functions:
getPhaseId() method of this listener instance
must return PhaseId.INVOKE_APPLICATION.action
property, return that value.actionRef
property, evaluate this value reference to retrieve the
corresponding object.Action, throw an
IllegalArgumentException.invoke() method of the returned object,
and return the return value from that method call.
public abstract void setActionListener(ActionListener listener)
Replace the default ActionListener that will be registered
with relevant components during the Reconstitute Component Tree
phase of the requset processing lifecycle. This
listener must return PhaseId.INVOKE_APPLICATION from its
getPhaseId() method.
listener - The new ActionListener
java.lang.IllegalArgumentException - if the specified
listener does not return
PhaseId.INVOKE_APPLICATION from its
getPhaseId() method
java.lang.NullPointerException - if listener
is nullpublic abstract NavigationHandler getNavigationHandler()
Return the NavigationHandler instance that will be passed
the outcome returned by any invoked Action for this
web application. The default implementation must provide the behavior
described in the NavigationHandler class description.
public abstract void setNavigationHandler(NavigationHandler handler)
Set the NavigationHandler instance that will be passed
the outcome returned by any invoked Action for this
web application.
handler - The new NavigationHandler instance
java.lang.NullPointerException - if handler
is nullpublic abstract PropertyResolver getPropertyResolver()
Return the PropertyResolver instance that will be utilized
to resolve action and valus references. The default implementation
must provide the behavior described in the
PropertyResolver class description.
public abstract void setPropertyResolver(PropertyResolver resolver)
Set the PropertyResolver instance that will be utilized
to resolve action and value references.
resolver - The new PropertyResolver instance
java.lang.NullPointerException - if resolver
is null
public abstract ValueBinding getValueBinding(java.lang.String ref)
throws ReferenceSyntaxException
Return a ValueBinding for the specified action or value
reference expression, which may be used to manipulate the corresponding
property value later. The returned ValueBinding instance must
utilize the PropertyResolver and VariableResolver
instances registered with this Application instance at the
time that the ValueBinding instance was initially created.
For maximum performance, implementations of Application
may, but are not required to, cache ValueBinding instances
in order to avoid repeated parsing of the reference expression.
However, under no circumstances may a particular ValueBinding
instance be shared across multiple web applications.
ref - Reference expression for which to return a
ValueBinding instance
java.lang.NullPointerException - if ref
is null
ReferenceSyntaxException - if the specified ref
has invalid syntaxpublic abstract VariableResolver getVariableResolver()
Return the VariableResolver instance that will be utilized
to resolve action and value references. The default implementation
must provide the behavior described in the
VariableResolver class description.
public abstract void setVariableResolver(VariableResolver resolver)
Set the VariableResolver instance that will be utilized
to resolve action and value references.
resolver - The new VariableResolver instance
java.lang.NullPointerException - if resolver
is null
public abstract void addComponent(java.lang.String componentType,
java.lang.String componentClass)
Register a new mapping of component type to the name of the
corresponding UIComponent class. This allows subsequent calls
to getComponent() to serve as a factory for
UIComponent instances.
componentType - The component type to be registeredcomponentClass - The fully qualified class name of the
corresponding UIComponent implementation
java.lang.NullPointerException - if componentType or
componentClass is null
public abstract UIComponent getComponent(java.lang.String componentType)
throws FacesException
Instantiate and return a new UIComponent instance of the
class specified by a previous call to addComponent() for
the specified component type.
componentType - The component type for which to create and
return a new UIComponent instance
FacesException - if a UIComponent of the
specified type cannot be created
java.lang.NullPointerException - if componentType
is nullpublic abstract java.util.Iterator getComponentTypes()
Return an Iterator over the set of currently defined
component types for this Application.
public abstract void addConverter(java.lang.String converterId,
java.lang.String converterClass)
Register a new mapping of converter id to the name of the
corresponding Converter class. This allows subsequent calls
to getConverter() to serve as a factory for
Converter instances.
converterId - The converter id to be registeredconverterClass - The fully qualified class name of the
corresponding Converter implementation
java.lang.NullPointerException - if converterId
or converterClass is null
public abstract Converter getConverter(java.lang.String converterId)
throws FacesException
Instantiate and return a new Converter instance of the
class specified by a previous call to addConverter()
for the specified converter id.
converterId - The converter id for which to create and
return a new Converter instance
FacesException - if a Converter of the
specified id cannot be created
java.lang.NullPointerException - if converterId
is nullpublic abstract java.util.Iterator getConverterIds()
Return an Iterator over the set of currently registered
converter ids for this Application.
public abstract void addMessageResources(java.lang.String messageResourcesId,
java.lang.String messageResourcesClass)
Register a new mapping of message resources id to the name of the
corresponding MessageResources class. This allows subsequent
calls to getMessageResources() to serve as a factory for
MessageResources instances.
messageResourcesId - The message resources id to be registeredmessageResourcesClass - The fully qualified class name of the
corresponding MessageResources implementation
java.lang.NullPointerException - if messageResourcesId
or messageResourcesClass is null
public abstract MessageResources getMessageResources(java.lang.String messageResourcesId)
throws FacesException
Instantiate (if necessary) and return a MessageResources
instance of the class specified by a previous call to
addMessageResources.
messageResourcesId - The message resources id for which to
create (if necessary) and return a MessageResources
instance
FacesException - if a MessageResources instance
of the specified id cannot be created
java.lang.NullPointerException - if messageResourcesId
is nullpublic abstract java.util.Iterator getMessageResourcesIds()
Return an Iterator over the set of currently registered
message resources ids for this Application.
public abstract void addValidator(java.lang.String validatorId,
java.lang.String validatorClass)
Register a new mapping of validator id to the name of the
corresponding Validator class. This allows subsequent calls
to getValidator() to serve as a factory for
Validator instances.
validatorId - The validator id to be registeredvalidatorClass - The fully qualified class name of the
corresponding Validator implementation
java.lang.NullPointerException - if validatorId
or validatorClass is null
public abstract Validator getValidator(java.lang.String validatorId)
throws FacesException
Instantiate and return a new Validator instance of the
class specified by a previous call to addValidator()
for the specified validator id.
validatorId - The validator id for which to create and
return a new Validator instance
FacesException - if a Validator of the
specified id cannot be created
java.lang.NullPointerException - if validatorId
is nullpublic abstract java.util.Iterator getValidatorIds()
Return an Iterator over the set of currently registered
validator ids for this Application.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||