|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.faces.validator Interface Validator
- 所有父接口:
- EventListener
public interface Validator
- extends EventListener
A Validator implementation is a class that can
perform validation (correctness checks) on a EditableValueHolder
. Zero or more
Validator
s can be associated with each
EditableValueHolder
in
the view, and are called during the Process Validations
phase of the request processing lifecycle.
Individual Validator
s should examine the value and
component that they are passed, and throw a ValidatorException
containing a FacesMessage
, documenting
any failures to conform to the required rules.
For maximum generality, Validator
instances may be
configurable based on properties of the Validator
implementation
class. For example, a range check Validator
might support
configuration of the minimum and maximum values to be used.
Validator
implementations must have a zero-arguments
public constructor. In addition, if the Validator
class
wishes to have configuration property values saved and restored with
the view, the implementation must also implement StateHolder
.
字段摘要 | |
---|---|
static String |
NOT_IN_RANGE_MESSAGE_ID
Deprecated. Use DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID or
LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID instead. |
方法摘要 | |
---|---|
void |
validate(FacesContext context,
UIComponent component,
Object value)
Perform the correctness checks implemented by this Validator against the specified UIComponent . |
字段详细信息 |
---|
NOT_IN_RANGE_MESSAGE_ID
static final String NOT_IN_RANGE_MESSAGE_ID
- Deprecated. Use
DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID
orLongRangeValidator.NOT_IN_RANGE_MESSAGE_ID
instead. The message identifier of the
FacesMessage
to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set. The message format string for this message may optionally include a{0}
placeholder, which will be replaced by the configured minimum value, and a{1}
placeholder, which will be replaced by the configured maximum value.- 另请参见:
- 常量字段
方法详细信息 |
---|
validate
void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
Perform the correctness checks implemented by this
Validator
against the specifiedUIComponent
. If any violations are found, aValidatorException
will be thrown containing theFacesMessage
describing the failure.- 参数:
context
- FacesContext for the request we are processingcomponent
- UIComponent we are checking for correctnessvalue
- the value to validate- 抛出异常:
ValidatorException
- if validation failsNullPointerException
- ifcontext
orcomponent
isnull
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.