Top Inners Fields Constructors Methods
com.sun.faces.ext.component

pack-priv Class WholeBeanValidator

extends Object
implements Validator<Object>
Class Inheritance
All Implemented Interfaces
jakarta.faces.validator.Validator, java.util.EventListener
Static Imports
com.sun.faces.ext.component.MessageFactory.getLabel, .MessageFactory.getMessage, com.sun.faces.util.BeanValidation.getBeanValidator, .ReflectionUtils.setProperties, .Util.getValueExpressionNullSafe, com.sun.faces.util.copier.CopierUtils.getCopier, jakarta.faces.component.visit.VisitContext.createVisitContext, .VisitResult.ACCEPT, jakarta.faces.validator.BeanValidator.MESSAGE_ID, .BeanValidator.VALIDATOR_ID, java.util.Collections.emptyMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
pack-priv static final String
FAILED_FIELD_LEVEL_VALIDATION

Special value to indicate the proposed value for a property failed field-level validation.

private static final Logger
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private Object
copyBeanAndPopulateWithCandidateValues(FacesContext context, ValueExpression wholeBeanVE, Object wholeBean, String copierType, Map<String, Map<String, Object>> candidate)

private Set<ConstraintViolation<?>>
doBeanValidation(Validator beanValidator, Object wholeBeanCopy, Class<?>[] validationGroupArray, ValueExpression wholeBeanVE)

pack-priv static Map<Object, Map<String, Map<String, Object>>>
private UIForm
private boolean
private void
invalidateComponent(Map.Entry<String, Map<String, Object>> wholeBeanPropertyEntry)

private boolean
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.faces.validator.Validator.validate.

Perform the correctness checks implemented by this Validator against the specified UIComponent.

public void
validate(FacesContext context, UIValidateWholeBean component, Object value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ERROR_MISSING_FORMback to summary
private static final String ERROR_MISSING_FORM
FAILED_FIELD_LEVEL_VALIDATIONback to summary
pack-priv static final String FAILED_FIELD_LEVEL_VALIDATION

Special value to indicate the proposed value for a property failed field-level validation. This prevents any attempt to perform class level validation.

LOGGERback to summary
private static final Logger LOGGER
MULTI_FIELD_VALIDATION_CANDIDATESback to summary
pack-priv static final String MULTI_FIELD_VALIDATION_CANDIDATES

Constructor Detail

WholeBeanValidatorback to summary
pack-priv WholeBeanValidator()

Method Detail

copyBeanAndPopulateWithCandidateValuesback to summary
private Object copyBeanAndPopulateWithCandidateValues(FacesContext context, ValueExpression wholeBeanVE, Object wholeBean, String copierType, Map<String, Map<String, Object>> candidate)
doBeanValidationback to summary
private Set<ConstraintViolation<?>> doBeanValidation(Validator beanValidator, Object wholeBeanCopy, Class<?>[] validationGroupArray, ValueExpression wholeBeanVE)
getMultiFieldValidationCandidatesback to summary
pack-priv static Map<Object, Map<String, Map<String, Object>>> getMultiFieldValidationCandidates(FacesContext context, boolean create)
getParentFormback to summary
private UIForm getParentForm(UIComponent component)
hasAnyBeanPropertyFailedValidationback to summary
private boolean hasAnyBeanPropertyFailedValidation(FacesContext context, Object wholeBean)
invalidateComponentback to summary
private void invalidateComponent(Map.Entry<String, Map<String, Object>> wholeBeanPropertyEntry)
isFailedFieldLevelValidationback to summary
private boolean isFailedFieldLevelValidation(Map.Entry<String, Map<String, Object>> wholeBeanPropertyEntry)
validateback to summary
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException

Implements jakarta.faces.validator.Validator.validate.

Doc from jakarta.faces.validator.Validator.validate.

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the jakarta.faces.application.FacesMessage describing the failure.

For a validator to be fully compliant with Version 2 and later of the specification, it must not fail validation on null or empty values unless it is specifically intended to address null or empty values. An application-wide <context-param> is provided to allow validators designed for Jakarta Faces 1.2 to work with Jakarta Faces 2 and later. The jakarta.faces.VALIDATE_EMPTY_FIELDS <context-param> must be set to false to enable this backwards compatibility behavior.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent we are checking for correctness

value:Object

the value to validate

Annotations
@Override
Exceptions
ValidatorException:
if validation fails
validateback to summary
public void validate(FacesContext context, UIValidateWholeBean component, Object value) throws ValidatorException
com.sun.faces.ext.component back to summary

private Class WholeBeanValidator.AddRemainingCandidateFieldsCallback

extends Object
implements VisitCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.ext.component.WholeBeanValidator.AddRemainingCandidateFieldsCallback
All Implemented Interfaces
jakarta.faces.component.visit.VisitCallback

Field Summary

Modifier and TypeField and Description
private final Object
private final Map<String, Map<String, Object>>
private final FacesContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv final Map<String, Map<String, Object>>
private static Object
public VisitResult
visit(VisitContext
the VisitContext for this tree visit.
visitContext
,
UIComponent
the UIComponent to visit
component
)

Implements jakarta.faces.component.visit.VisitCallback.visit.

This method is called during component tree visits by VisitContext.invokeVisitCallback() to visit the specified component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseback to summary
private final Object base
candidateback to summary
private final Map<String, Map<String, Object>> candidate
contextback to summary
private final FacesContext context

Constructor Detail

AddRemainingCandidateFieldsCallbackback to summary
public AddRemainingCandidateFieldsCallback(final FacesContext context, final Object base)

Method Detail

getCandidateback to summary
pack-priv final Map<String, Map<String, Object>> getCandidate()
getComponentValueback to summary
private static Object getComponentValue(UIComponent component)
visitback to summary
public VisitResult visit(VisitContext visitContext, UIComponent component)

Implements jakarta.faces.component.visit.VisitCallback.visit.

Doc from jakarta.faces.component.visit.VisitCallback.visit.

This method is called during component tree visits by VisitContext.invokeVisitCallback() to visit the specified component. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
visitContext:VisitContext

the VisitContext for this tree visit.

component:UIComponent

the UIComponent to visit

Returns:VisitResult

a VisitResult that indicates whether to continue visiting the component's subtree, skip visiting the component's subtree or end the visit.

Annotations
@Override