com.kbmj.svt.rules
Class Required

java.lang.Object
  |
  +--com.kbmj.svt.Rule
        |
        +--com.kbmj.svt.rules.Required
All Implemented Interfaces:
java.io.Serializable

public class Required
extends Rule

Field is required. The value must be a String or an array of any Object. With String, validation will fail when it is null or empty. With Object[], validation will fail when the length is zero. With any other Object, validation will fail when it is null.

Author:
Shinya Kasatani
See Also:
Serialized Form

Field Summary
static java.lang.String ERROR_KEY
           
 
Constructor Summary
Required()
           
 
Method Summary
 InputErrors validate(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_KEY

public static java.lang.String ERROR_KEY
Constructor Detail

Required

public Required()
Method Detail

validate

public InputErrors validate(java.lang.Object value)
Specified by:
validate in class Rule