|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopoint.validation.SimpleRuleSet
public class SimpleRuleSet
SimpleRuleSet is an base
class that can be used as the basis of other ValidationRuleSet
classes. Initially it contains no rules and returns
ValidationRuleSet.RULE_ON_DEFAULT during getRunOptions().
| Field Summary |
|---|
| Fields inherited from interface echopoint.validation.ValidationRuleSet |
|---|
RULE_ON_BLUR_RUN_AGGRESSIVE, RULE_ON_BLUR_RUN_ALL, RULE_ON_DEFAULT, RULE_ON_SUBMIT_RUN_ALL |
| Constructor Summary | |
|---|---|
SimpleRuleSet()
Constructs a SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the no rules in place. |
|
SimpleRuleSet(int runOptions)
Constructs a SimpleRuleSet with the runOptions
and no rules in place |
|
SimpleRuleSet(int runOptions,
ValidationRule rule)
Constructs a SimpleRuleSet with the specified runOptions
and the specified ValidationRule. |
|
SimpleRuleSet(int runOptions,
ValidationRule[] rules)
|
|
SimpleRuleSet(int runOptions,
ValidationRule[] rules,
java.lang.String fieldName)
Constructs a SimpleRuleSet with the specified runOptions
and the array of ValidationRules and the specified field name. |
|
SimpleRuleSet(java.lang.String fieldName)
Constructs a SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the no rules in place
and the specified field name. |
|
SimpleRuleSet(ValidationRule rule)
Constructs a SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the
specified ValidationRule. |
|
SimpleRuleSet(ValidationRule[] rules)
Constructs a SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the
specified array of ValidationRules. |
|
| Method Summary | |
|---|---|
void |
add(int index,
ValidationRule rule)
Adds a rule to the rule set at the specified index |
void |
add(ValidationRule rule)
Adds a rule to the end of the ruleset |
ClientAddressable |
getClientResultDisplay()
This returns a component that implements ClientAddressable and can therefore by used to display the result of a client side validation. |
java.lang.String |
getName(Validateable validateable)
If a field name was provided on the constructor or via the setName() method, then it will be sued as the field name. |
ValidationRule[] |
getRules()
Returns an array of ValidationRules fro this ValidationRuleSet. |
int |
getRunOptions()
Returns ValidationRuleSet.RULE_ON_DEFAULT as the default. |
java.util.Iterator |
iterator()
Returns an iterator that can iterate over the rules in the ruleset |
void |
remove(int index)
Removes the rule at the specified index |
void |
remove(ValidationRule rule)
Removes the specified rule |
void |
setClientResultDisplay(ClientAddressable clientResultDisplay)
Sets the clientResultDisplay to use or null if its not needed. |
void |
setName(java.lang.String fieldName)
Sets the name to be returned in the getName() method. |
void |
setRunOptions(int newRunOptions)
Sets the new run optons for this ruleset |
int |
size()
Returns the number of rules in the ruleset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleRuleSet()
SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the no rules in place.
public SimpleRuleSet(java.lang.String fieldName)
SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the no rules in place
and the specified field name.
fieldName - - the name of the fieldpublic SimpleRuleSet(int runOptions)
SimpleRuleSet with the runOptions
and no rules in place
runOptions - - the run options to usepublic SimpleRuleSet(ValidationRule rule)
SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the
specified ValidationRule.
rule - - the ValidationRule to usepublic SimpleRuleSet(ValidationRule[] rules)
SimpleRuleSet with runOptions
as ValidationRuleSet.RULE_ON_DEFAULT and the
specified array of ValidationRules.
rules - - the ValidationRules to use
public SimpleRuleSet(int runOptions,
ValidationRule rule)
SimpleRuleSet with the specified runOptions
and the specified ValidationRule.
runOptions - - the run options to userule - - the ValidationRule to use
public SimpleRuleSet(int runOptions,
ValidationRule[] rules)
public SimpleRuleSet(int runOptions,
ValidationRule[] rules,
java.lang.String fieldName)
SimpleRuleSet with the specified runOptions
and the array of ValidationRules and the specified field name.
runOptions - - the run options to userules - - the ValidationRules to usefieldName - - if this is non null, then it will be used as the rule set name| Method Detail |
|---|
public java.util.Iterator iterator()
ValidationMutableRuleSet
iterator in interface ValidationMutableRuleSetValidationMutableRuleSet.iterator()public int size()
ValidationMutableRuleSet
size in interface ValidationMutableRuleSetValidationMutableRuleSet.size()public void add(ValidationRule rule)
ValidationMutableRuleSet
add in interface ValidationMutableRuleSetrule - - the new rule to be addedValidationMutableRuleSet.add(echopoint.validation.ValidationRule)
public void add(int index,
ValidationRule rule)
ValidationMutableRuleSet
add in interface ValidationMutableRuleSetindex - - the index to add the rule atrule - - the new ValidationRuleValidationMutableRuleSet.add(int, echopoint.validation.ValidationRule)public void remove(ValidationRule rule)
ValidationMutableRuleSet
remove in interface ValidationMutableRuleSetrule - - the rule to rmeoveValidationMutableRuleSet.remove(echopoint.validation.ValidationRule)public void remove(int index)
ValidationMutableRuleSet
remove in interface ValidationMutableRuleSetindex - - the index of the rule to be removedValidationMutableRuleSet.remove(int)public int getRunOptions()
getRunOptions in interface ValidationRuleSetValidationRuleSet.getRunOptions()public void setRunOptions(int newRunOptions)
newRunOptions - public ValidationRule[] getRules()
ValidationRuleSet
getRules in interface ValidationRuleSetValidationRuleSet.getRules()public java.lang.String getName(Validateable validateable)
Otherwise the Validateable's getIdentifier() will be used to look for the attribute named "validationName". For example "type=1; validationName=suburb" would return a field name of 'suburb'.
If this is not available, a name will be generates in the form "field"XXXX where XXX is an unique id
getName in interface ValidationRuleSetValidationRuleSet.getName(Validateable),
IdKit.getAttribute(Object, String)public void setName(java.lang.String fieldName)
fieldName - - the new field namegetName(Validateable)public ClientAddressable getClientResultDisplay()
ValidationRuleSet
getClientResultDisplay in interface ValidationRuleSetValidationRuleSet.getClientResultDisplay()public void setClientResultDisplay(ClientAddressable clientResultDisplay)
clientResultDisplay - the clientResultDisplay to use.ValidationRuleSet.getClientResultDisplay()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||