org.jscience.sociology.forms.util
Class SimpleGroup

java.lang.Object
  extended by org.jscience.sociology.forms.util.SimpleGroup
All Implemented Interfaces:
java.io.Serializable, GroupValidator

public class SimpleGroup
extends java.lang.Object
implements GroupValidator

This class is a typical implementation of GroupValidator interface. The criteria of validation here is : fields that belong to this group are not required, but in case the user fills even one of them, then they all become required.

See Also:
GroupValidator, Serialized Form

Constructor Summary
SimpleGroup()
           
 
Method Summary
 java.util.Hashtable getErrorMessages(java.util.Hashtable nameValuePairs)
          Implements the same method of GroupValidator interface.
 void setGroupErrorMessage(java.lang.String groupErrorMessage)
          Implements the same method of GroupValidator interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGroup

public SimpleGroup()
Method Detail

setGroupErrorMessage

public void setGroupErrorMessage(java.lang.String groupErrorMessage)
Implements the same method of GroupValidator interface. The default value of groupErrorMessage is : "(this field has become required)".

Specified by:
setGroupErrorMessage in interface GroupValidator
Parameters:
groupErrorMessage - an error message for all fields of this group.

getErrorMessages

public java.util.Hashtable getErrorMessages(java.util.Hashtable nameValuePairs)
Implements the same method of GroupValidator interface.

Specified by:
getErrorMessages in interface GroupValidator
Parameters:
nameValuePairs - name-value pairs to be tested.
Returns:
a Hashtable of name-errormessage pairs.