|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface NotEmptyChecks if given getXXX method returns an empty String. Specify on getXXX method. Can be specified on method returning String or StringBuffer. Empty string is a String that is trimmed first (if set on the annotation), and then returns "" (thus length 0) or simply is NULL.
Validation error if the method checked returns an empty string.
Note: If the method returns NULL this is considered as empty too! You can use this annotation as a replacement for NotNull in cases such as Java Server Faces which often binds empty values to a variable (even if the user did not enter anything).
| Optional Element Summary | |
|---|---|
java.lang.String[] |
applyToGroups
Specify for which groups this annotation must be applied. |
java.lang.String |
customCode
Optional custom code (property from a properties file). |
boolean |
globalMessage
If this annotation's message must be added as global message instead of real validation path. |
boolean |
trim
Trim the String first, then check for non-empty. |
public abstract java.lang.String[] applyToGroups
Defaults to JvGroup.GROUP_APPLY_ALL
public abstract boolean trim
Defaults to true.
public abstract java.lang.String customCode
This way you can override the default message if needed.
public abstract boolean globalMessage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||