jodd.vtor.constraint
Class MaxLengthConstraint

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

public class MaxLengthConstraint
extends java.lang.Object
implements ValidationConstraint<MaxLength>


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

Field Detail

max

protected int max
Constructor Detail

MaxLengthConstraint

public MaxLengthConstraint()

MaxLengthConstraint

public MaxLengthConstraint(int max)
Method Detail

getMax

public int getMax()

setMax

public void setMax(int max)

configure

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

Specified by:
configure in interface ValidationConstraint<MaxLength>

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<MaxLength>
Returns:
true if validation passes, otherwise false.

validate

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


Copyright © 2003-2010 Jodd Team