org.apache.myfaces.extensions.validator.core.interceptor
Class ValidationInterceptor

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.interceptor.AbstractRendererInterceptor
      extended by org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor
          extended by org.apache.myfaces.extensions.validator.core.interceptor.ValidationInterceptor
All Implemented Interfaces:
RendererInterceptor

public class ValidationInterceptor
extends AbstractValidationInterceptor

Since:
1.x.1

Field Summary
 
Fields inherited from class org.apache.myfaces.extensions.validator.core.interceptor.AbstractRendererInterceptor
logger
 
Constructor Summary
ValidationInterceptor()
           
 
Method Summary
protected  MetaDataExtractor getComponentMetaDataExtractor(Map<String,Object> properties)
          Implementations must return the MetaDataExtractor that will perform the extraction of the meta data from the component.
protected  Map<String,Object> getTransformedMetaDataFor(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
protected  void initComponent(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
          Initialize the component based on the meta-data which is provided by the referenced property.
protected  boolean interpretEmptyStringValuesAsNull()
          Uses a config parameter (javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL) which was introduced by JSF 2 for converting empty strings to null.
protected  boolean isRequiredInitializationSupported()
          In case of required initialization it's needed for some use-cases to reset the (required-)state of the components.
protected  boolean isValidationStrategyCompatibleWithValue(ValidationStrategy validationStrategy, Object value, MetaDataEntry entry)
           
protected  void processFieldValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, Object convertedObject, PropertyInformation propertyInformation)
           
protected  void processValidation(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, Object convertedObject)
          A concrete implementation has to perform the actual validation of the value.
protected  boolean recordProcessedInformation()
          Signals if the converted value should be stored e.g.
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor
afterDecode, beforeEncodeBegin, beforeGetConvertedValue, getELHelper, getInterceptorProperties, getModuleKey, getPropertiesForComponentMetaDataExtractor, getPropertyInformation, isValueToValidateEmpty, processAfterValidation, processBeforeValidation, processComponent, transformValueForValidation, validateEmptyFields, validateValue
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.interceptor.AbstractRendererInterceptor
afterEncodeBegin, afterEncodeChildren, afterEncodeEnd, afterGetConvertedValue, beforeDecode, beforeEncodeChildren, beforeEncodeEnd, getInterceptorId, getReturnValueOnSkipRendererDelegationException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationInterceptor

public ValidationInterceptor()
Method Detail

isRequiredInitializationSupported

protected boolean isRequiredInitializationSupported()
Description copied from class: AbstractValidationInterceptor
In case of required initialization it's needed for some use-cases to reset the (required-)state of the components. Such a reset is just needed if required initialization is activated.

Overrides:
isRequiredInitializationSupported in class AbstractValidationInterceptor
Returns:
true if required initialization is supported by the current implementation, false otherwise

initComponent

protected void initComponent(javax.faces.context.FacesContext facesContext,
                             javax.faces.component.UIComponent uiComponent)
Description copied from class: AbstractValidationInterceptor
Initialize the component based on the meta-data which is provided by the referenced property.

Specified by:
initComponent in class AbstractValidationInterceptor
Parameters:
facesContext - The JSF Context
uiComponent - The component which is processed

getTransformedMetaDataFor

protected Map<String,Object> getTransformedMetaDataFor(javax.faces.context.FacesContext facesContext,
                                                       javax.faces.component.UIComponent uiComponent)

processValidation

protected void processValidation(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UIComponent uiComponent,
                                 Object convertedObject)
Description copied from class: AbstractValidationInterceptor
A concrete implementation has to perform the actual validation of the value.

Specified by:
processValidation in class AbstractValidationInterceptor
Parameters:
facesContext - The JSF Context
uiComponent - The UIComponent which is processed.
convertedObject - The (adjusted) converted value.

getComponentMetaDataExtractor

protected MetaDataExtractor getComponentMetaDataExtractor(Map<String,Object> properties)
Description copied from class: AbstractValidationInterceptor
Implementations must return the MetaDataExtractor that will perform the extraction of the meta data from the component. The component itself is present in the properties map (it might influence the type of the returned MetaDataExtractor.

Specified by:
getComponentMetaDataExtractor in class AbstractValidationInterceptor
Parameters:
properties - Properties that can be used to determine the extractor which is returned.
Returns:
The MetaDataExtractor used for performing the xtraction of the meta data from the component.

processFieldValidation

protected void processFieldValidation(javax.faces.context.FacesContext facesContext,
                                      javax.faces.component.UIComponent uiComponent,
                                      Object convertedObject,
                                      PropertyInformation propertyInformation)

isValidationStrategyCompatibleWithValue

protected boolean isValidationStrategyCompatibleWithValue(ValidationStrategy validationStrategy,
                                                          Object value,
                                                          MetaDataEntry entry)

interpretEmptyStringValuesAsNull

protected boolean interpretEmptyStringValuesAsNull()
Description copied from class: AbstractValidationInterceptor
Uses a config parameter (javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL) which was introduced by JSF 2 for converting empty strings to null.

Overrides:
interpretEmptyStringValuesAsNull in class AbstractValidationInterceptor
Returns:
true if an empty string should be replaced with null (for the validation process), false otherwise

recordProcessedInformation

protected boolean recordProcessedInformation()
Description copied from class: AbstractValidationInterceptor
Signals if the converted value should be stored e.g. for the cross-validation process.

Overrides:
recordProcessedInformation in class AbstractValidationInterceptor
Returns:
true if the converted value should be recorded, false otherwise


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