org.sovt.impl
Class LengthValidator

java.lang.Object
  extended byorg.sovt.impl.AbstractValidator
      extended byorg.sovt.impl.LengthValidator
All Implemented Interfaces:
java.lang.Cloneable, Validator

public final class LengthValidator
extends AbstractValidator
implements java.lang.Cloneable

This validator checks length of the string value. "toString()" method is invoked on the object first. "null" objects are skipped.

Author:
Vilmantas Baranauskas (vilmantas_baranauskas@yahoo.com)

Constructor Summary
LengthValidator()
          Creates instance of LengthValidator.
 
Method Summary
 java.lang.Object clone()
          Just returns super.clone().
 int getMax()
          Returns maximum length of value.
 int getMin()
          Returns minimum length of value.
 void setMax(int pMax)
          Sets maximum length of value.
 void setMin(int pMin)
          Sets minimumlength of value.
 void validate(java.lang.Object object, ValidationResult result)
          Validates if object string value is in specified range.
 
Methods inherited from class org.sovt.impl.AbstractValidator
getMessage, setMessage, setMsg
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthValidator

public LengthValidator()
Creates instance of LengthValidator.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Just returns super.clone(). There is no need to do a deep-cloning.

Specified by:
clone in interface Validator
Overrides:
clone in class AbstractValidator
Returns:
clone of itself.
Throws:
java.lang.CloneNotSupportedException

getMax

public int getMax()
Returns maximum length of value.

Returns:
maximum length of value.

getMin

public int getMin()
Returns minimum length of value.

Returns:
minimum length of value.

setMax

public void setMax(int pMax)
Sets maximum length of value.

Parameters:
pMax - maximum length of value.

setMin

public void setMin(int pMin)
Sets minimumlength of value.

Parameters:
pMin - minimum length of value.

validate

public void validate(java.lang.Object object,
                     ValidationResult result)
Validates if object string value is in specified range.

Specified by:
validate in interface Validator
Parameters:
object - Object to validate
result - Container for validation results.


Copyright © 2003-2005 . All Rights Reserved.