org.apache.myfaces.extensions.validator.crossval.strategy
Class AbstractCompareStrategy<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
              extended by org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCompareStrategy<A>
All Implemented Interfaces:
ValidationStrategy, CrossValidationStrategy
Direct Known Subclasses:
DateIsStrategy, EmptyIfStrategy, EqualsStrategy, RequiredIfStrategy

public abstract class AbstractCompareStrategy<A extends Annotation>
extends AbstractCrossValidationStrategy

Since:
1.x.1

Field Summary
protected static List<org.apache.myfaces.extensions.validator.crossval.strategy.ReferencingStrategy> referencingStrategies
           
protected  Map<Object,Object> violationResultStorage
           
 
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
AbstractCompareStrategy()
           
 
Method Summary
protected  String getErrorMessageDetail(A annotation, boolean isTargetComponent)
           
protected  String getErrorMessageSummary(A annotation, boolean isTargetComponent)
           
protected abstract  MessageTarget getMessageTarget(A annotation)
           
protected  String getReverseErrorMessageDetail(A annotation)
           
protected  String getReverseErrorMessageSummary(A annotation)
           
protected  javax.faces.application.FacesMessage getSourceComponentErrorMessage(A annotation, String summary, String detail)
           
protected  javax.faces.application.FacesMessage getTargetComponentErrorMessage(A foundAnnotation, String summary, String detail)
           
protected abstract  String getValidationErrorMsgKey(A annotation, boolean isTargetComponent)
           
protected  String getValidationErrorMsgKey(Annotation annotation)
          Returns the key for the message that needs to be resolved for the violation-message.
abstract  String[] getValidationTargets(A annotation)
           
protected  boolean handleSourceViolation(CrossValidationStorageEntry entryOfSource)
          Deprecated. 
protected  boolean handleTargetViolation(CrossValidationStorageEntry entryOfSource, CrossValidationStorageEntry entryOfTarget)
           
protected  void initReferencingStrategies()
           
abstract  boolean isViolation(Object object1, Object object2, A annotation)
           
 void processCrossValidation(CrossValidationStorageEntry crossValidationStorageEntry, CrossValidationStorage crossValidationStorage)
           
protected  void processSourceComponentAfterViolation(CrossValidationStorageEntry entryOfSource)
           
protected  void processTargetComponentAfterViolation(CrossValidationStorageEntry entryOfSource, CrossValidationStorageEntry entryOfTarget)
           
protected  boolean useSourceComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)
           
protected  boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)
           
 
Methods inherited from class org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCrossValidationStrategy
getCrossValidationStorageEntry, getLabel, initCrossValidation, initValidation, processAfterCrossValidatorException, processAfterValidatorException, processValidation
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy
getErrorMessageDetail, getErrorMessageSummary, getValidationErrorFacesMessage, 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.core.validation.strategy.ValidationStrategy
validate
 

Field Detail

referencingStrategies

protected static List<org.apache.myfaces.extensions.validator.crossval.strategy.ReferencingStrategy> referencingStrategies

violationResultStorage

protected Map<Object,Object> violationResultStorage
Constructor Detail

AbstractCompareStrategy

public AbstractCompareStrategy()
Method Detail

initReferencingStrategies

protected void initReferencingStrategies()

processCrossValidation

public void processCrossValidation(CrossValidationStorageEntry crossValidationStorageEntry,
                                   CrossValidationStorage crossValidationStorage)
                            throws javax.faces.validator.ValidatorException
Throws:
javax.faces.validator.ValidatorException

processTargetComponentAfterViolation

protected final void processTargetComponentAfterViolation(CrossValidationStorageEntry entryOfSource,
                                                          CrossValidationStorageEntry entryOfTarget)

processSourceComponentAfterViolation

protected final void processSourceComponentAfterViolation(CrossValidationStorageEntry entryOfSource)

getSourceComponentErrorMessage

protected javax.faces.application.FacesMessage getSourceComponentErrorMessage(A annotation,
                                                                              String summary,
                                                                              String detail)

getTargetComponentErrorMessage

protected javax.faces.application.FacesMessage getTargetComponentErrorMessage(A foundAnnotation,
                                                                              String summary,
                                                                              String detail)

getErrorMessageSummary

protected String getErrorMessageSummary(A annotation,
                                        boolean isTargetComponent)

getErrorMessageDetail

protected String getErrorMessageDetail(A annotation,
                                       boolean isTargetComponent)

getValidationErrorMsgKey

protected final String getValidationErrorMsgKey(Annotation annotation)
Description copied from class: AbstractAnnotationValidationStrategy
Returns the key for the message that needs to be resolved for the violation-message.

Specified by:
getValidationErrorMsgKey in class AbstractAnnotationValidationStrategy
Parameters:
annotation - The annotation associated with the ValidationStrategy.
Returns:
The key of the error message.

handleTargetViolation

protected boolean handleTargetViolation(CrossValidationStorageEntry entryOfSource,
                                        CrossValidationStorageEntry entryOfTarget)

handleSourceViolation

@Deprecated
protected boolean handleSourceViolation(CrossValidationStorageEntry entryOfSource)
Deprecated. 


useSourceComponentToDisplayErrorMsg

protected boolean useSourceComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)

useTargetComponentToDisplayErrorMsg

protected boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)

getMessageTarget

protected abstract MessageTarget getMessageTarget(A annotation)

getReverseErrorMessageSummary

protected String getReverseErrorMessageSummary(A annotation)

getReverseErrorMessageDetail

protected String getReverseErrorMessageDetail(A annotation)

getValidationErrorMsgKey

protected abstract String getValidationErrorMsgKey(A annotation,
                                                   boolean isTargetComponent)

isViolation

public abstract boolean isViolation(Object object1,
                                    Object object2,
                                    A annotation)

getValidationTargets

public abstract String[] getValidationTargets(A annotation)


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