A Validator that delegates validation of the bean property to the Bean Validation API.
Modifier and Type | Class and Description |
---|---|
private static class |
Modifier and Type | Field and Description |
---|---|
private transient Class | |
public static final String | DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME
If this param is defined, and calling |
public static final String | EMPTY_VALIDATION_GROUPS_PATTERN
The regular expression pattern that identifies an empty list of validation groups. |
public static final String | ENABLE_VALIDATE_WHOLE_BEAN_PARAM_NAME
If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns
|
private boolean | |
private static final Logger | |
public static final String | MESSAGE_ID
The message identifier of the |
private boolean | |
public static final String | VALIDATION_GROUPS_DELIMITER
The delimiter that is used to separate the list of fully-qualified group names as strings. |
private String | |
public static final String | VALIDATOR_FACTORY_KEY
The name of the Jakarta Servlet context attribute which holds the object used by Jakarta Faces to obtain Validator instances. |
public static final String | VALIDATOR_ID
The standard validator id for this validator, as defined by the Jakarta Server Face specification. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | clearInitialState()
Implements jakarta. Reset the PartialStateHolder to a non-delta tracking state. |
private static Validator | |
public String | Returns: the value of thevalidatinGroups attribute.Return the validation groups passed to the Validation API when checking constraints. |
private static ValidatorFactory | |
private static ValueReference | |
public boolean | initialStateMarked()
Implements jakarta.
Return |
private boolean | |
public boolean | isTransient()
Implements jakarta. If true, the Object implementing this interface must not participate in state saving or restoring. |
public void | markInitialState()
Implements jakarta.
The runtime must ensure that the |
private Class | |
private void | recordValidationResult(FacesContext context, UIComponent component, Object wholeBean, String propertyName, Object propertyValue)
|
public void | restoreState(FacesContext
the Faces context. context, Object the state. state)Implements jakarta. Perform any processing required to restore the state from the entries in the state Object. |
public Object | saveState(FacesContext
the Faces context. context)Implements jakarta.
Gets the state of the instance as a |
public void | setTransient(boolean
boolean pass transientValue)true if this Object will
not participate in state saving or restoring, otherwise pass false .Implements jakarta. Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring. |
public void | setValidationGroups(String
comma-separated list of validation groups (string with only spaces and commas treated as
null) validationGroups)A comma-separated list of validation groups which are used to filter which validations get checked by this validator. |
public void | validate(FacesContext
FacesContext for the request we are processing context, UIComponent UIComponent we are checking for correctness component, Object the value to validate value)Implements jakarta. Verify that the value is valid according to the Bean Validation constraints. |
cachedValidationGroups | back to summary |
---|---|
private transient Class<?>[] cachedValidationGroups |
DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME | back to summary |
---|---|
public static final String DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME
If this param is defined, and calling |
EMPTY_VALIDATION_GROUPS_PATTERN | back to summary |
---|---|
public static final String EMPTY_VALIDATION_GROUPS_PATTERN The regular expression pattern that identifies an empty list of validation groups. |
ENABLE_VALIDATE_WHOLE_BEAN_PARAM_NAME | back to summary |
---|---|
public static final String ENABLE_VALIDATE_WHOLE_BEAN_PARAM_NAME
If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns
|
initialState | back to summary |
---|---|
private boolean initialState |
LOGGER | back to summary |
---|---|
private static final Logger LOGGER |
MESSAGE_ID | back to summary |
---|---|
public static final String MESSAGE_ID
The message identifier of the
The message format string provided by the default implementation should be a the placeholder {0}, thus fully delegating the message handling to Bean Validation. A developer can override this message format string to make it conform to other Jakarta Server Face validator messages (i.e., by including the component label) |
transientValue | back to summary |
---|---|
private boolean transientValue |
VALIDATION_GROUPS_DELIMITER | back to summary |
---|---|
public static final String VALIDATION_GROUPS_DELIMITER The delimiter that is used to separate the list of fully-qualified group names as strings. |
validationGroups | back to summary |
---|---|
private String validationGroups |
VALIDATOR_FACTORY_KEY | back to summary |
---|---|
public static final String VALIDATOR_FACTORY_KEY The name of the Jakarta Servlet context attribute which holds the object used by Jakarta Faces to obtain Validator instances. If the Jakarta Servlet context attribute is missing or contains a null value, Jakarta Server Faces is free to use this Jakarta Servlet context attribute to store the ValidatorFactory bootstrapped by this validator. |
VALIDATOR_ID | back to summary |
---|---|
public static final String VALIDATOR_ID The standard validator id for this validator, as defined by the Jakarta Server Face specification. |
BeanValidator | back to summary |
---|---|
public BeanValidator() |
clearInitialState | back to summary |
---|---|
public void clearInitialState() Implements jakarta. Doc from jakarta. Reset the PartialStateHolder to a non-delta tracking state.
|
getBeanValidator | back to summary |
---|---|
private static Validator getBeanValidator(FacesContext context) |
getValidationGroups | back to summary |
---|---|
public String getValidationGroups()
Return the validation groups passed to the Validation API when checking constraints. If the validationGroupsArray
attribute is omitted or empty, the validation groups will be inherited from the branch defaults, or if there are no
branch defaults, the
|
getValidatorFactory | back to summary |
---|---|
private static ValidatorFactory getValidatorFactory(FacesContext context) |
getValueReference | back to summary |
---|---|
private static ValueReference getValueReference(FacesContext context, UIComponent component, ValueExpression valueExpression) |
initialStateMarked | back to summary |
---|---|
public boolean initialStateMarked() Implements jakarta. Doc from jakarta.
Return
|
isResolvable | back to summary |
---|---|
private boolean isResolvable(ValueReference valueReference, ValueExpression valueExpression) |
isTransient | back to summary |
---|---|
public boolean isTransient() Implements jakarta. Doc from jakarta. If true, the Object implementing this interface must not participate in state saving or restoring.
|
markInitialState | back to summary |
---|---|
public void markInitialState() Implements jakarta. Doc from jakarta.
The runtime must ensure that the
|
parseValidationGroups | back to summary |
---|---|
private Class |
recordValidationResult | back to summary |
---|---|
private void recordValidationResult(FacesContext context, UIComponent component, Object wholeBean, String propertyName, Object propertyValue) |
restoreState | back to summary |
---|---|
public void restoreState(FacesContext context, Object state) Implements jakarta. Doc from jakarta. Perform any processing required to restore the state from the entries in the state Object.
If the class that implements this interface has references to instances that also implement StateHolder (such as a
If the
|
saveState | back to summary |
---|---|
public Object saveState(FacesContext context) Implements jakarta. Doc from jakarta.
Gets the state of the instance as a
If the class that implements this interface has references to instances that implement StateHolder (such as a
This method must not alter the state of the implementing object. In other words, after executing this code:
The return from this method must be
|
setTransient | back to summary |
---|---|
public void setTransient(boolean transientValue) Implements jakarta. Doc from jakarta. Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
|
setValidationGroups | back to summary |
---|---|
public void setValidationGroups(String validationGroups)
A comma-separated list of validation groups which are used to filter which validations get checked by this validator.
If the validationGroupsArray attribute is omitted or is empty, the validation groups will be inherited from the
branch defaults or, if there are no branch defaults, the
|
validate | back to summary |
---|---|
public void validate(FacesContext context, UIComponent component, Object value) Implements jakarta. Verify that the value is valid according to the Bean Validation constraints.
Obtain a
Let validationGroupsArray be a
Let valueExpression be the return from calling
If no
If
Obtain the
Decorate the
Obtain the
Obtain a
Call
If the returned
If the returned
|
Modifier and Type | Field and Description |
---|---|
private FacesContext | |
private MessageInterpolator |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public String | interpolate(String
the message to interpolate message, MessageInterpolator.contextual information related to the interpolation contextImplements jakarta. |
public String | interpolate(String
the message to interpolate message, MessageInterpolator.contextual information related to the interpolation context,the locale targeted for the message locale)Implements jakarta. |
context | back to summary |
---|---|
private FacesContext context |
delegate | back to summary |
---|---|
private MessageInterpolator delegate |
FacesAwareMessageInterpolator | back to summary |
---|---|
public FacesAwareMessageInterpolator(FacesContext context, MessageInterpolator delegate) |
interpolate | back to summary |
---|---|
public String interpolate(String message, MessageInterpolator. Implements jakarta. Doc from jakarta. Interpolates the message template based on the constraint validation context.
The locale is defaulted according to the
|
interpolate | back to summary |
---|---|
public String interpolate(String message, MessageInterpolator. Implements jakarta. Doc from jakarta. Interpolates the message template based on the constraint validation context.
The |