jodd.vtor.constraint
Class LengthConstraint

java.lang.Object
  extended by jodd.vtor.constraint.LengthConstraint
All Implemented Interfaces:
ValidationConstraint<Length>

public class LengthConstraint
extends java.lang.Object
implements ValidationConstraint<Length>


Field Summary
protected  int max
           
protected  int min
           
 
Constructor Summary
LengthConstraint()
           
LengthConstraint(int min, int max)
           
 
Method Summary
 void configure(Length annotation)
          Configures constraint from associated annotation.
 int getMax()
           
 int getMin()
           
 boolean isValid(ValidationConstraintContext vcc, java.lang.Object value)
          Performs validation in context of target object on provided value.
 void setMax(int max)
           
 void setMin(int min)
           
static boolean validate(java.lang.Object value, int min, int max)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

min

protected int min

max

protected int max
Constructor Detail

LengthConstraint

public LengthConstraint()

LengthConstraint

public LengthConstraint(int min,
                        int max)
Method Detail

getMin

public int getMin()

setMin

public void setMin(int min)

getMax

public int getMax()

setMax

public void setMax(int max)

configure

public void configure(Length annotation)
Description copied from interface: ValidationConstraint
Configures constraint from associated annotation.

Specified by:
configure in interface ValidationConstraint<Length>

isValid

public boolean isValid(ValidationConstraintContext vcc,
                       java.lang.Object value)
Description copied from interface: ValidationConstraint
Performs validation in context of target object on provided value.

Specified by:
isValid in interface ValidationConstraint<Length>
Returns:
true if validation passes, otherwise false.

validate

public static boolean validate(java.lang.Object value,
                               int min,
                               int max)


Copyright © 2003-2010 Jodd Team