java.lang.Object
org.controlsfx.validation.ValidationResult
Validation result. Can generally be thought of a collection of validation messages.
Allows for quick an painless accumulation of the messages.
Also provides ability to combine validation results
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(ValidationMessage message) Add one message to validation result.addAll(Collection<? extends ValidationMessage> messages) Add collection of validation messages.addAll(ValidationMessage... messages) Add several validation messages.addErrorIf(Control target, String text, boolean condition) Add one error to validation result with conditionAdd one info to validation result with conditionaddMessageIf(Control target, String text, Severity severity, boolean condition) Add one message to validation result with condition.addWarningIf(Control target, String text, boolean condition) Add one warning to validation result with conditioncombine(ValidationResult validationResult) Combine validation result with another.combineAll(Collection<ValidationResult> validationResults) Combine validation result with others.combineAll(ValidationResult... validationResults) Combine validation result with others.copy()Creates a copy of validation resultstatic final ValidationResultFactory method to create validation result out of one errorstatic final ValidationResultfromErrorIf(Control target, String text, boolean condition) Factory method to create validation result out of one errorstatic final ValidationResultFactory method to create validation result out of one infostatic final ValidationResultfromInfoIf(Control target, String text, boolean condition) Factory method to create validation result out of one infostatic final ValidationResultfromMessageIf(Control target, String text, Severity severity, boolean condition) Factory method to create validation result out of one message.static final ValidationResultfromMessages(Collection<? extends ValidationMessage> messages) Factory method to create validation result out of collection of messagesstatic final ValidationResultfromMessages(ValidationMessage... messages) Factory method to create validation result out of several messagesstatic final ValidationResultfromResults(Collection<ValidationResult> results) Factory method to create validation result out of collection of validation resultsstatic final ValidationResultfromResults(ValidationResult... results) Factory method to create validation result out of several validation resultsstatic final ValidationResultfromWarning(Control target, String text) Factory method to create validation result out of one warningstatic final ValidationResultfromWarningIf(Control target, String text, boolean condition) Factory method to create validation result out of one warningRetrieve errors represented by validation resultgetInfos()Retrieve infos represented by validation resultRetrieve all messages represented by validation resultRetrieve warnings represented by validation result
-
Constructor Details
-
ValidationResult
public ValidationResult()Creates empty validation result
-
-
Method Details
-
fromMessageIf
public static final ValidationResult fromMessageIf(Control target, String text, Severity severity, boolean condition) Factory method to create validation result out of one message. Messages withSeverity.OKwill be ignored.- Parameters:
target- validation targettext- message textseverity- message severitycondition- condition on which message will be added to validation result- Returns:
- New instance of validation result
-
fromErrorIf
Factory method to create validation result out of one error- Parameters:
target- validation targettext- message textcondition- condition on which message will be added to validation result- Returns:
- New instance of validation result
-
fromWarningIf
Factory method to create validation result out of one warning- Parameters:
target- validation targettext- message textcondition- condition on which message will be added to validation result- Returns:
- New instance of validation result
-
fromInfoIf
Factory method to create validation result out of one info- Parameters:
target- validation targettext- message textcondition- condition on which message will be added to validation result- Returns:
- New instance of validation result
-
fromError
Factory method to create validation result out of one error- Parameters:
target- validation targettext- message text- Returns:
- New instance of validation result
-
fromWarning
Factory method to create validation result out of one warning- Parameters:
target- validation targettext- message text- Returns:
- New instance of validation result
-
fromInfo
Factory method to create validation result out of one info- Parameters:
target- validation targettext- message text- Returns:
- New instance of validation result
-
fromMessages
Factory method to create validation result out of several messages- Parameters:
messages-- Returns:
- New instance of validation result
-
fromMessages
Factory method to create validation result out of collection of messages- Parameters:
messages-- Returns:
- New instance of validation result
-
fromResults
Factory method to create validation result out of several validation results- Parameters:
results- results- Returns:
- New instance of validation result, combining all into one
-
fromResults
Factory method to create validation result out of collection of validation results- Parameters:
results- results- Returns:
- New instance of validation result, combining all into one
-
copy
Creates a copy of validation result- Returns:
- copy of validation result
-
add
Add one message to validation result. Messages withSeverity.OKwill be ignored.- Parameters:
message- validation message- Returns:
- updated validation result
-
addMessageIf
public ValidationResult addMessageIf(Control target, String text, Severity severity, boolean condition) Add one message to validation result with condition. Messages withSeverity.OKwill be ignored.- Parameters:
target- validation targettext- message textseverity- message severitycondition- condition on which message will be added- Returns:
- updated validation result
-
addErrorIf
Add one error to validation result with condition- Parameters:
target- validation targettext- message textcondition- condition on which error will be added- Returns:
- updated validation result
-
addWarningIf
Add one warning to validation result with condition- Parameters:
target- validation targettext- message textcondition- condition on which warning will be added- Returns:
- updated validation result
-
addInfoIf
Add one info to validation result with condition- Parameters:
target- validation targettext- message textcondition- condition on which info will be added- Returns:
- updated validation result
-
addAll
Add collection of validation messages. Messages withSeverity.OKwill be ignored.- Parameters:
messages-- Returns:
- updated validation result
-
addAll
Add several validation messages. Messages withSeverity.OKwill be ignored.- Parameters:
messages-- Returns:
- updated validation result
-
combine
Combine validation result with another. This will create a new instance of combined validation result- Parameters:
validationResult-- Returns:
- new instance of combined validation result
-
combineAll
Combine validation result with others. This will create a new instance of combined validation result- Parameters:
validationResults-- Returns:
- new instance of combined validation result
-
combineAll
Combine validation result with others. This will create a new instance of combined validation result- Parameters:
validationResults-- Returns:
- new instance of combined validation result
-
getErrors
Retrieve errors represented by validation result- Returns:
- an unmodifiable collection of errors
-
getWarnings
Retrieve warnings represented by validation result- Returns:
- an unmodifiable collection of warnings
-
getInfos
Retrieve infos represented by validation result- Returns:
- an unmodifiable collection of infos
-
getMessages
Retrieve all messages represented by validation result- Returns:
- an unmodifiable collection of messages
-