org.apache.myfaces.extensions.validator.crossval.strategy
Class RequiredIfStrategy

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<RequiredIf>
                  extended by org.apache.myfaces.extensions.validator.crossval.strategy.RequiredIfStrategy
All Implemented Interfaces:
ValidationStrategy, CrossValidationStrategy

@SkipValidationSupport
@NullValueAwareValidationStrategy
@EmptyValueAwareValidationStrategy
public class RequiredIfStrategy
extends AbstractCompareStrategy<RequiredIf>

Since:
1.x.1

Field Summary
 
Fields inherited from class org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCompareStrategy
referencingStrategies, 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
RequiredIfStrategy()
           
 
Method Summary
protected  MessageTarget getMessageTarget(RequiredIf annotation)
           
protected  String getValidationErrorMsgKey(RequiredIf annotation, boolean isTargetComponent)
           
 String[] getValidationTargets(RequiredIf annotation)
           
 boolean isViolation(Object source, Object target, RequiredIf annotation)
           
protected  boolean processAfterCrossValidatorException(CrossValidationStorageEntry crossValidationStorageEntry, javax.faces.validator.ValidatorException validatorException)
           
protected  String resolveMessage(String key)
          Uses the given message key to resolve the actual message in the correct language.
 
Methods inherited from class org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCompareStrategy
getErrorMessageDetail, getErrorMessageSummary, getReverseErrorMessageDetail, getReverseErrorMessageSummary, getSourceComponentErrorMessage, getTargetComponentErrorMessage, getValidationErrorMsgKey, handleSourceViolation, handleTargetViolation, initReferencingStrategies, processCrossValidation, processSourceComponentAfterViolation, processTargetComponentAfterViolation, useSourceComponentToDisplayErrorMsg, useTargetComponentToDisplayErrorMsg
 
Methods inherited from class org.apache.myfaces.extensions.validator.crossval.strategy.AbstractCrossValidationStrategy
getCrossValidationStorageEntry, getLabel, initCrossValidation, initValidation, processAfterValidatorException, processValidation
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy
getErrorMessageDetail, getErrorMessageSummary, getValidationErrorFacesMessage, 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
 

Constructor Detail

RequiredIfStrategy

public RequiredIfStrategy()
Method Detail

getMessageTarget

protected MessageTarget getMessageTarget(RequiredIf annotation)
Specified by:
getMessageTarget in class AbstractCompareStrategy<RequiredIf>

resolveMessage

protected String resolveMessage(String key)
Description copied from class: AbstractAnnotationValidationStrategy
Uses the given message key to resolve the actual message in the correct language. The current UIViewRoot provides the target locale. When a MessageResolver is available, it is used to resolve the message. Otherwise the default rules are taken to define the MessageResolver. ExtValUtils.getMessageResolverForValidationStrategy( org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy)

Overrides:
resolveMessage in class AbstractAnnotationValidationStrategy
Parameters:
key - key of the error message that needs to be resolved.
Returns:
Resolved message.

getValidationErrorMsgKey

protected String getValidationErrorMsgKey(RequiredIf annotation,
                                          boolean isTargetComponent)
Specified by:
getValidationErrorMsgKey in class AbstractCompareStrategy<RequiredIf>

isViolation

public boolean isViolation(Object source,
                           Object target,
                           RequiredIf annotation)
Specified by:
isViolation in class AbstractCompareStrategy<RequiredIf>

getValidationTargets

public String[] getValidationTargets(RequiredIf annotation)
Specified by:
getValidationTargets in class AbstractCompareStrategy<RequiredIf>

processAfterCrossValidatorException

protected boolean processAfterCrossValidatorException(CrossValidationStorageEntry crossValidationStorageEntry,
                                                      javax.faces.validator.ValidatorException validatorException)
Overrides:
processAfterCrossValidatorException in class AbstractCrossValidationStrategy


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