| java.lang.Object org.zkoss.zul.SimpleConstraint
All known Subclasses: org.zkoss.zul.SimpleDateConstraint,
Field Summary | |
final public static int | NO_EMPTY Empty is not allowed. | final public static int | NO_FUTURE Date in the future is not allowed. | final public static int | NO_NEGATIVE Negative numbers are not allowed. | final public static int | NO_PAST Date in the past is not allowed. | final public static int | NO_POSITIVE Postive numbers are not allowed. | final public static int | NO_TODAY Today is not allowed. | final public static int | NO_ZERO Zero numbers are not allowed. | final public static int | STRICT The value must match inside the data from ListModel only. | protected int | _flags The constraints. |
Constructor Summary | |
public | SimpleConstraint(int flags) Constructs a constraint with flags. | public | SimpleConstraint(int flags, String errmsg) Constructs a constraint with flags and an error message.
Parameters: flags - a combination of SimpleConstraint.NO_POSITIVE, SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on. Parameters: errmsg - the error message to display. | public | SimpleConstraint(String regex, String errmsg) Constructs a regular-expression constraint.
Parameters: regex - ignored if null or empty Parameters: errmsg - the error message to display. | public | SimpleConstraint(int flags, String regex, String errmsg) Constructs a constraint combining regular expression.
Parameters: flags - a combination of SimpleConstraint.NO_POSITIVE, SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on. Parameters: regex - ignored if null or empty Parameters: errmsg - the error message to display. | public | SimpleConstraint(String constraint) Constructs a constraint with a list of constraints separated by comma. |
NO_EMPTY | final public static int NO_EMPTY(Code) | | Empty is not allowed.
If not specified, empty usually means null.
|
NO_FUTURE | final public static int NO_FUTURE(Code) | | Date in the future is not allowed. (Only date part is compared)
|
NO_NEGATIVE | final public static int NO_NEGATIVE(Code) | | Negative numbers are not allowed.
|
NO_PAST | final public static int NO_PAST(Code) | | Date in the past is not allowed. (Only date part is compared)
|
NO_POSITIVE | final public static int NO_POSITIVE(Code) | | Postive numbers are not allowed.
|
NO_TODAY | final public static int NO_TODAY(Code) | | Today is not allowed. (Only date part is compared)
|
NO_ZERO | final public static int NO_ZERO(Code) | | Zero numbers are not allowed.
|
STRICT | final public static int STRICT(Code) | | The value must match inside the data from ListModel only.
|
SimpleConstraint | public SimpleConstraint(String regex, String errmsg)(Code) | | Constructs a regular-expression constraint.
Parameters: regex - ignored if null or empty Parameters: errmsg - the error message to display. Ignored if null or empty. |
SimpleConstraint | public SimpleConstraint(String constraint)(Code) | | Constructs a constraint with a list of constraints separated by comma.
Parameters: constraint - a list of constraints separated by comma.Example: no positive, no zero since: 3.0.2 |
getClientValidation | public String getClientValidation()(Code) | | |
getInstance | final public static SimpleConstraint getInstance(String constraint)(Code) | | Parses a list of constraints from a string to an integer
representing a combination of
SimpleConstraint.NO_POSITIVE and other flags.
Parameters: constraint - a list of constraints separated by comma.Example: no positive, no zero |
isClientComplete | public boolean isClientComplete()(Code) | | |
parseConstraint | protected int parseConstraint(String constraint) throws UiException(Code) | | Parses a constraint into an integer value.
For example, "no positive" is parsed to
SimpleConstraint.NO_POSITIVE .
Deriving classes might override this to provide more constraints.
since: 3.0.2 |
|
|