Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.profiles.validator
Class LengthValidator

java.lang.Object
  extended by com.jivesoftware.profiles.validator.LengthValidator
All Implemented Interfaces:
ProfileFieldValidator, Cacheable, java.io.Serializable

public class LengthValidator
extends java.lang.Object
implements ProfileFieldValidator, Cacheable

A validator which validates the size of a profile field value.

See Also:
Serialized Form

Constructor Summary
LengthValidator()
           
 
Method Summary
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 int getMaxLength()
           
 int getMinLength()
           
 void setMaxLength(int maxLength)
           
 void setMinLength(int minLength)
           
 java.lang.String validate(java.lang.String value, User user)
          Performs field validation on user supplied input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthValidator

public LengthValidator()
Method Detail

validate

public java.lang.String validate(java.lang.String value,
                                 User user)
Description copied from interface: ProfileFieldValidator
Performs field validation on user supplied input. Returns null if validation succeeds or an error string if validation fails.

Specified by:
validate in interface ProfileFieldValidator
Parameters:
value - the user supplied value. If no value has been provided by the user then the value should be null.
user - the user supplying the value, or null if anonymous.
Returns:
null if validation succeeds or an error string if validation fails.

getMinLength

public int getMinLength()

setMinLength

public void setMinLength(int minLength)

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.