org.apache.myfaces.extensions.validator.crossval.strategy
Class AbstractCrossValidationStrategy<A extends Annotation>

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractValidationStrategy
      extended by org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy<A>
          extended by org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCrossValidationStrategy<A>
All Implemented Interfaces:
ValidationStrategy, CrossValidationStrategy
Direct Known Subclasses:
AbstractCompareStrategy

public abstract class AbstractCrossValidationStrategy<A extends Annotation>
extends AbstractAnnotationValidationStrategy<A>
implements CrossValidationStrategy

Since:
1.x.1

Field Summary
 
Fields inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy
DETAIL_MESSAGE_KEY_POSTFIX
 
Fields inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractValidationStrategy
logger
 
Constructor Summary
AbstractCrossValidationStrategy()
           
 
Method Summary
 CrossValidationStorageEntry getCrossValidationStorageEntry(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
           
protected  String getLabel(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry)
          Returns the label of the uiComponent field that could be used in the error messages.
protected  void initCrossValidation(CrossValidationStorageEntry crossValidationStorageEntry)
           
protected  void initValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
          Allows some initialization before the actual validation is performed.
protected  boolean processAfterCrossValidatorException(CrossValidationStorageEntry crossValidationStorageEntry, javax.faces.validator.ValidatorException validatorException)
           
protected  boolean processAfterValidatorException(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject, javax.faces.validator.ValidatorException validatorException)
          Executes the registered ValidationExceptionInterceptor to process the validation exception.
 void processValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
          Validates the given value based on the given meta-data entry.
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy
getErrorMessageDetail, getErrorMessageSummary, getValidationErrorFacesMessage, getValidationErrorMsgKey, resolveMessage, setMessageResolver
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractValidationStrategy
validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.extensions.validator.crossval.strategy.CrossValidationStrategy
processCrossValidation
 
Methods inherited from interface org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy
validate
 

Constructor Detail

AbstractCrossValidationStrategy

public AbstractCrossValidationStrategy()
Method Detail

processValidation

public void processValidation(javax.faces.context.FacesContext facesContext,
                              javax.faces.component.UIComponent uiComponent,
                              MetaDataEntry metaDataEntry,
                              Object convertedObject)
                       throws javax.faces.validator.ValidatorException
Description copied from class: AbstractValidationStrategy
Validates the given value based on the given meta-data entry. The method throws a ValidatorException if a violation is detected

Specified by:
processValidation in class AbstractValidationStrategy
Parameters:
facesContext - The JSF Context
uiComponent - The JSF component that contained the value entered by the user.
metaDataEntry - The data holder which stores the meta-data and some information where the meta-data was around.
convertedObject - Converted object of the user entered value.
Throws:
javax.faces.validator.ValidatorException - When violation of the validation rules occurs.

getCrossValidationStorageEntry

public CrossValidationStorageEntry getCrossValidationStorageEntry(javax.faces.context.FacesContext facesContext,
                                                                  javax.faces.component.UIComponent uiComponent,
                                                                  MetaDataEntry metaDataEntry,
                                                                  Object convertedObject)
Specified by:
getCrossValidationStorageEntry in interface CrossValidationStrategy

processAfterValidatorException

protected final boolean processAfterValidatorException(javax.faces.context.FacesContext facesContext,
                                                       javax.faces.component.UIComponent uiComponent,
                                                       MetaDataEntry metaDataEntry,
                                                       Object convertedObject,
                                                       javax.faces.validator.ValidatorException validatorException)
Description copied from class: AbstractAnnotationValidationStrategy
Executes the registered ValidationExceptionInterceptor to process the validation exception. Adds the label of the component to the MetaDataEntry.

Overrides:
processAfterValidatorException in class AbstractAnnotationValidationStrategy<A extends Annotation>
Parameters:
facesContext - The JSF Context
uiComponent - The JSF component that contained the value entered by the user.
metaDataEntry - The data holder which stores the meta-data and some information where the meta-data was around.
convertedObject - Converted object of the user entered value.
validatorException - The validation exception that occurred.
Returns:
should return true when you like to have the ValidatorException thrown by the ExtValUtils#tryToThrowValidatorExceptionForComponent method. ExtValUtils.tryToThrowValidatorExceptionForComponent(javax.faces.component.UIComponent, javax.faces.application.FacesMessage, java.lang.Throwable)

getLabel

protected final String getLabel(javax.faces.context.FacesContext facesContext,
                                javax.faces.component.UIComponent uiComponent,
                                MetaDataEntry metaDataEntry)
Description copied from class: AbstractAnnotationValidationStrategy
Returns the label of the uiComponent field that could be used in the error messages. By default it returns null.

Overrides:
getLabel in class AbstractAnnotationValidationStrategy<A extends Annotation>
Parameters:
facesContext - The JSF Context
uiComponent - The JSF component that contained the value entered by the user.
metaDataEntry - The data holder which stores the meta-data and some information where the meta-data was around.
Returns:
The label-text of the UIComponent which can be used in the violation msg.

initValidation

protected final void initValidation(javax.faces.context.FacesContext facesContext,
                                    javax.faces.component.UIComponent uiComponent,
                                    MetaDataEntry metaDataEntry,
                                    Object convertedObject)
Description copied from class: AbstractValidationStrategy
Allows some initialization before the actual validation is performed. This initialization is executed before each validation and not only once when th class is constructed.

Overrides:
initValidation in class AbstractValidationStrategy
Parameters:
facesContext - The JSF Context
uiComponent - The JSF component that contained the value entered by the user.
metaDataEntry - The data holder which stores the meta-data and some information where the meta-data was around.
convertedObject - Converted object of the user entered value.

initCrossValidation

protected void initCrossValidation(CrossValidationStorageEntry crossValidationStorageEntry)

processAfterCrossValidatorException

protected boolean processAfterCrossValidatorException(CrossValidationStorageEntry crossValidationStorageEntry,
                                                      javax.faces.validator.ValidatorException validatorException)


Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.