net.sf.oval.constraint
Class DateRangeCheck
java.lang.Object
net.sf.oval.AbstractCheck
net.sf.oval.configuration.annotation.AbstractAnnotationCheck<DateRange>
net.sf.oval.constraint.DateRangeCheck
- All Implemented Interfaces:
- Serializable, Check, AnnotationCheck<DateRange>
public class DateRangeCheck
- extends AbstractAnnotationCheck<DateRange>
- Author:
- Sebastian Thomschke
- See Also:
- Serialized Form
Methods inherited from class net.sf.oval.AbstractCheck |
getAppliesTo, 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 |
DateRangeCheck
public DateRangeCheck()
configure
public void configure(DateRange constraintAnnotation)
- Configures the check based on the given constraint annotation.
- Specified by:
configure
in interface AnnotationCheck<DateRange>
- Overrides:
configure
in class AbstractAnnotationCheck<DateRange>
- Parameters:
constraintAnnotation
- the constraint annotation to use for configuration
createMessageVariables
protected Map<String,String> createMessageVariables()
-
- Overrides:
createMessageVariables
in class AbstractCheck
getAppliesToDefault
protected ConstraintTarget[] getAppliesToDefault()
-
- Overrides:
getAppliesToDefault
in class AbstractCheck
- Returns:
- the default behavior when the constraint is validated for a array/map/collection reference.
getFormat
public String getFormat()
- Returns:
- the format
getMax
public String getMax()
- Returns:
- the max
getMin
public String getMin()
- Returns:
- the min
getTolerance
public long getTolerance()
- Returns:
- the tolerance
isSatisfied
public boolean isSatisfied(Object validatedObject,
Object valueToValidate,
OValContext context,
Validator validator)
- Description copied from interface:
Check
- 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
setFormat
public void setFormat(String format)
- Parameters:
format
- the format to set
setMax
public void setMax(String max)
- Parameters:
max
- the max to set
setMin
public void setMin(String min)
- Parameters:
min
- the min to set
setTolerance
public void setTolerance(long tolerance)
- Parameters:
tolerance
- the tolerance to set
Copyright © 2005-2013 The OVal Development Team. All Rights Reserved.