public void addValidationWarning( ValidationMessage message ) { getValidationWarnings().add( message ); }
public void addValidationWarning(ValidationMessage message) { getValidationWarnings().add(message); }
@Override public String getMessage() { StringWriter sw = new StringWriter(); sw.append(super.getMessage()); if (getValidationResponse() != null) { if (getValidationResponse().getValidationErrors().size() > 0) { sw.append("\nValidation errors follows:\n"); for (ValidationMessage error : getValidationResponse().getValidationErrors()) { sw.append(error.toString()); } sw.append("\n"); } if (getValidationResponse().getValidationWarnings().size() > 0) { sw.append("\nValidation warnings follows:\n"); for (ValidationMessage warning : getValidationResponse().getValidationWarnings()) { sw.append(warning.toString()); } sw.append("\n"); } } return sw.toString(); }
protected ValidationResponse mergeValidationResponse(ValidationResponse source, ValidationResponse dest) { for (ValidationMessage message : source.getValidationErrors()) { dest.addValidationError(message); } for (ValidationMessage message : source.getValidationWarnings()) { dest.addValidationError(message); } return dest; } }
public String getMessage() { StringWriter sw = new StringWriter(); sw.append( super.getMessage() ); if ( getValidationResponse() != null ) { if ( getValidationResponse().getValidationErrors().size() > 0 ) { sw.append( "\nValidation errors follows:\n" ); for ( ValidationMessage error : getValidationResponse().getValidationErrors() ) { sw.append( error.toString() ); } sw.append( "\n" ); } if ( getValidationResponse().getValidationWarnings().size() > 0 ) { sw.append( "\nValidation warnings follows:\n" ); for ( ValidationMessage warning : getValidationResponse().getValidationWarnings() ) { sw.append( warning.toString() ); } sw.append( "\n" ); } } return sw.toString(); }
protected ValidationResponse mergeValidationResponse(ValidationResponse source, ValidationResponse dest) { for ( ValidationMessage message : source.getValidationErrors() ) { dest.addValidationError( message ); } for ( ValidationMessage message : source.getValidationWarnings() ) { dest.addValidationError( message ); } return dest; } }
/** * A method to append a validation response to this validation response. The errors list and warnings list are * simply appended, and the isValid is logically AND-ed and isModified is logically OR-ed. */ public void append(ValidationResponse response) { for (ValidationMessage msg : response.getValidationErrors()) { if (getValidationError(msg.getKey()) != null) { msg.setKey(msg.getKey() + "(" + key++ + ")"); } addValidationError(msg); } for (ValidationMessage msg : response.getValidationWarnings()) { if (getValidationWarning(msg.getKey()) != null) { msg.setKey(msg.getKey() + "(" + key++ + ")"); } addValidationWarning(msg); } setValid(isValid() && response.isValid()); setModified(isModified() || response.isModified()); }
/** * A method to append a validation response to this validation response. The errors list and warnings list are * simply appended, and the isValid is logically AND-ed and isModified is logically OR-ed. * * @param response */ public void append( ValidationResponse response ) { for ( ValidationMessage msg : response.getValidationErrors() ) { if ( getValidationError( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationError( msg ); } for ( ValidationMessage msg : response.getValidationWarnings() ) { if ( getValidationWarning( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationWarning( msg ); } setValid( isValid() && response.isValid() ); setModified( isModified() || response.isModified() ); }