01: package org.jreform;
02:
03: /**
04: * A group of inputs within a form.
05: *
06: * @author armandino (at) gmail.com
07: */
08: public interface Group extends InputCollection {
09: /**
10: * Returns the name of this group.
11: */
12: public String getName();
13:
14: /**
15: * If <tt>required</tt> all inputs must satisfy imposed criteria for the
16: * group to be valid. If <tt>optional</tt> either all inputs must be null
17: * OR all inputs must satisfy their criteria for the group to be valid.
18: */
19: public boolean isRequired();
20:
21: /**
22: * Set whether this group is <tt>required</tt>.
23: */
24: public void setRequired(boolean isRequired);
25:
26: /**
27: * Checks if this group has input data.
28: * @return <code>true</code> if all inputs that belong to this group
29: * are blank, <code>false</code> otherwise.
30: */
31: public boolean isEmpty();
32:
33: /**
34: * Checks whether this group is valid.
35: */
36: public boolean isValid();
37:
38: }
|