java.lang.Object
io.github.mmm.validation.AbstractValidationResult
io.github.mmm.validation.ComposedValidationFailure
- All Implemented Interfaces:
Localizable
,LocalizableObject
,Composable<ValidationResult>
,ValidationResult
,Iterable<ValidationResult>
- Since:
- 1.0.0
-
Field Summary
FieldsFields inherited from interface io.github.mmm.base.i18n.Localizable
BUNDLE_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionComposedValidationFailure
(String source, boolean appendSources, ValidationResult... failures) The constructor.ComposedValidationFailure
(String source, ValidationResult... failures) The constructor.ComposedValidationFailure
(String code, String source, boolean appendSources, ValidationResult... failures) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionadd
(ValidationResult result) boolean
containsCode
(String code) getChild
(int index) int
protected void
getLocalizedMessage
(String indent, Locale locale, Appendable buffer, boolean verbose, boolean appendSrc) void
getLocalizedMessage
(Locale locale, Appendable buffer, boolean verbose) protected String
boolean
Methods inherited from class io.github.mmm.validation.AbstractValidationResult
appendCode, getCode, getSource, isValid, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mmm.base.lang.Composable
iterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.github.mmm.base.i18n.Localizable
getArgument, getLocalizedMessage, getLocalizedMessage, toLocalizable
Methods inherited from interface io.github.mmm.validation.ValidationResult
getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, getMessage
-
Field Details
-
CODE
- See Also:
-
-
Constructor Details
-
ComposedValidationFailure
The constructor.- Parameters:
source
- the optionalsource
. May benull
.failures
- theinvalid
ValidationResult
s to compose.
-
ComposedValidationFailure
public ComposedValidationFailure(String source, boolean appendSources, ValidationResult... failures) The constructor.- Parameters:
source
- the optionalsource
. May benull
.appendSources
- theappend sources flag
.failures
- theinvalid
ValidationResult
s to compose.
-
ComposedValidationFailure
public ComposedValidationFailure(String code, String source, boolean appendSources, ValidationResult... failures) The constructor.- Parameters:
code
- thecode
.source
- the optionalsource
. May benull
.appendSources
- theappend sources flag
.failures
- theinvalid
ValidationResult
s to compose.
-
-
Method Details
-
isAppendSources
public boolean isAppendSources()- Returns:
true
to append thesource
s of theValidationFailure
s to themessage
,false
otherwise.
-
getSeparator
- Returns:
- the line separator.
-
getChildCount
public int getChildCount() -
getChild
-
getLocalizedMessage
- Parameters:
locale
- is theLocale
to translate to.buffer
- theAppendable
where towrite
the message to.verbose
- the verbose flag (to includecode
(s), etc.- See Also:
-
getLocalizedMessage
protected void getLocalizedMessage(String indent, Locale locale, Appendable buffer, boolean verbose, boolean appendSrc) - Parameters:
indent
- the current indentation.locale
- theLocale
to translate to.buffer
- theAppendable
where towrite
the message to.verbose
- the verbose flag (to includecode
(s), etc.appendSrc
- theappend sources flag
.- See Also:
-
add
- Parameters:
result
- anotherValidationResult
to combine with this one.- Returns:
- the
ValidationResult
composed out of this with the givenresult
. - See Also:
-
containsCode
- Parameters:
code
- thecode
to check for.- Returns:
true
if thisValidationResult
itselfhas
the givencode
or recursivelycontains
suchValidationResult
s,false
otherwise.
-