|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.extensions.validator.core.validation.strategy.AbstractValidationStrategy
public abstract class AbstractValidationStrategy
Provides the ability to use ValidatorException
(as expected by the user) instead of the internally needed
ConverterException
. Furthermore, this base implementation introduces a hook for the
initialization of validators and the interception of ValidatorException
s.
Field Summary | |
---|---|
protected Logger |
logger
|
Constructor Summary | |
---|---|
protected |
AbstractValidationStrategy()
|
Method Summary | |
---|---|
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 |
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. |
protected abstract 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. |
void |
validate(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent uiComponent,
MetaDataEntry metaDataEntry,
Object convertedObject)
Validates the convertedObject against the given MetaDataEntry . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Logger logger
Constructor Detail |
---|
protected AbstractValidationStrategy()
Method Detail |
---|
public void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
MetaDataEntry
.
Before actually executing the validation (processValidation(javax.faces.context.FacesContext, javax.faces.component.UIComponent, org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry, java.lang.Object)
) any initialization can be
performed by overriding initValidation(javax.faces.context.FacesContext, javax.faces.component.UIComponent, org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry, java.lang.Object)
. If a Validation exception occurs, the method
processAfterValidatorException(javax.faces.context.FacesContext, javax.faces.component.UIComponent, org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry, java.lang.Object, javax.faces.validator.ValidatorException)
executes the registered
ValidationExceptionInterceptor
's.
validate
in interface ValidationStrategy
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.protected void initValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
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.protected boolean processAfterValidatorException(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject, javax.faces.validator.ValidatorException validatorException)
ValidationExceptionInterceptor
to process the validation exception.
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.
ExtValUtils.tryToThrowValidatorExceptionForComponent(javax.faces.component.UIComponent, javax.faces.application.FacesMessage, java.lang.Throwable)
protected abstract void processValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject) throws javax.faces.validator.ValidatorException
ValidatorException
if a violation is detected
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.
javax.faces.validator.ValidatorException
- When violation of the validation rules occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |