EchoPoint
1.0

echopoint.validation
Interface ValidationRuleSet

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ValidationMutableRuleSet
All Known Implementing Classes:
SimpleRuleSet

public interface ValidationRuleSet
extends java.io.Serializable

ValidationRuleSet is a named set of ValidationRules.


Field Summary
static int RULE_ON_BLUR_RUN_AGGRESSIVE
          Used to indicate that onblur validation should run as often as possible when the user leaves a field, even if the field has not changed.
static int RULE_ON_BLUR_RUN_ALL
          Used to indicate that during a field blur event, all the rules in the set should be run, even if one of them fails.
static int RULE_ON_DEFAULT
          This is the default rule option, which stops at the first failure during field blur but runs all the rules during server submit.
static int RULE_ON_SUBMIT_RUN_ALL
          Used to indicate that during a server submit event, all the rules in the set should be run, even if one of them fails.
 
Method Summary
 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)
          This method is called to get a name for the given Validateable.
 ValidationRule[] getRules()
          Returns an array of ValidationRules fro this ValidationRuleSet.
 int getRunOptions()
          Returns the running options to use for this rule set.
 

Field Detail

RULE_ON_BLUR_RUN_ALL

public static final int RULE_ON_BLUR_RUN_ALL
Used to indicate that during a field blur event, all the rules in the set should be run, even if one of them fails. If this flag is NOT present, then the validation will stop at the first rule to fail.

See Also:
Constant Field Values

RULE_ON_SUBMIT_RUN_ALL

public static final int RULE_ON_SUBMIT_RUN_ALL
Used to indicate that during a server submit event, all the rules in the set should be run, even if one of them fails. If this flag is NOT present, then the validation will stop at the first rule to fail.

See Also:
Constant Field Values

RULE_ON_BLUR_RUN_AGGRESSIVE

public static final int RULE_ON_BLUR_RUN_AGGRESSIVE
Used to indicate that onblur validation should run as often as possible when the user leaves a field, even if the field has not changed.

See Also:
Constant Field Values

RULE_ON_DEFAULT

public static final int RULE_ON_DEFAULT
This is the default rule option, which stops at the first failure during field blur but runs all the rules during server submit.

See Also:
Constant Field Values
Method Detail

getRunOptions

public int getRunOptions()
Returns the running options to use for this rule set. They can be :

getRules

public ValidationRule[] getRules()
Returns an array of ValidationRules fro this ValidationRuleSet. The rules are run to see if this ValidationRuleSet is valid.

Returns:
an array of ValidationRules fro this ValidationRuleSet.

getName

public java.lang.String getName(Validateable validateable)
This method is called to get a name for the given Validateable.

This field name can then be referred to in the client side rules, via constructs such as "fieldHasValue('yourNameHere')".

It is suggested that the Validateable's getIdentifier() be used somehow to generated the name.

Parameters:
validateable -
Returns:
a String name based on validateable

getClientResultDisplay

public ClientAddressable getClientResultDisplay()
This returns a component that implements ClientAddressable and can therefore by used to display the result of a client side validation. If null is returned, then the default client side popup box will be shown

Returns:
a component that implements ClientAddressable

EchoPoint
1.0