net.sf.oval.constraint
Class CheckWithCheck
java.lang.Object
net.sf.oval.AbstractCheck
net.sf.oval.configuration.annotation.AbstractAnnotationCheck<CheckWith>
net.sf.oval.constraint.CheckWithCheck
- All Implemented Interfaces:
- Serializable, Check, AnnotationCheck<CheckWith>
public class CheckWithCheck
- extends AbstractAnnotationCheck<CheckWith>
- Author:
- Sebastian Thomschke
- See Also:
- Serialized Form
| Methods inherited from class net.sf.oval.AbstractCheck |
getAppliesTo, getAppliesToDefault, getContext, getErrorCode, getMessage, getMessageVariables, getProfiles, getSeverity, getTarget, getWhen, isActive, requireMessageVariablesRecreation, setAppliesTo, setContext, setErrorCode, setMessage, setProfiles, setSeverity, setTarget, setWhen |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.oval.Check |
getAppliesTo, getContext, getErrorCode, getMessage, getMessageVariables, getProfiles, getSeverity, getTarget, getWhen, isActive, setAppliesTo, setContext, setErrorCode, setMessage, setProfiles, setSeverity, setTarget, setWhen |
CheckWithCheck
public CheckWithCheck()
configure
public void configure(CheckWith constraintAnnotation)
- Configures the check based on the given constraint annotation.
- Specified by:
configure in interface AnnotationCheck<CheckWith>- Overrides:
configure in class AbstractAnnotationCheck<CheckWith>
- Parameters:
constraintAnnotation - the constraint annotation to use for configuration
createMessageVariables
public Map<String,? extends Serializable> createMessageVariables()
-
- Overrides:
createMessageVariables in class AbstractCheck
getSimpleCheck
public CheckWithCheck.SimpleCheck getSimpleCheck()
- Returns:
- the simpleCheck
isIgnoreIfNull
public boolean isIgnoreIfNull()
- Returns:
- the ignoreIfNull
isSatisfied
public boolean isSatisfied(Object validatedObject,
Object valueToValidate,
OValContext context,
Validator validator)
throws ReflectionException
- This method implements the validation logic
- Parameters:
validatedObject - the object/bean to validate the value against, for static fields or methods this is the classvalueToValidate - the value to validate, may be null when validating pre conditions for static methodscontext - the validation context (e.g. a field, a constructor parameter or a method parameter)validator - the calling validator
- Returns:
- true if the value satisfies the checked constraint
- Throws:
ReflectionException
setIgnoreIfNull
public void setIgnoreIfNull(boolean ignoreIfNull)
- Parameters:
ignoreIfNull - the ignoreIfNull to set
setSimpleCheck
public void setSimpleCheck(Class<? extends CheckWithCheck.SimpleCheck> simpleCheckType)
throws ReflectionException,
IllegalArgumentException
- Parameters:
simpleCheckType - the simpleCheckType to set
- Throws:
IllegalArgumentException - if simpleCheckType == null
ReflectionException
setSimpleCheck
public void setSimpleCheck(CheckWithCheck.SimpleCheck simpleCheck)
throws IllegalArgumentException
- Parameters:
simpleCheck - the simpleCheck to set
- Throws:
IllegalArgumentException - if simpleCheck == null
Copyright © 2005–2013 The OVal Development Team. All rights reserved.