/** * Factory method to create a simple error message * @param target message target * @param text message text * @return error message */ public static ValidationMessage error( Control target, String text ) { return new SimpleValidationMessage(target, text, Severity.ERROR); }
/** * Factory method to create a simple warning message * @param target message target * @param text message text * @return warning message */ public static ValidationMessage warning( Control target, String text ) { return new SimpleValidationMessage(target, text, Severity.WARNING); }
/** * Add one message to validation result with condition * @param target validation target * @param text message text * @param severity message severity * @param condition condition on which message will be added * @return updated validation result */ public ValidationResult addMessageIf( Control target, String text, Severity severity, boolean condition) { return condition? add( new SimpleValidationMessage(target, text, severity)): this; }