Class AbstractValidationResult
java.lang.Object
ch.tocco.nice2.validate.api.result.AbstractValidationResult
- All Implemented Interfaces:
ValidationResult
- Direct Known Subclasses:
CommitValidationResult
,CompleteEntityValidationResult
,EntityValidationResult
,FieldValidationResult
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
UNCHECKED => either not checked yet, or check skipped because others failed already. PRECONDITION_FAILED => for example a check that involves multiple fields is not executed because some information is missing; a definite check and result cannot be given at this time. this state could be used in the gui to not set the color of a field to green yet. DISABLED => for example after a warning which was suppressed, or a condition that disables it, or not checked because the value was empty. it can also mean "ignored". That might be the better name anyway. OK => check done and succeeded INFO => check done and theoretically failed but only fires an "info text". such a test cannot "fail". WARN => check done and succeeded, but a warning was issued. this may be ignored, logged, or shown to the user "are you sure?". ERROR => check done and failed
-
Field Summary
Modifier and TypeFieldDescriptionprotected List
<AbstractValidationResult> protected ArrayList
<TextMessage> protected AbstractValidationResult.Status
protected Class
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_toString
(AbstractValidationResult vRes, boolean onlyNotOkChildren) Deprecated.void
addChild
(AbstractValidationResult child) void
Adds the child FieldValidationResult and passes the status code up to this result if it is worse than what we currently have.getIndent
(int tabCount) Returns tabs to be inserted in front of text output.protected String
getName()
Use the methods on the status object to find out more.void
setError
(TextMessage msg) sets the status toAbstractValidationResult.Status.ERROR
and sets the passedTextMessage
void
setMessage
(TextMessage msg) void
void
setValidationHint
(String validationHint) Sets a hint to be added to the log output pointing to the reason for the validation result.void
setValidatorClass
(Class validatorClass) void
setValidatorName
(String validatorName) simplePrint
(boolean errorsOnly) toString()
toString
(boolean onlyNotOk) Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.validate.api.result.ValidationResult
accept
-
Field Details
-
validatorName
-
validatorClass
-
children
-
status
-
messages
-
-
Constructor Details
-
AbstractValidationResult
protected AbstractValidationResult()
-
-
Method Details
-
getValidatorName
-
setValidatorName
-
getValidatorClass
-
setValidatorClass
-
getStatus
Use the methods on the status object to find out more. -
setStatus
-
setError
sets the status toAbstractValidationResult.Status.ERROR
and sets the passedTextMessage
- Parameters:
msg
- a text message for the error
-
setMessage
-
getMessages
-
getChildren
-
addChild
-
addChildAndCheckStatus
Adds the child FieldValidationResult and passes the status code up to this result if it is worse than what we currently have. -
toString
-
toString
Deprecated.- Parameters:
onlyNotOk
- Returns only validation results that were run and ended in a not-ok status.
-
_toString
Deprecated. -
getName
-
simplePrint
-
getIndent
Returns tabs to be inserted in front of text output.- Parameters:
tabCount
- the amount of tabs to be generated- Returns:
- the indent as a string of tabs
-
setValidationHint
Sets a hint to be added to the log output pointing to the reason for the validation result. Will be added to the output if no message was added during validation.- Parameters:
validationHint
- the hint used for output- See Also:
-