org.apache.myfaces.extensions.validator.crossval.strategy
Class AbstractCrossValidationStrategy<A extends Annotation>
java.lang.Object
org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractValidationStrategy
org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy<A>
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractCrossValidationStrategy
public AbstractCrossValidationStrategy()
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 ContextuiComponent
- 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 ContextuiComponent
- 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 ContextuiComponent
- 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 ContextuiComponent
- 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.