|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.faces.application Class Application
java.lang.Object javax.faces.application.Application
public abstract class Application
- extends Object
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 createComponent(java.lang.String)
, createConverter(java.lang.String)
,
and createValidator(java.lang.String)
.
构造器摘要 | |
---|---|
Application()
|
方法摘要 | |
---|---|
abstract void |
addComponent(String componentType,
String componentClass)
Register a new mapping of component type to the name of the corresponding UIComponent class. |
abstract void |
addConverter(Class targetClass,
String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class. |
abstract void |
addConverter(String converterId,
String converterClass)
Register a new mapping of converter id to the name of the corresponding Converter class. |
void |
addELContextListener(ELContextListener listener)
Provide a way for Faces applications to register an ELContextListener that will be notified on creation
of ELContext instances. |
void |
addELResolver(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. |
abstract void |
addValidator(String validatorId,
String validatorClass)
Register a new mapping of validator id to the name of the corresponding Validator class. |
abstract UIComponent |
createComponent(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 UIComponent |
createComponent(ValueBinding componentBinding,
FacesContext context,
String componentType)
Deprecated. This has been replaced by createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String) . |
UIComponent |
createComponent(ValueExpression componentExpression,
FacesContext context,
String componentType)
Call the getValue() method on the specified
ValueExpression . |
abstract Converter |
createConverter(Class targetClass)
Instantiate and return a new Converter instance of the
class that has registered itself as capable of performing conversions
for objects of the specified type. |
abstract Converter |
createConverter(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 MethodBinding |
createMethodBinding(String ref,
Class[] params)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]) . |
abstract Validator |
createValidator(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 ValueBinding |
createValueBinding(String ref)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class) . |
Object |
evaluateExpressionGet(FacesContext context,
String expression,
Class expectedType)
Get a value by evaluating an expression. |
abstract ActionListener |
getActionListener()
Return the default ActionListener to be registered for
all ActionSource components in this
appication. |
abstract Iterator<String> |
getComponentTypes()
Return an Iterator over the set of currently defined
component types for this Application . |
abstract Iterator<String> |
getConverterIds()
Return an Iterator over the set of currently registered
converter ids for this Application . |
abstract Iterator<Class> |
getConverterTypes()
Return an Iterator over the set of Class
instances for which Converter classes have been explicitly
registered. |
abstract Locale |
getDefaultLocale()
Return the default Locale for this application. |
abstract String |
getDefaultRenderKitId()
Return the renderKitId to be used for rendering
this application. |
ELContextListener[] |
getELContextListeners()
If no calls have been made to addELContextListener(javax.el.ELContextListener) ,
this method must return an empty array. |
ELResolver |
getELResolver()
Return the singleton ELResolver instance to be used
for all EL resolution. |
ExpressionFactory |
getExpressionFactory()
Return the ExpressionFactory instance for this
application. |
abstract String |
getMessageBundle()
Return the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages
for this application. |
abstract NavigationHandler |
getNavigationHandler()
Return the NavigationHandler instance that will be passed
the outcome returned by any invoked application action for this
web application. |
abstract PropertyResolver |
getPropertyResolver()
Deprecated. This has been replaced by getELResolver() . |
ResourceBundle |
getResourceBundle(FacesContext ctx,
String name)
Find a ResourceBundle as defined in the
application configuration resources under the specified name. |
abstract StateManager |
getStateManager()
Return the StateManager instance that will be utilized
during the Restore View and Render Response
phases of the request processing lifecycle. |
abstract Iterator<Locale> |
getSupportedLocales()
Return an Iterator over the supported
Locale s for this appication. |
abstract Iterator<String> |
getValidatorIds()
Return an Iterator over the set of currently registered
validator ids for this Application . |
abstract VariableResolver |
getVariableResolver()
Deprecated. This has been replaced by getELResolver() . |
abstract ViewHandler |
getViewHandler()
Return the ViewHandler instance that will be utilized
during the Restore View and Render Response
phases of the request processing lifecycle. |
void |
removeELContextListener(ELContextListener listener)
Remove the argument listener from the list of
ELContextListener s. |
abstract void |
setActionListener(ActionListener listener)
Set the default ActionListener to be registered for all
ActionSource components. |
abstract void |
setDefaultLocale(Locale locale)
Set the default Locale for this application. |
abstract void |
setDefaultRenderKitId(String renderKitId)
Set the renderKitId to be used to render this
application. |
abstract void |
setMessageBundle(String bundle)
Set the fully qualified class name of the ResourceBundle
to be used for JavaServer Faces messages for this application. |
abstract void |
setNavigationHandler(NavigationHandler handler)
Set the NavigationHandler instance that will be passed
the outcome returned by any invoked application action for this
web application. |
abstract void |
setPropertyResolver(PropertyResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the
right place in the application configuration resources which will
be considered in the normal course of expression evaluation.
This method now will cause the argument resolver to
be wrapped inside an implementation of ELResolver and
exposed to the EL resolution system as if the user had called
addELResolver(javax.el.ELResolver) . |
abstract 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. |
abstract void |
setSupportedLocales(Collection<Locale> locales)
Set the Locale instances representing the supported
Locale s for this application. |
abstract void |
setVariableResolver(VariableResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the
right place in the application configuration resources which will
be considered in the normal course of expression evaluation.
This method now will cause the argument resolver to
be wrapped inside an implementation of ELResolver and
exposed to the EL resolution system as if the user had called
addELResolver(javax.el.ELResolver) . |
abstract 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. |
类方法继承 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造器详细信息 |
---|
Application
public Application()
方法详细信息 |
---|
getActionListener
public abstract ActionListener getActionListener()
Return the default
ActionListener
to be registered for allActionSource
components in this appication. If not explicitly set, a default implementation must be provided that performs the following functions:- The
processAction()
method must first callFacesContext.renderResponse()
in order to bypass any intervening lifecycle phases, once the method returns. - The
processAction()
method must next determine the logical outcome of this event, as follows:- If the originating component has a non-
null
action
property, retrieve theMethodBinding
from the property, and callinvoke()
on it. Convert the returned value (if any) to a String, and use it as the logical outcome. - Otherwise, the logical outcome is
null
.
- If the originating component has a non-
- The
processAction()
method must finally retrieve theNavigationHandler
instance for this application and callNavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
passing:- the
FacesContext
for the current request - If there is a
MethodBinding
instance for theaction
property of this component, the result of callingMethodBinding.getExpressionString()
on it, null otherwise - the logical outcome as determined above
- the
Note that the specification for the default
ActionListener
contiues to call for the use of a deprecated property (action
) and class (MethodBinding
). Unfortunately, this is necessary because the defaultActionListener
must continue to work with components that do not implementActionSource2
, and only implementActionSource
.- The
setActionListener
public abstract void setActionListener(ActionListener listener)
Set the default
ActionListener
to be registered for allActionSource
components.
- 参数:
listener
- The new defaultActionListener
- 抛出异常:
NullPointerException
- iflistener
isnull
getDefaultLocale
public abstract Locale getDefaultLocale()
Return the default
Locale
for this application. If not explicitly set,null
is returned.
setDefaultLocale
public abstract void setDefaultLocale(Locale locale)
Set the default
Locale
for this application.- 参数:
locale
- The new defaultLocale
- 抛出异常:
NullPointerException
- iflocale
isnull
getDefaultRenderKitId
public abstract String getDefaultRenderKitId()
Return the
renderKitId
to be used for rendering this application. If not explicitly set,null
is returned.
setDefaultRenderKitId
public abstract void setDefaultRenderKitId(String renderKitId)
Set the
renderKitId
to be used to render this application. Unless the client has provided a customViewHandler
that supports the use of multipleRenderKit
instances in the same application, this method must only be called at application startup, before any Faces requests have been processed. This is a limitation of the current Specification, and may be lifted in a future release.
getMessageBundle
public abstract String getMessageBundle()
Return the fully qualified class name of the
ResourceBundle
to be used for JavaServer Faces messages for this application. If not explicitly set,null
is returned.
setMessageBundle
public abstract void setMessageBundle(String bundle)
Set the fully qualified class name of the
ResourceBundle
to be used for JavaServer Faces messages for this application. See the JavaDocs for thejava.util.ResourceBundle
class for more information about the syntax for resource bundle names.- 参数:
bundle
- Base name of the resource bundle to be used- 抛出异常:
NullPointerException
- ifbundle
isnull
getNavigationHandler
public abstract NavigationHandler getNavigationHandler()
Return the
NavigationHandler
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 theNavigationHandler
class description.
setNavigationHandler
public abstract void setNavigationHandler(NavigationHandler handler)
Set the
NavigationHandler
instance that will be passed the outcome returned by any invoked application action for this web application.- 参数:
handler
- The newNavigationHandler
instance- 抛出异常:
NullPointerException
- ifhandler
isnull
getPropertyResolver
public abstract PropertyResolver getPropertyResolver()
- Deprecated. This has been replaced by
getELResolver()
. Return a
PropertyResolver
instance that wraps theELResolver
instance that Faces provides to the unified EL for the resolution of expressions that appear programmatically in an application.Note that this no longer returns the default
PropertyResolver
since that class is now a no-op that aids in allowing customPropertyResolver
s to affect the EL resolution process.
setPropertyResolver
public abstract void setPropertyResolver(PropertyResolver resolver)
- Deprecated. The recommended way to affect the execution of the EL
is to provide an
<el-resolver>
element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argumentresolver
to be wrapped inside an implementation ofELResolver
and exposed to the EL resolution system as if the user had calledaddELResolver(javax.el.ELResolver)
. Set the
PropertyResolver
instance that will be utilized to resolve method and value bindings.This method is now deprecated but the implementation must cause the argument to be set as the head of the legacy
PropertyResolver
chain, replacing any existing value that was set from the application configuration resources.It is illegal to call this method after the application has received any requests from the client. If an attempt is made to register a listener after that time it must have no effect.
- 参数:
resolver
- The newPropertyResolver
instance- 抛出异常:
NullPointerException
- ifresolver
isnull
IllegalStateException
- if called after the first request to theFacesServlet
has been serviced.
getResourceBundle
public ResourceBundle getResourceBundle(FacesContext ctx, String name)
Find a
ResourceBundle
as defined in the application configuration resources under the specified name. If aResourceBundle
was defined for the name, return an instance that uses the locale of the currentUIViewRoot
.The default implementation throws
UnsupportedOperationException
and is provided for the sole purpose of not breaking existing applications that extend this class.- 返回:
ResourceBundle
for the current UIViewRoot, otherwise null- 抛出异常:
FacesException
- if a bundle was defined, but not resolvableNullPointerException
- if ctx == null || name == null- 从以下版本开始:
- 1.2
getVariableResolver
public abstract VariableResolver getVariableResolver()
- Deprecated. This has been replaced by
getELResolver()
. Return the
VariableResolver
that wraps theELResolver
instance that Faces provides to the unified EL for the resolution of expressions that appear programmatically in an application. The implementation of theVariableResolver
must passnull
as the base argument for any methods invoked on the underlyingELResolver
.Note that this method no longer returns the default
VariableResolver
, since that class now is a no-op that aids in allowing customVariableResolver
s to affect the EL resolution process.
setVariableResolver
public abstract void setVariableResolver(VariableResolver resolver)
- Deprecated. The recommended way to affect the execution of the EL
is to provide an
<el-resolver>
element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argumentresolver
to be wrapped inside an implementation ofELResolver
and exposed to the EL resolution system as if the user had calledaddELResolver(javax.el.ELResolver)
. Set the
VariableResolver
instance that will be consulted to resolve method and value bindings.This method is now deprecated but the implementation must cause the argument to be set as the head of the legacy
VariableResolver
chain, replacing any existing value that was set from the application configuration resources.It is illegal to call this method after the application has received any requests from the client. If an attempt is made to register a listener after that time it must have no effect.
- 参数:
resolver
- The newVariableResolver
instance- 抛出异常:
NullPointerException
- ifresolver
isnull
IllegalStateException
- if called after the first request to theFacesServlet
has been serviced.
addELResolver
public void addELResolver(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.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, anIllegalStateException
must be thrown. This restriction is in place to allow the JSP container to optimize for the common case where no additionalELResolver
s are in the chain, aside from the standard ones. It is permissible to addELResolver
s before or after initialization to aCompositeELResolver
that is already in the chain.The default implementation throws
UnsupportedOperationException
and is provided for the sole purpose of not breaking existing applications that extendApplication
.- 从以下版本开始:
- 1.2
getELResolver
public ELResolver getELResolver()
Return the singleton
ELResolver
instance to be used for all EL resolution. This is actually an instance ofCompositeELResolver
that must contain the followingELResolver
instances in the following order:ELResolver
instances declared using the <el-resolver> element in the application configuration resources.An
implementation
that wraps the head of the legacyVariableResolver
chain, as per section VariableResolver ChainWrapper in Chapter 5 in the spec document.An
implementation
that wraps the head of the legacyPropertyResolver
chain, as per section PropertyResolver ChainWrapper in Chapter 5 in the spec document.Any
ELResolver
instances added by calls toaddELResolver(javax.el.ELResolver)
.
The default implementation throws
UnsupportedOperationException
and is provided for the sole purpose of not breaking existing applications that extendApplication
.- 从以下版本开始:
- 1.2
getViewHandler
public abstract ViewHandler getViewHandler()
Return the
ViewHandler
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 theViewHandler
description in the JavaServer Faces Specification.
setViewHandler
public abstract 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.- 参数:
handler
- The newViewHandler
instance- 抛出异常:
IllegalStateException
- if this method is called after at least one request has been processed by theLifecycle
instance for this application.NullPointerException
- ifhandler
isnull
getStateManager
public abstract StateManager getStateManager()
Return the
StateManager
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 theStateManager
description in the JavaServer Faces Specification.
setStateManager
public abstract 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.- 参数:
manager
- The newStateManager
instance- 抛出异常:
IllegalStateException
- if this method is called after at least one request has been processed by theLifecycle
instance for this application.NullPointerException
- ifmanager
isnull
addComponent
public abstract void addComponent(String componentType, String componentClass)
Register a new mapping of component type to the name of the corresponding
UIComponent
class. This allows subsequent calls tocreateComponent()
to serve as a factory forUIComponent
instances.- 参数:
componentType
- The component type to be registeredcomponentClass
- The fully qualified class name of the correspondingUIComponent
implementation- 抛出异常:
NullPointerException
- ifcomponentType
orcomponentClass
isnull
createComponent
public abstract UIComponent createComponent(String componentType) throws FacesException
Instantiate and return a new
UIComponent
instance of the class specified by a previous call toaddComponent()
for the specified component type.- 参数:
componentType
- The component type for which to create and return a newUIComponent
instance- 抛出异常:
FacesException
- if aUIComponent
of the specified type cannot be createdNullPointerException
- ifcomponentType
isnull
createComponent
public abstract UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType) throws FacesException
- Deprecated. This has been replaced by
createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String)
. Wrap the argument
componentBinding
in an implementation ofValueExpression
and call through tocreateComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String)
.- 参数:
componentBinding
-ValueBinding
representing a component value binding expression (typically specified by thecomponent
attribute of a custom tag)context
-FacesContext
for the current requestcomponentType
- Component type to create if theValueBinding
does not return a component instance- 抛出异常:
FacesException
- if aUIComponent
cannot be createdNullPointerException
- if any parameter isnull
createComponent
public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException
Call the
getValue()
method on the specifiedValueExpression
. If it returns aUIComponent
instance, return it as the value of this method. If it does not, instantiate a newUIComponent
instance of the specified component type, pass the new component to thesetValue()
method of the specifiedValueExpression
, and return it.- 参数:
componentExpression
-ValueExpression
representing a component value expression (typically specified by thecomponent
attribute of a custom tag)context
-FacesContext
for the current requestcomponentType
- Component type to create if theValueExpression
does not return a component instance- 抛出异常:
FacesException
- if aUIComponent
cannot be createdNullPointerException
- if any parameter isnull
A default implementation is provided that throws
.UnsupportedOperationException
so that users that decorateApplication
can continue to function- 从以下版本开始:
- 1.2
getComponentTypes
public abstract Iterator<String> getComponentTypes()
Return an
Iterator
over the set of currently defined component types for thisApplication
.
addConverter
public abstract void addConverter(String converterId, String converterClass)
Register a new mapping of converter id to the name of the corresponding
Converter
class. This allows subsequent calls tocreateConverter()
to serve as a factory forConverter
instances.- 参数:
converterId
- The converter id to be registeredconverterClass
- The fully qualified class name of the correspondingConverter
implementation- 抛出异常:
NullPointerException
- ifconverterId
orconverterClass
isnull
addConverter
public abstract void addConverter(Class targetClass, String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class.
- 参数:
targetClass
- The class for which this converter is registeredconverterClass
- The fully qualified class name of the correspondingConverter
implementation- 抛出异常:
NullPointerException
- iftargetClass
orconverterClass
isnull
createConverter
public abstract Converter createConverter(String converterId)
Instantiate and return a new
Converter
instance of the class specified by a previous call toaddConverter()
for the specified converter id. If there is no such registration for this converter id, returnnull
.- 参数:
converterId
- The converter id for which to create and return a newConverter
instance- 抛出异常:
FacesException
- if theConverter
cannot be createdNullPointerException
- ifconverterId
isnull
createConverter
public abstract Converter createConverter(Class targetClass)
Instantiate and return a new
Converter
instance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no suchConverter
class can be identified, returnnull
.To locate an appropriate
Converter
class, the following algorithm is performed, stopping as soon as an appropriateConverter
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.
If the
Converter
has a single argument constructor that accepts aClass
, instantiate theConverter
using that constructor, passing the argumenttargetClass
as the sole argument. Otherwise, simply use the zero-argument constructor.- Locate a
- 参数:
targetClass
- Target class for which to return aConverter
- 抛出异常:
FacesException
- if theConverter
cannot be createdNullPointerException
- iftargetClass
isnull
getConverterIds
public abstract Iterator<String> getConverterIds()
Return an
Iterator
over the set of currently registered converter ids for thisApplication
.
getConverterTypes
public abstract Iterator<Class> getConverterTypes()
Return an
Iterator
over the set ofClass
instances for whichConverter
classes have been explicitly registered.
getExpressionFactory
public ExpressionFactory getExpressionFactory()
Return the
ExpressionFactory
instance for this application. This instance is used by the convenience methodevaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)
.The implementation must return the
ExpressionFactory
from the JSP container by callingJspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory()
.An implementation is provided that throws
UnsupportedOperationException
so that users that decorate theApplication
continue to work.- 从以下版本开始:
- 1.2
evaluateExpressionGet
public Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType) throws ELException
Get a value by evaluating an expression.
Call
getExpressionFactory()
then callExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
passing the argumentexpression
andexpectedType
. CallFacesContext.getELContext()
and pass it toValueExpression.getValue(javax.el.ELContext)
, returning the result.An implementation is provided that throws
UnsupportedOperationException
so that users that decorate theApplication
continue to work.- 抛出异常:
ELException
createMethodBinding
public abstract MethodBinding createMethodBinding(String ref, Class[] params) throws ReferenceSyntaxException
- Deprecated. This has been replaced by calling
getExpressionFactory()
thenExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[])
. Call
getExpressionFactory()
then callExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[])
, passing the given arguments, and wrap the result in aMethodBinding
implementation, returning it.- 参数:
ref
- Method binding expression for which to return aMethodBinding
instanceparams
- Parameter signatures that must be compatible with those of the method to be invoked, or a zero-length array ornull
for a method that takes no parameters- 抛出异常:
NullPointerException
- ifref
isnull
ReferenceSyntaxException
- if the specifiedref
has invalid syntax
getSupportedLocales
public abstract Iterator<Locale> getSupportedLocales()
Return an
Iterator
over the supportedLocale
s for this appication.
setSupportedLocales
public abstract void setSupportedLocales(Collection<Locale> locales)
Set the
Locale
instances representing the supportedLocale
s for this application.- 参数:
locales
- The set of supportedLocale
s for this application- 抛出异常:
NullPointerException
- if the argumentnewLocales
isnull
.
addELContextListener
public void addELContextListener(ELContextListener listener)
Provide a way for Faces applications to register an
ELContextListener
that will be notified on creation ofELContext
instances. This listener will be called once per request.An implementation is provided that throws
UnsupportedOperationException
so that users that decorate theApplication
continue to work.- 从以下版本开始:
- 1.2
removeELContextListener
public void removeELContextListener(ELContextListener listener)
Remove the argument
listener
from the list ofELContextListener
s. Iflistener
is null, no exception is thrown and no action is performed. Iflistener
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 theApplication
continue to work.- 从以下版本开始:
- 1.2
getELContextListeners
public ELContextListener[] getELContextListeners()
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 theApplication
continue to work.- 从以下版本开始:
- 1.2
addValidator
public abstract void addValidator(String validatorId, String validatorClass)
Register a new mapping of validator id to the name of the corresponding
Validator
class. This allows subsequent calls tocreateValidator()
to serve as a factory forValidator
instances.- 参数:
validatorId
- The validator id to be registeredvalidatorClass
- The fully qualified class name of the correspondingValidator
implementation- 抛出异常:
NullPointerException
- ifvalidatorId
orvalidatorClass
isnull
createValidator
public abstract Validator createValidator(String validatorId) throws FacesException
Instantiate and return a new
Validator
instance of the class specified by a previous call toaddValidator()
for the specified validator id.- 参数:
validatorId
- The validator id for which to create and return a newValidator
instance- 抛出异常:
FacesException
- if aValidator
of the specified id cannot be createdNullPointerException
- ifvalidatorId
isnull
getValidatorIds
public abstract Iterator<String> getValidatorIds()
Return an
Iterator
over the set of currently registered validator ids for thisApplication
.
createValueBinding
public abstract ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException
- Deprecated. This has been replaced by calling
getExpressionFactory()
thenExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
. Call
getExpressionFactory()
then callExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
, passing the argumentref
,Object.class
for the expectedType, andnull
, for the fnMapper.- 参数:
ref
- Value binding expression for which to return aValueBinding
instance- 抛出异常:
NullPointerException
- ifref
isnull
ReferenceSyntaxException
- if the specifiedref
has invalid syntax
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.