org.carrot2.util.attribute.constraint
Class ConstraintValidator

java.lang.Object
  extended by org.carrot2.util.attribute.constraint.ConstraintValidator

public class ConstraintValidator
extends Object

Checks whether values meet the provided constraints.


Constructor Summary
ConstraintValidator()
           
 
Method Summary
static Annotation[] isMet(Object value, Annotation... constraintAnnotations)
          Checks whether the value meets the constraints defined by the provided constraintAnnotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintValidator

public ConstraintValidator()
Method Detail

isMet

public static Annotation[] isMet(Object value,
                                 Annotation... constraintAnnotations)
Checks whether the value meets the constraints defined by the provided constraintAnnotations.

Parameters:
value - the value to be checked
constraintAnnotations - constraint annotations defining the constraints to be checked.
Returns:
an array of constraint annotations which the value does not meet. If all constraints are met, the returned array is empty.


Copyright (c) Dawid Weiss, Stanislaw Osinski