public interface ErrorAttachable
The recollection of all generated errors while configuring
an Injector, instantiating a class, injecting fields or
methods is very important. We need to report all the errors,
not only the first (Uncaught exceptions breaks the execution)
| Modifier and Type | Method and Description |
|---|---|
void |
applySnapshot(java.util.List<java.lang.String> errorMessages)
Applies a snapshot, memento design pattern
|
void |
attach(java.lang.String... errorMessages)
Stores all the
errorMessages in this object |
void |
attach(java.lang.String header,
java.lang.Throwable error)
Attaches the specified error using the specified
reason/title/header.
|
void |
attachAll(ErrorAttachable attachable)
Stores all the errors of the specified
attachable
into this object |
int |
errorCount()
Returns the current error count
|
java.lang.String |
formatMessages()
Formats the error messages in one message
|
java.util.List<java.lang.String> |
getErrorMessages()
Gets an immutable copy of all the attached
error messages.
|
boolean |
hasErrors() |
void |
reportAttachedErrors()
Removes all the attached errors and reports it
to the user
|
void attach(java.lang.String... errorMessages)
errorMessages in this objecterrorMessages - The reported error messagesvoid attach(java.lang.String header,
java.lang.Throwable error)
header - The error headererror - The errorvoid attachAll(ErrorAttachable attachable)
attachable
into this objectattachable - The error attachablejava.util.List<java.lang.String> getErrorMessages()
void applySnapshot(java.util.List<java.lang.String> errorMessages)
errorMessages - The error messagesjava.lang.String formatMessages()
int errorCount()
boolean hasErrors()
void reportAttachedErrors()