net.sf.oval.constraint
Class DigitsCheck

java.lang.Object
  extended by net.sf.oval.AbstractCheck
      extended by net.sf.oval.configuration.annotation.AbstractAnnotationCheck<Digits>
          extended by net.sf.oval.constraint.DigitsCheck
All Implemented Interfaces:
Serializable, Check, AnnotationCheck<Digits>

public class DigitsCheck
extends AbstractAnnotationCheck<Digits>

Author:
Sebastian Thomschke
See Also:
Serialized Form

Constructor Summary
DigitsCheck()
           
 
Method Summary
 void configure(Digits constraintAnnotation)
          Configures the check based on the given constraint annotation.
protected  Map<String,String> createMessageVariables()
          
protected  ConstraintTarget[] getAppliesToDefault()
          
 int getMaxFraction()
           
 int getMaxInteger()
           
 int getMinFraction()
           
 int getMinInteger()
           
 boolean isSatisfied(Object validatedObject, Object valueToValidate, OValContext context, Validator validator)
          This method implements the validation logic
 void setMaxFraction(int maxFraction)
           
 void setMaxInteger(int maxInteger)
           
 void setMinFraction(int minFraction)
           
 void setMinInteger(int minInteger)
           
 
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
 

Constructor Detail

DigitsCheck

public DigitsCheck()
Method Detail

configure

public void configure(Digits constraintAnnotation)
Configures the check based on the given constraint annotation.

Specified by:
configure in interface AnnotationCheck<Digits>
Overrides:
configure in class AbstractAnnotationCheck<Digits>
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.

getMaxFraction

public int getMaxFraction()
Returns:
the maxFraction

getMaxInteger

public int getMaxInteger()
Returns:
the maxInteger

getMinFraction

public int getMinFraction()
Returns:
the minFraction

getMinInteger

public int getMinInteger()
Returns:
the minInteger

isSatisfied

public boolean isSatisfied(Object validatedObject,
                           Object valueToValidate,
                           OValContext context,
                           Validator validator)
This method implements the validation logic

Parameters:
validatedObject - the object/bean to validate the value against, for static fields or methods this is the class
valueToValidate - the value to validate, may be null when validating pre conditions for static methods
context - 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

setMaxFraction

public void setMaxFraction(int maxFraction)
Parameters:
maxFraction - the maxFraction to set

setMaxInteger

public void setMaxInteger(int maxInteger)
Parameters:
maxInteger - the maxInteger to set

setMinFraction

public void setMinFraction(int minFraction)
Parameters:
minFraction - the minFraction to set

setMinInteger

public void setMinInteger(int minInteger)
Parameters:
minInteger - the minInteger to set


Copyright © 2005–2015 The OVal Development Team. All rights reserved.