/** * Checks and answers whether this validation result has messages or not. * * @return true if there are messages, false if not * * @see #getSeverity() * @see #hasErrors() * @see #hasWarnings() */ public boolean hasMessages() { return !isEmpty(); }
/** * Returns the concatenation of all validation results that are held * by this container. * * @return the concatenation of all validation results that are held * by this container * * @see #getCollapsedValidationResult() */ public ValidationResult getExpandedValidationResult() { ValidationResult concatenation = new ValidationResult(); for (ValidationResultModel resultModel : childResultModels) { concatenation.addAllFrom(resultModel.getResult()); } return concatenation; }
/** * Returns the validation result message at the given index. * * @param index the index of the message to return * @return the validation result message at the given index * @see javax.swing.ListModel#getElementAt(int) */ @Override public Object getElementAt(int index) { return model.getResult().getMessages().get(index); }
/** * Sets an empty {@link ValidationResult} as default result. * Useful at the begin of a validation sequence. */ public void clearResult() { defaultResult = new ValidationResult(); }
/** * Returns an unmodifiable List of the validation messages * that indicate errors. * * @return the List of error validation messages * * @see #getMessages() * @see #getWarnings() */ public List<ValidationMessage> getErrors() { return getMessagesWithSeverity(messageList, Severity.ERROR); }
/** * Returns the highest severity of this result's messages, * {@code Severity.OK} if there are no messages. * * @return the highest severity of this result's messages, * {@code Severity.OK} if there are no messages * * @see #hasMessages() * @see #hasErrors() * @see #hasWarnings() */ public Severity getSeverity() { return getSeverity(messageList); }
/** * Returns a string representation of the message list. * * @return a string representation of the message list */ public String getMessagesText() { return getMessagesText(messageList); }
/** * Returns the concatenation of all validation results that are held * by this container. * * @return the concatenation of all validation results that are held * by this container * * @see #getCollapsedValidationResult() */ public ValidationResult getExpandedValidationResult() { ValidationResult concatenation = new ValidationResult(); for (ValidationResultModel resultModel : childResultModels) { concatenation.addAllFrom(resultModel.getResult()); } return concatenation; }
/** * Returns the validation result message at the given index. * * @param index the index of the message to return * @return the validation result message at the given index * @see javax.swing.ListModel#getElementAt(int) */ public Object getElementAt(int index) { return model.getResult().getMessages().get(index); }
/** * Checks and answers whether this validation result has messages or not. * * @return true if there are messages, false if not * * @see #getSeverity() * @see #hasErrors() * @see #hasWarnings() */ public boolean hasMessages() { return !isEmpty(); }
/** * Sets an empty {@link ValidationResult} as default result. * Useful at the begin of a validation sequence. */ public final void clearResult() { defaultResult = new ValidationResult(); }
/** * Returns an unmodifiable List of the validation messages * that indicate warnings. * * @return the List of validation warnings * * @see #getMessages() * @see #getErrors() */ public List<ValidationMessage> getWarnings() { return getMessagesWithSeverity(messageList, Severity.WARNING); }
/** * Returns a string representation of the message list. * * @return a string representation of the message list */ public String getMessagesText() { return getMessagesText(messageList); }
/** * Returns an unmodifiable List of the validation messages * that indicate informations. * * @return the List of info validation messages * * @see #getMessages() * @see #getErrors() * @see #getWarnings() */ public List<ValidationMessage> getInfos() { return getMessagesWithSeverity(messageList, Severity.INFO); }
/** * Returns an unmodifiable List of the validation messages * that indicate warnings. * * @return the List of validation warnings * * @see #getMessages() * @see #getErrors() */ public List<ValidationMessage> getWarnings() { return getMessagesWithSeverity(messageList, Severity.WARNING); }
/** * Returns an unmodifiable List of the validation messages * that indicate errors. * * @return the List of error validation messages * * @see #getMessages() * @see #getWarnings() */ public List<ValidationMessage> getErrors() { return getMessagesWithSeverity(messageList, Severity.ERROR); }