|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) @Documented public @interface Validate
Primary annotation used to specify validations for form fields. Allows quick and easy specification of the most common types of validation logic, as well as a way to specify custom validations.
Optional Element Summary | |
---|---|
Class<? extends TypeConverter> |
converter
A type converter to use to convert this field from String to it's rich object type. |
boolean |
encrypted
If true, then a parameter value to be bound to this field must be an encrypted string. |
String |
expression
Specifies an expression in the JSP expression language that should be evaluated to check the validity of this field. |
String |
field
The name of the field to validate. |
boolean |
ignore
If set to true will cause the property to be ignore by binding and validation even if it was somehow submitted in the request. |
String |
label
The natural language name to use for the field when reporting validation errors, generating form input labels, etc. |
String |
mask
Specifies a regular expression mask to be used to check the format of the String value submitted. |
int |
maxlength
Specifies a maximum length of characters that must be submitted. |
double |
maxvalue
Specifies the maximum numeric value acceptable for a numeric field. |
int |
minlength
Specifies a minimum length of characters that must be submitted. |
double |
minvalue
Specifies the minimum numeric value acceptable for a numeric field. |
String[] |
on
If required=true, restricts the set of events to which the required check is applied. |
boolean |
required
If set to true, requires that a non-null, non-empty value must be submitted for the field. |
boolean |
trim
Trim white space from the beginning and end of request parameter values before attempting validation, type conversion or binding. |
public abstract String field
public abstract boolean encrypted
InputHiddenTag
) that it is to be rendered as an encrypted string. This prevents
clients from injecting random values.
public abstract boolean required
public abstract boolean trim
String.trim()
public abstract String[] on
If required=true, restricts the set of events to which the required check is applied. If required=false (or omitted) this setting has no effect. This setting is entirely optional and if omitted then the field will simply be required for all events.
Can be specified as either a positive list (e.g. on={"save, "update"}) in which case the required check will be performed only on the listed events. Can also be specified as an inverted list (e.g. on="!new") in which case the check will be performed on all events that are not listed. Cannot contain a mix of "!event" and "event" since it does not make sense!
public abstract boolean ignore
public abstract int minlength
public abstract int maxlength
public abstract double minvalue
public abstract double maxvalue
public abstract String mask
public abstract String expression
Specifies an expression in the JSP expression language that should be evaluated to check the validity of this field. In the case of lists, arrays and maps the expression is evaluated once for each value supplied. The expression is evaluated only if a value is supplied - it will not be evaluated if the user did not supply a value for the field.
The value being validated is available in the EL variable 'this'. Properties of the ActionBean (including the context) can be referenced directly, as can values in request and session scope if necessary.
Note: it is not necessary to encapsulate the expression in ${} as on a JSP page.
public abstract Class<? extends TypeConverter> converter
public abstract String label
LocalizationUtility.getLocalizedFieldName(String, String, Class, java.util.Locale)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |