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

pack-priv Class WholeBeanValidator

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
private static final Logger

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)

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 javax.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
LOGGERback to summary
private static final Logger LOGGER

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)
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 javax.faces.validator.Validator.validate.

Doc from javax.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 javax.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 JSF 1.2 to work with JSF 2 and later. The javax.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
javax.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 javax.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 javax.faces.component.visit.VisitCallback.visit.

Doc from javax.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