|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.rule.OptionsRule
public class OptionsRule
A rule to validate number of options. (derived from IntegerRule) You can also specify min and max values.
| Constructor Summary | |
|---|---|
OptionsRule(int min)
Creates a IntegerRule with a min value. |
|
OptionsRule(int min,
int max)
Creates a IntegerRule with a min and max values. |
|
| Method Summary | |
|---|---|
boolean |
check(String field,
Action action)
Check and validate the given field from the give action. |
static OptionsRule |
getInstance(int min)
|
static OptionsRule |
getInstance(int min,
int max)
|
Map<String,String> |
getTokens()
Returns a map with tokens that can be used in the error messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OptionsRule(int min)
min - The minimum value for the integer.
public OptionsRule(int min,
int max)
min - The minium value for the integer.max - The maximum value for the integer.| Method Detail |
|---|
public static OptionsRule getInstance(int min)
public static OptionsRule getInstance(int min,
int max)
public Map<String,String> getTokens()
Rule
getTokens in interface Rule
public boolean check(String field,
Action action)
Rule
check in interface Rulefield - The field to validate.action - The action from where to get the field.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||